Skip to content

feat(bar): show edit window rule when rule exists - #3516

Merged
bbedward merged 2 commits into
duxlabs-dev:masterfrom
hthienloc:feat/focused-app-edit-window-rule
Sep 21, 2026
Merged

bbedward merged 2 commits into
duxlabs-dev:masterfrom
hthienloc:feat/focused-app-edit-window-rule

Conversation

@hthienloc

Copy link
Copy Markdown
Member

Check existing dms-managed window rules when the focused window popout opens. If a matching rule exists for the focused window, show 'Edit window rule' and open the rule in edit mode via showEdit(). Otherwise, keep showing 'Add window rule' for new rule creation.

Check existing DMS-managed window rules when the focused window popout
opens. If a matching rule exists for the focused window, show
'Edit window rule' and open the rule in edit mode via showEdit().
Otherwise, keep showing 'Add window rule' for new rule creation.
@hthienloc

Copy link
Copy Markdown
Member Author

/claude review

@claude

claude Bot commented Sep 20, 2026

Copy link
Copy Markdown
Contributor

Claude review

Two issues: a stale-rule race that can edit the wrong rule, and a new untranslated string that duplicates an existing catalog term.

  • matchingRule not cleared before the async lookup, so the previous window's rule leaks into the next popout open (and persists on non-zero exit), quickshell/Modules/DankBar/Widgets/FocusedWindowContextMenu.qml:64
  • I18n.tr("Edit window rule") adds a new term; "Edit Window Rule" already exists in en.json, quickshell/Modules/DankBar/Widgets/FocusedWindowContextMenu.qml:350

Checked: rule matching vs core/internal/windowrules JSON shape, Proc.runCommand lifecycle, loader/modal open path, popout property handlers, translation catalog. Model: claude-opus-5.

- Clear matchingRule up front in checkMatchingRule() to prevent showing previous window's rule while async query is in flight
- Reuse existing catalog term 'Edit Window Rule' to leverage existing translations
@hthienloc

Copy link
Copy Markdown
Member Author

/claude review

@claude

claude Bot commented Sep 20, 2026

Copy link
Copy Markdown
Contributor

Claude review

No issues found.

Both findings from the previous round are fixed: matchingRule is now cleared synchronously at the top of checkMatchingRule() before the async lookup (so a non-zero exit or a stale-window return leaves it null, not the previous window's rule), and the label reuses the existing "Edit Window Rule" catalog term.

Checked: open/close and focus-change paths into checkMatchingRule() (syncPopoutState sets currentWindow before toggle(), and onActiveWindowChanged re-syncs while open — both re-trigger the check), Proc.runCommand debounce/callback lifecycle and closure release, rule JSON shape vs WindowRulesTab/WindowRuleModal (source, id, matches/matchCriteria), showEdit() -> update CLI path with editingRule.id, loader item/Qt.callLater ordering, supportsWindowRules gating, on<Prop>Changed handlers on the same-file source (no Connections), and both strings present in translations/en.json with no catalog edits. Model: claude-opus-5.

@bbedward
bbedward merged commit 21cd0a7 into duxlabs-dev:master Sep 21, 2026
2 checks passed
@hthienloc
hthienloc deleted the feat/focused-app-edit-window-rule branch November 15, 2026 15:38
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.

2 participants