feat(cardwire-gui): add a log page - #159
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: ASSERTIVE Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
📝 WalkthroughSummary by CodeRabbit
WalkthroughThe GUI now receives blocked-process logs through D-Bus, stores up to 500 entries, and displays them on the Logs page. GPU controls now apply to available non-default GPUs in manual mode. ChangesGUI log integration
Estimated code review effort: 3 (Moderate) | ~20 minutes Sequence Diagram(s)sequenceDiagram
participant logger_sub
participant CardwireLogger
participant AppState
participant LogsPage
logger_sub->>CardwireLogger: Fetch blocked-process logs
CardwireLogger-->>logger_sub: Initial LogEntry queue
logger_sub->>AppState: FetchedLogs
CardwireLogger-->>logger_sub: Log-change signal
logger_sub->>AppState: NewLog(LogEntry)
AppState->>LogsPage: Render LogState and GPU list
Possibly related PRs
Suggested reviewers: 🚥 Pre-merge checks | ✅ 3 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (3 passed)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 3
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@crates/cardwire-gui/src/models.rs`:
- Around line 96-99: Update LogState::replace to enforce MAX_GUI_LOG_ENTRIES
before assigning the incoming queue: remove the oldest entries until the queue
is within the limit, then store the trimmed queue in self.logs.
In `@crates/cardwire-gui/src/subscription.rs`:
- Around line 563-575: The subscription flow around proxy.process_blocked() and
proxy.receive_process_blocked_changed() can lose events between the snapshot and
signal registration. Replace this sequence with an atomic daemon
snapshot-and-subscribe operation; alternatively, subscribe first with ordered
event identifiers, then obtain and reconcile a snapshot so every blocked-process
event reaches LogState.
- Around line 591-595: Update the logger subscription stream-termination
handling around the `Message::FetchedMode` send to emit the log-specific error
message variant expected by the UI instead of reporting a mode-fetch failure.
Preserve the existing “Cardwire daemon disconnected” error text and async send
behavior.
🪄 Autofix
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: ASSERTIVE
Plan: Pro Plus
Run ID: 447e82ed-9d14-410b-b14b-aacbc99531d7
⛔ Files ignored due to path filters (1)
Cargo.lockis excluded by!**/*.lock
📒 Files selected for processing (7)
Cargo.tomlcrates/cardwire-gui/Cargo.tomlcrates/cardwire-gui/src/app.rscrates/cardwire-gui/src/message.rscrates/cardwire-gui/src/models.rscrates/cardwire-gui/src/subscription.rscrates/cardwire-gui/src/ui.rs
Description
Please include a summary of the changes and if applicable, a related issue.
If this PR introduce a new feature, explain your motivations
Fixes # (issue)
TODO
Checklist: