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

chat control #1092

Merged
merged 14 commits into from May 17, 2024
Merged

chat control #1092

merged 14 commits into from May 17, 2024

Conversation

FredLL-Avaiga
Copy link
Member

@FredLL-Avaiga FredLL-Avaiga commented Apr 5, 2024

resolves #1044

image

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

def button_action(state):
    msgs.loc[msgs.shape[0]] = [f"{msgs.shape[0] +1 }", "msg sent from Button", "taipy"]
    state.msgs = msgs

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

<|part|>

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

<|Send|button|on_action=button_action|>
""",
    path_mapping={"images": "c:\\users\\jeu\\downloads"},
).run()

Copy link
Contributor

github-actions bot commented Apr 5, 2024

Coverage report for frontend/taipy-gui

Branches coverage not met for global: expected >=80%, but got 62.57692307692307%

St.
Category Percentage Covered / Total
🟢 Statements
81.02% (+0.42% 🔼)
2562/3162
🟡 Branches
62.58% (-0.48% 🔻)
1627/2600
🟡 Functions
73.95% (-0.15% 🔻)
440/595
🟢 Lines
81.6% (+0.55% 🔼)
2391/2930
Show new covered files 🐣
St.
File Statements Branches Functions Lines
🟢
... / Dialog.tsx
80.43% 60.87% 100% 80.43%
🟡
... / TaipyRendered.tsx
64.58% 14.29% 50% 64.58%
🟡
... / index.ts
74.47% 26.67% 50% 73.91%
🟢
... / Chat.tsx
89.92% 68.48% 79.17% 91.27%
🟢
... / Expandable.tsx
100% 85% 100% 100%
🟢
... / PageContent.tsx
75% 100% 0% 100%
🟢
... / Pane.tsx
95.12% 73.81% 100% 94.87%
🟢
... / Part.tsx
88% 64.29% 75% 91.3%
🟡
... / Unregistered.tsx
62.5% 0% 0% 60%
Show files with reduced coverage 🔻
St.
File Statements Branches Functions Lines
🟢 utils/hooks.ts
80.95% (+0.07% 🔼)
80.56% (-8.33% 🔻)
75% (-7.35% 🔻)
81.16% (+3.57% 🔼)

Test suite run success

366 tests passing in 38 suites.

Report generated by 🧪jest coverage report action from d3c429b

Copy link
Member

@FabienLelaquais FabienLelaquais left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

😶

Copy link
Member

@dinhlongviolin1 dinhlongviolin1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!!!

@FredLL-Avaiga FredLL-Avaiga merged commit 3bf293a into develop May 17, 2024
64 of 65 checks passed
@FredLL-Avaiga FredLL-Avaiga deleted the feature/#1044-chat branch May 17, 2024 07:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
GUI: Front-End 🖰 GUI Related to GUI ✨New feature 🟥 Priority: Critical Must be addressed as soon as possible 📝Release Notes Impacts the Release Notes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Create a chat control
3 participants