Skip to content

Release v0.3 — more improvements#4

Merged
AlanRockefeller merged 1 commit intomainfrom
test
Nov 2, 2025
Merged

Release v0.3 — more improvements#4
AlanRockefeller merged 1 commit intomainfrom
test

Conversation

@AlanRockefeller
Copy link
Copy Markdown
Owner

@AlanRockefeller AlanRockefeller commented Nov 2, 2025

Summary by CodeRabbit

  • New Features

    • Directory selection dialog now appears on startup when no image directory is configured, allowing users to choose one
  • Bug Fixes

    • Theme changes now properly synchronize in real-time across the entire user interface

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Nov 2, 2025

Walkthrough

The changes implement a theme change notification system that synchronizes theme state between the Python backend and QML frontend by adding a new signal to UIState. AppController now emits this signal after updating the theme, while QML listens for it to keep its theme state in sync. Additionally, the main function now prompts for directory selection when no image directory is provided instead of exiting.

Changes

Cohort / File(s) Summary
Theme State Synchronization
faststack/faststack/app.py, faststack/faststack/ui/provider.py, faststack/faststack/qml/Main.qml
AppController.set_theme() now emits a themeChanged signal after updating theme configuration. UIState class adds a new public themeChanged signal. QML Main.qml converts isDarkTheme to a dynamic getter, delegates toggleTheme to uiState.set_theme(), and adds Connections block to listen for theme changes and synchronize state.
Directory Selection Dialog
faststack/faststack/app.py
main() function now opens a directory selection dialog when no image_dir is provided instead of logging and exiting; uses selected path if provided, or exits on user cancellation.

Sequence Diagram(s)

sequenceDiagram
    actor User
    participant QML as Main.qml
    participant AppController
    participant UIState as ui/provider.py
    
    User->>QML: Click toggleTheme
    QML->>AppController: set_theme(0 or 1)
    AppController->>UIState: Save theme to config
    AppController->>UIState: themeChanged.emit()
    UIState-->>QML: themeChanged signal
    QML->>UIState: get_theme()
    UIState-->>QML: Return theme value
    QML->>QML: Update isDarkTheme property
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

  • Verify signal connection between AppController and QML Main.qml properly establishes and fires
  • Confirm theme value semantics (0 = dark, 1 = light) are consistent across Python backend and QML frontend
  • Validate directory selection dialog integration in main() handles user cancellation and path validation correctly
  • Check that isDarkTheme property binding doesn't create circular updates when theme changes

Pre-merge checks and finishing touches

❌ Failed checks (1 warning, 1 inconclusive)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 25.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
Title Check ❓ Inconclusive The pull request title "Release v0.3 — more improvements" is vague and generic. While it indicates that this is a release with enhancements, the phrase "more improvements" does not convey meaningful information about the actual changes in the changeset. The PR includes specific improvements such as adding theme change signals, implementing dynamic theme getters, and adding a directory selection dialog, but none of these are reflected in the broad, non-descriptive title. The title would apply to almost any release that includes bug fixes or enhancements. Consider making the title more specific by highlighting one of the primary changes in the changeset. For example, "Add theme change signal and synchronization" or "Improve theme handling with signals and directory selection" would better convey what this release actually delivers and help team members understand the changeset at a glance.
✅ Passed checks (1 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch test

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.

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🧹 Nitpick comments (1)
faststack/faststack/app.py (1)

82-83: Consider removing redundant theme initialization.

With the new dynamic property binding in Main.qml (line 15: isDarkTheme: uiState.get_theme() === 0), this setProperty call appears redundant. The QML property is already initialized from the backend state, so directly setting it from Python may be unnecessary or could conflict with the binding.

Consider removing these lines:

-    theme = config.get('core', 'theme')
-    self.main_window.setProperty('isDarkTheme', theme == 'dark')
-
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between b5a0b9c and 61e0e59.

📒 Files selected for processing (3)
  • faststack/faststack/app.py (2 hunks)
  • faststack/faststack/qml/Main.qml (1 hunks)
  • faststack/faststack/ui/provider.py (1 hunks)
🔇 Additional comments (5)
faststack/faststack/ui/provider.py (1)

59-59: LGTM!

The themeChanged signal is properly declared and follows the existing pattern. This enables QML to reactively update when the theme changes.

faststack/faststack/qml/Main.qml (3)

15-15: LGTM!

The property now initializes dynamically from the backend state, ensuring theme consistency on startup.


21-23: LGTM!

The theme toggle correctly delegates to the backend, which will persist the change and notify listeners.


25-30: LGTM!

The Connections block properly listens for theme changes and synchronizes the UI state, ensuring consistency when the theme is changed from any source.

faststack/faststack/app.py (1)

316-316: LGTM!

Emitting themeChanged after persisting the configuration enables the QML layer to synchronize its theme state.

Comment thread faststack/faststack/app.py
@AlanRockefeller AlanRockefeller merged commit 107a009 into main Nov 2, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant