Skip to content

Conversation

@mkh-user
Copy link
Member

@mkh-user mkh-user commented Oct 10, 2025

Type of Change

  • Bug fix

Description

The Mode Viewer includes a popup menu that displays a list of available modes and their corresponding extensions. Prior to this update, this popup menu was empty when the editor was launched (and before the mode was changed).

Testing

Works fine

Impact

Nothing

Additional Information

Current behavior updates popup menu at mode changing, but we can have more specific trigger.

Checklist

  • My code adheres to the coding and style guidelines of the project.
  • I have performed a self-review of my own code.
  • I have commented my code, particularly in hard-to-understand areas.
  • I have made corresponding changes to the documentation.
  • My changes generate no new warnings
  • Changes were added to CHANGELOG

Summary by CodeRabbit

  • Bug Fixes

    • Fixed an issue where the Mode Viewer’s popup menu appeared empty on startup. The menu now initializes correctly and reflects the current mode immediately, so users see the correct options without needing to switch modes or trigger any updates.
  • Documentation

    • Added an Unreleased section to the changelog documenting the Mode Viewer startup menu fix.

@mkh-user mkh-user self-assigned this Oct 10, 2025
@mkh-user mkh-user added the bug A confirmed issue causing incorrect behavior or unexpected results label Oct 10, 2025
@mkh-user mkh-user added this to the Text Forge 0.2 milestone Oct 10, 2025
@mkh-user mkh-user moved this from Needs Review to In Progress in Release: Text Forge 1.0 Oct 10, 2025
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Oct 10, 2025

Walkthrough

Adds an “Unreleased” entry to CHANGELOG. In Mode Viewer script, the _ready() method now calls _update_mode() immediately after connecting the mode_changed signal to ensure the UI reflects the current mode at startup.

Changes

Cohort / File(s) Summary of Changes
Documentation
CHANGELOG.md
Added Unreleased section noting a fix for the Empty Mode Viewer popup menu at startup (#116).
Mode Viewer init flow
core/scripts/mode_viewer.gd
In _ready(), invokes _update_mode() right after connecting mode_changed, ensuring initial mode display is set before any signal emits.

Sequence Diagram(s)

sequenceDiagram
  autonumber
  actor User
  participant Engine as Godot Engine
  participant MV as ModeViewer (_ready)
  participant MM as ModeManager
  participant UI as Mode Display

  User->>Engine: Launch app / open scene
  Engine->>MV: _ready()
  MV->>MM: connect(mode_changed, handler)
  note right of MV: New: immediate initialization
  MV->>MV: _update_mode()
  MV->>UI: Render current mode

  MM-->>MV: mode_changed (later)
  MV->>MV: _update_mode()
  MV->>UI: Update displayed mode
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Poem

I hopped through modes at break of day,
A tiny fix now lights the way—
On ready, poof! the state appears,
No empty menus, no more fears.
Changelog squeaks: “Unreleased cheer!”
Bugs be gone—carrots near! 🥕

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title Check ✅ Passed The title succinctly describes the pull request’s main change by naming the specific bug fix for the mode viewer popup being empty at startup, exactly matching the PR’s core objective without extra wording.
Docstring Coverage ✅ Passed No functions found in the changes. Docstring coverage check skipped.
✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fix-empty-mode-viewer-at-startup

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between d7cd45d and d7403ca.

📒 Files selected for processing (2)
  • CHANGELOG.md (1 hunks)
  • core/scripts/mode_viewer.gd (1 hunks)
🔇 Additional comments (2)
core/scripts/mode_viewer.gd (1)

3-5: LGTM! Fix correctly initializes the mode viewer at startup.

The addition of _update_mode() after connecting the signal ensures the popup menu is populated when the editor launches, addressing the reported bug. The signal connection on line 4 still ensures updates occur when the mode changes at runtime.

CHANGELOG.md (1)

8-11: LGTM! Changelog entry is properly formatted.

The unreleased section correctly documents the bug fix with appropriate categorization and PR reference, following the Keep a Changelog format.


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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@mkh-user mkh-user merged commit dc2e063 into Main Oct 10, 2025
2 checks passed
@github-project-automation github-project-automation bot moved this from In Progress to Completed in Release: Text Forge 1.0 Oct 10, 2025
@mkh-user mkh-user deleted the fix-empty-mode-viewer-at-startup branch October 10, 2025 07:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug A confirmed issue causing incorrect behavior or unexpected results

Projects

Status: Completed

Development

Successfully merging this pull request may close these issues.

2 participants