feat(cardwired): refresh the internal xdg apps list on new app - #164
Merged
Conversation
Contributor
📝 WalkthroughSummary by CodeRabbit
WalkthroughThe daemon now discovers XDG application folders, parses desktop entries through a shared helper, and monitors those folders with inotify. ChangesDesktop application watching
Estimated code review effort: 4 (Complex) | ~45 minutes Sequence Diagram(s)sequenceDiagram
participant CardwireAnalyzer
participant watch_fdo_folders
participant inotify
participant parse_fdo_app
participant ApplicationMap
CardwireAnalyzer->>watch_fdo_folders: start with XDG folders and shared map
watch_fdo_folders->>inotify: register directory watches
inotify-->>watch_fdo_folders: report desktop-file event
watch_fdo_folders->>parse_fdo_app: parse changed .desktop file
parse_fdo_app-->>watch_fdo_folders: return application metadata
watch_fdo_folders->>ApplicationMap: merge metadata under write lock
Possibly related PRs
🚥 Pre-merge checks | ✅ 3 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (3 passed)
Comment |
Contributor
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 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-daemon/src/analyzer/static_analysis.rs`:
- Around line 111-169: In static_analysis.rs:111-169, register inotify watches
before the initial application scan, include DELETE and MOVED_FROM in the watch
mask, and rebuild and replace xdg_list—not extend it—after removals, renames,
metadata changes, or Q_OVERFLOW. Update the related application-list logic in
models.rs:85-89 and models.rs:118-124 to support rebuilding a coherent snapshot
and replacing stale aliases.
🪄 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: f5ce72ce-ed89-4350-87c9-a03e0854d0f6
⛔ Files ignored due to path filters (1)
Cargo.lockis excluded by!**/*.lock
📒 Files selected for processing (4)
Cargo.tomlcrates/cardwire-daemon/Cargo.tomlcrates/cardwire-daemon/src/analyzer/models.rscrates/cardwire-daemon/src/analyzer/static_analysis.rs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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: