Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create a chat control #1044

Closed
4 tasks
FlorianJacta opened this issue Mar 25, 2024 · 1 comment · Fixed by #1092
Closed
4 tasks

Create a chat control #1044

FlorianJacta opened this issue Mar 25, 2024 · 1 comment · Fixed by #1092
Assignees
Labels
🖰 GUI Related to GUI ✨New feature 🟨 Priority: Medium Not blocking but should be addressed
Milestone

Comments

@FlorianJacta
Copy link
Member

What would that feature address
It will allow the user to easily create chats in Taipy, as chats are used often.

Acceptance Criteria

  • Ensure new code is unit tested, and check code coverage is at least 90%
  • Create related issue in taipy-doc for documentation and Release Notes
  • Check if a new demo could be provided based on this, or if legacy demos could be benefit from it
  • Ensure any change is well documented
@FlorianJacta FlorianJacta added 🖰 GUI Related to GUI 🟨 Priority: Medium Not blocking but should be addressed ✨New feature labels Mar 25, 2024
@FredLL-Avaiga FredLL-Avaiga self-assigned this Apr 2, 2024
FredLL-Avaiga pushed a commit that referenced this issue Apr 5, 2024
resolves #1044
@FredLL-Avaiga
Copy link
Member

FredLL-Avaiga commented Apr 5, 2024

from taipy.gui import Gui, Icon

msgs = [
    ["1", "msg 1", "Fred"],
    ["2", "msg From Another unknown User", "Fredo"],
    ["3", "This from the sender User", "taipy"],
    ["4", "And from another known one", "Fredi"],
]

users = [["Fred", Icon("/images/favicon.png", "Fred.png")], ["Fredi", Icon("/images/fred.png", "Fred.png")]]


def on_action(state, var_name: str, payload: dict):
    args = payload.get("args", [])
    msgs.append([f"{len(msgs) +1 }", args[2], args[3]])
    state.msgs = msgs



Gui(
    """
<|toggle|theme|>
# Test Chat
<|1 1 1|layout|
<|{msgs}|chat|users={users}|>

<|part|>

<|{msgs}|chat|users={users}|not with_input|>
|>

""",
    path_mapping={"images": "c:\\users\\jeu\\downloads"},
).run()

@trgiangdo trgiangdo added this to the Community 3.2 milestone Apr 8, 2024
FredLL-Avaiga pushed a commit that referenced this issue Apr 8, 2024
resolves #1044
FredLL-Avaiga pushed a commit that referenced this issue May 3, 2024
resolves #1044
FredLL-Avaiga pushed a commit that referenced this issue May 3, 2024
resolves #1044
FredLL-Avaiga added a commit that referenced this issue May 17, 2024
* chat control
resolves #1044

* WiP use data type and pagination for messages

* pagination WiP

* fix tests

* manage new message indicator

* cleaning

* use rowCount

* make it work

* fix js tests

* fix doc

* fix tests

* managing load more

* pagesize in data key

---------

Co-authored-by: Fred Lefévère-Laoide <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🖰 GUI Related to GUI ✨New feature 🟨 Priority: Medium Not blocking but should be addressed
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants