-
Notifications
You must be signed in to change notification settings - Fork 4.1k
better level chat #7943
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
better level chat #7943
Conversation
WalkthroughThis pull request refines the localization and UI behavior for chat credit messages and related components. The Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant ChatbotHint as Chatbot Hint Element
participant PAV as ProblemAlertView
participant Timer as Timeout
User->>ChatbotHint: Click on chatbot hint
ChatbotHint->>PAV: Trigger popover initialization
PAV->>Timer: Set timeout (3000ms) for popover hide
Timer-->>PAV: Timer expires
PAV->>ChatbotHint: Hide popover
sequenceDiagram
participant User
participant SV as SpellView
participant Solution as Solution Element
User->>SV: Toggle solution display
alt Solution is hidden
SV->>Solution: Add 'display' class
SV->>Solution: Set opacity = 1
SV->>SV: Publish message to hide problem alert
else Solution is visible
SV->>Solution: Remove 'display' class
end
Assessment against linked issues
Possibly related PRs
Suggested reviewers
Poem
Tip ⚡🧪 Multi-step agentic review comment chat (experimental)
✨ Finishing Touches
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (4)
app/locale/zh-HANS.js (1)
5469-5477
: Minor spacing nit: Consider unifying around parentheses.
The spacing in “没有 AI 问答次数了( 这一__duration_key__)” and “( 这 duration_amount duration_key)” might look a bit inconsistent. Consider removing extra spaces for a cleaner look, e.g. "没有 AI 问答次数了 (这一__duration_key__)".app/views/play/level/tome/SpellView.coffee (1)
1849-1849
: Consider adding a fade-in transition for a smoother user experience.Currently, setting
solution.style.opacity = 1
works correctly for immediate visibility, but a small fade-in animation could enhance the transition.app/views/play/level/tome/ProblemAlertView.coffee (1)
70-71
: Consider clearing old timeouts on repeated clicks.Hiding the popover after 3 seconds is fine. If the user clicks multiple times quickly, multiple setTimeouts may stack. A simple check or clearing the previous timeout could resolve potential overlaps.
app/views/play/level/LevelChatView.coffee (1)
94-94
: Remove or clarify commented-out code.This line is inactive. If no longer needed, consider removing it or adding a comment explaining its future use.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (6)
app/lib/user-utils.js
(1 hunks)app/locale/en.js
(1 hunks)app/locale/zh-HANS.js
(2 hunks)app/views/play/level/LevelChatView.coffee
(1 hunks)app/views/play/level/tome/ProblemAlertView.coffee
(1 hunks)app/views/play/level/tome/SpellView.coffee
(1 hunks)
👮 Files not reviewed due to content moderation or server errors (1)
- app/locale/en.js
🔇 Additional comments (2)
app/locale/zh-HANS.js (1)
1050-1050
: Translation addition looks good.
No issues found with “隐藏” for “chat_fix_hide.”app/lib/user-utils.js (1)
96-96
: Localization key usage looks good.Using
i18nKey
for duration-based messages is consistent and improves localization. No issues found.Also applies to: 99-99, 101-101, 105-105, 107-107
fix ENG-1710

the credit message popover can't closed if the user forget to click the question mark again and the problemAlert view auto hide. so I add a 3s auto close function. the double click still be able to close the popover, and if not, popover would auto closed in 3s.
other updates are mainly about i18n.
Summary by CodeRabbit