chore: edit welcome dialogue behavior#1743
Conversation
Edits behavior of welcome dialogue box to be more user friendly and direct.
📝 WalkthroughWalkthroughToggleKey no longer toggles Menu::IsEnabled while HomePageRenderer::ShouldShowFirstTimeSetup() is true. The first-time setup UI was redesigned with a modal background, centralized centering helpers, a bracketed hotkey capture flow with pulsing/scale, and breathing help text; new UI util helpers were added. Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant UI as HomePageRenderer
participant Input as InputSystem
participant Menu
User->>UI: Click hotkey area
UI->>UI: If not capturing -> enter capture mode (isCapturing = true)
UI->>Input: Start capturing next key
Note right of Input: Wait for key event
Input-->>UI: Deliver captured key
UI->>UI: Update hotkey, exit capture mode
UI-->>User: Render updated hotkey (brackets, scaled/pulsing)
sequenceDiagram
participant Keyboard
participant Menu
participant Home as HomePageRenderer
Keyboard->>Menu: ToggleKey pressed
Menu->>Home: ShouldShowFirstTimeSetup()?
alt First-time setup shown
Home-->>Menu: true
Menu-->>Keyboard: Ignore toggle (no IsEnabled change)
else Not shown
Home-->>Menu: false
Menu->>Menu: Toggle IsEnabled
Menu-->>Keyboard: Acknowledge
end
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ 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. Comment |
Automated formatting by clang-format, prettier, and other hooks. See https://pre-commit.ci for details.
|
✅ A pre-release build is available for this PR: |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Fix all issues with AI agents
In `@src/Utils/UI.cpp`:
- Around line 648-655: In DrawBreathingText the sinf result is used directly
causing values to map from [-1,1] and produce alpha below minAlpha; change the
mapping so sinf is remapped to [0,1] before scaling into [minAlpha,maxAlpha]
(e.g., use (sinf(...) + 1.0f) * 0.5f), compute breathe = minAlpha + alphaRange *
mappedSin, and optionally clamp the result; update the breathe calculation in
DrawBreathingText accordingly.
🧹 Nitpick comments (2)
src/Menu/HomePageRenderer.cpp (2)
371-388: Consider extracting pulse animation constants.The pulse effect on lines 375-380 contains magic numbers
0.7f,0.3f, and4.0f. For consistency with the newly added constants (HOTKEY_HOVER_DIM_FACTOR, etc.) and ease of maintenance, consider extracting these.Note: The formula
0.7f + 0.3f * sinf(...)produces a range of[0.4, 1.0](same pattern as theDrawBreathingTextbug). If the intent is[0.7, 1.0], apply the same fix.♻️ Suggested constants and fixed formula
Add to
HomePageRenderer.h:static constexpr float HOTKEY_PULSE_SPEED = 4.0f; static constexpr float HOTKEY_PULSE_MIN = 0.7f; static constexpr float HOTKEY_PULSE_MAX = 1.0f;Then in the implementation:
- float pulse = 0.7f + 0.3f * sinf((float)ImGui::GetTime() * 4.0f); + float pulseRange = HOTKEY_PULSE_MAX - HOTKEY_PULSE_MIN; + float pulse = HOTKEY_PULSE_MIN + pulseRange * 0.5f * (1.0f + sinf((float)ImGui::GetTime() * HOTKEY_PULSE_SPEED));
330-338: Minor: consider extracting spacing constant.Line 336 uses
-4.0ffor reducing spacing between the two text lines. While functional, extracting this to a named constant (e.g.,VERSION_LINE_SPACING_OFFSET) would improve clarity about the intent.
|
Imperative voice for the commit message please. |
Edited behavior of welcome dialogue to be more user friendly and intuitive.
Summary by CodeRabbit
Bug Fixes
New Features
Style
✏️ Tip: You can customize this high-level summary in your review settings.