Skip to content

notifications: add invokeLast ipc to run the newest notification's default action - #3734

Merged
purian23 merged 2 commits into
duxlabs-dev:masterfrom
Mario-Mohar:feat/notifications-invoke-last
Oct 9, 2026
Merged

purian23 merged 2 commits into
duxlabs-dev:masterfrom
Mario-Mohar:feat/notifications-invoke-last

Conversation

@Mario-Mohar

@Mario-Mohar Mario-Mohar commented Oct 9, 2026 •

Copy link
Copy Markdown
Contributor

Description

Adds dms ipc call notifications invokeLast. It runs the default action of the newest notification and dismisses it, the same as clicking its popup. If the notification has no action called default, it uses the first one, like Enter in the notification center does. When there is nothing to invoke it returns NOTIFICATION_INVOKE_NO_ACTION.

This makes the screenshot case from the issue a single keybind, for example dms ipc call notifications invokeLast to open the newest screenshot in the editor.

Tested in a nested Hyprland session with the dev build: sent two notifications with notify-send --action, then called invokeLast twice. The first call invoked the newest one, the second call the older one, and a third call with nothing left returned NOTIFICATION_INVOKE_NO_ACTION. tests/notification-invoke-last.test.mjs covers picking the newest notification, preferring default over the first action, and the no action case.

Type of change

  • Bug fix (non-breaking change that fixes an issue)
  • New feature (non-breaking change that adds functionality)
  • Breaking change (fix or feature that changes existing behavior)
  • Refactor / internal cleanup
  • Documentation
  • Other

Related issues

Closes #3675

Screenshots / video

No visual change.

Checklist

  • My code follows the conventions in CONTRIBUTING.md
  • I have tested my changes locally
  • New user-facing strings are wrapped in I18n.tr() with translator context, reusing existing terms where possible
  • Go changes: ran make fmt, added/updated tests, make test passes, and go mod tidy is clean
  • QML changes: ran make lint-qml with no new warnings
  • I have opened a corresponding pull request in dlx-docs to document any new behaviors: docs: add notifications invokeLast ipc command dux-docs#161

@purian23

purian23 commented Oct 9, 2026

Copy link
Copy Markdown
Member

/claude review

@claude

claude Bot commented Oct 9, 2026

Copy link
Copy Markdown
Contributor

Claude review

No issues found.
Checked: invokeLastNotification in NotificationService against the popup default-action path (NotificationActions.defaultAction + dismissNotification), newest-wrapper ordering in notifications, the IPC handler return strings, and the new node test. No timers, processes or retained state added. Model: claude-opus-5-5.

@purian23

purian23 commented Oct 9, 2026 •

Copy link
Copy Markdown
Member

Thanks for the PR! This will be helpful. You could also test with dms notify as it's live!
One request is to remove the test file entirely, then I think we'll be good to go.

@Mario-Mohar

Copy link
Copy Markdown
Contributor Author

Thanks! I removed the test file, so the PR only touches the two QML files now.

@purian23
purian23 merged commit e2a0b37 into duxlabs-dev:master Oct 9, 2026
2 checks passed
@Mario-Mohar
Mario-Mohar deleted the feat/notifications-invoke-last branch October 11, 2026 05:31
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.

Invoke default action of last notification by "dms ipc call notifications invokeLast"

2 participants