[PR #1222] [MERGED] Add local conversation message notifications #4992

Closed
opened 2026-10-22 04:12:18 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Pasta-Devs/Marinara-Engine/pull/1222
Author: @cha1latte
Created: 5/26/2026
Status: ✅ Merged
Merged: 5/26/2026
Merged by: @cha1latte

Base: refactor ← Head: feat/refactor-issue-1217-notifications


📝 Commits (2)

  • 1436676 Add local conversation browser notifications
  • 28328d1 Use Tauri local notifications in app shell

📊 Changes

15 files changed (+367 additions, -13 deletions)

View changed files

📝 package.json (+1 -0)
📝 pnpm-lock.yaml (+10 -0)
📝 src-tauri/Cargo.lock (+68 -1)
📝 src-tauri/Cargo.toml (+1 -0)
📝 src-tauri/capabilities/default.json (+1 -0)
📝 src-tauri/src/lib.rs (+1 -0)
📝 src/features/modes/conversation/components/ConversationView.tsx (+26 -6)
📝 src/features/modes/conversation/hooks/autonomous/use-background-autonomous.ts (+7 -0)
📝 src/features/shell/settings/components/settings/SettingControls.tsx (+72 -6)
➕ src/shared/lib/local-notifications.test.ts (+41 -0)
➕ src/shared/lib/local-notifications.ts (+119 -0)
📝 src/shared/stores/ui.store.ts (+2 -0)
📝 src/shared/stores/ui/model.ts (+3 -0)
📝 src/shared/stores/ui/persistence.ts (+1 -0)
➕ tests/e2e/issue-1217-notifications.spec.ts (+14 -0)

📄 Description

Linked issue

Closes #1217

Why this change

  • Conversation-mode replies can arrive while Marinara is unfocused, especially from background autonomous chats. Users need an optional local notification so they know a character replied without exposing message content.

What changed

  • Added an opt-in Native notifications toggle under Settings > Appearance > Notifications.
  • Added a shared local notification helper that uses Tauri native notifications in the app shell and falls back to browser notifications in web/dev.
  • Wired notifications into active Conversation replies and background autonomous Conversation replies.
  • Registered the Tauri notification plugin and added the required notification:default capability.
  • Added focused unit and Playwright coverage for the notification guard/settings surface.

Refactor impact

Primary owner:

  • app shell / conversation mode / shared UI settings

Impact areas reviewed:

  • Conversation reply rendering
  • Background autonomous conversation polling
  • UI settings persistence
  • Tauri app plugin/capability wiring
  • Browser fallback behavior

Boundary notes:

  • Kept the existing persisted conversationBrowserNotifications key so prior local settings are not reset.
  • Notification body is generic: message content is never included.
  • Browser Notification API remains a fallback only; Tauri app shell uses the official notification plugin.

Pressure points touched:

  • src-tauri/src/lib.rs plugin registration
  • Settings Appearance notification controls
  • Conversation active and background notification entrypoints

Validation

  • pnpm check passes locally
  • pnpm typecheck passes locally
  • pnpm build passes locally
  • pnpm check:architecture passes locally
  • pnpm check:docs passes locally
  • cargo check --manifest-path src-tauri/Cargo.toml --workspace passes locally
  • Rust clippy/tests were run for Rust behavior changes
  • Browser or Tauri app manual verification completed
  • Playwright, screenshot, or recording evidence added for UI changes
  • Remote runtime smoke checked when relevant

Manual verification notes

Codex ran:

  • cargo check --manifest-path src-tauri/Cargo.toml --workspace
  • pnpm test src/shared/lib/local-notifications.test.ts
  • pnpm check
  • pnpm build
  • pnpm exec playwright test tests/e2e/issue-1217-notifications.spec.ts --project=chromium

Manual follow-up:

  • Manually verify the native OS notification permission prompt and delivered notification from a packaged Tauri app build.

Docs and release impact

  • No docs changes needed
  • Updated README.md
  • Updated CONTRIBUTING.md
  • Updated docs/developer/
  • Updated repo skills or AGENTS.md
  • Confirmed this PR does not restore old staging/package-workspace/release claims

UI evidence

  • Playwright verified the Settings > Appearance notification opt-in is visible in the built preview.

Summary by CodeRabbit

  • New Features

    • Added native notification support for conversations when the app is in the background.
    • Added a "Native notifications" toggle in Settings to enable/disable conversation notifications.
    • Notifications display character names and only appear when the app is unfocused.
  • Tests

    • Added test coverage for notification permission and display logic.
    • Added end-to-end test for Settings notification controls.

Review Change Stack


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/Pasta-Devs/Marinara-Engine/pull/1222 **Author:** [@cha1latte](https://github.com/cha1latte) **Created:** 5/26/2026 **Status:** ✅ Merged **Merged:** 5/26/2026 **Merged by:** [@cha1latte](https://github.com/cha1latte) **Base:** `refactor` ← **Head:** `feat/refactor-issue-1217-notifications` --- ### 📝 Commits (2) - [`1436676`](https://github.com/Pasta-Devs/Marinara-Engine/commit/14366769f1c3d24fd4d435afbfadacbca5aae88b) Add local conversation browser notifications - [`28328d1`](https://github.com/Pasta-Devs/Marinara-Engine/commit/28328d13d4edf51a5e99a844cafb78244a809b55) Use Tauri local notifications in app shell ### 📊 Changes **15 files changed** (+367 additions, -13 deletions) <details> <summary>View changed files</summary> 📝 `package.json` (+1 -0) 📝 `pnpm-lock.yaml` (+10 -0) 📝 `src-tauri/Cargo.lock` (+68 -1) 📝 `src-tauri/Cargo.toml` (+1 -0) 📝 `src-tauri/capabilities/default.json` (+1 -0) 📝 `src-tauri/src/lib.rs` (+1 -0) 📝 `src/features/modes/conversation/components/ConversationView.tsx` (+26 -6) 📝 `src/features/modes/conversation/hooks/autonomous/use-background-autonomous.ts` (+7 -0) 📝 `src/features/shell/settings/components/settings/SettingControls.tsx` (+72 -6) ➕ `src/shared/lib/local-notifications.test.ts` (+41 -0) ➕ `src/shared/lib/local-notifications.ts` (+119 -0) 📝 `src/shared/stores/ui.store.ts` (+2 -0) 📝 `src/shared/stores/ui/model.ts` (+3 -0) 📝 `src/shared/stores/ui/persistence.ts` (+1 -0) ➕ `tests/e2e/issue-1217-notifications.spec.ts` (+14 -0) </details> ### 📄 Description ## Linked issue Closes #1217 ## Why this change - Conversation-mode replies can arrive while Marinara is unfocused, especially from background autonomous chats. Users need an optional local notification so they know a character replied without exposing message content. ## What changed - Added an opt-in Native notifications toggle under Settings > Appearance > Notifications. - Added a shared local notification helper that uses Tauri native notifications in the app shell and falls back to browser notifications in web/dev. - Wired notifications into active Conversation replies and background autonomous Conversation replies. - Registered the Tauri notification plugin and added the required `notification:default` capability. - Added focused unit and Playwright coverage for the notification guard/settings surface. ## Refactor impact Primary owner: - app shell / conversation mode / shared UI settings Impact areas reviewed: - Conversation reply rendering - Background autonomous conversation polling - UI settings persistence - Tauri app plugin/capability wiring - Browser fallback behavior Boundary notes: - Kept the existing persisted `conversationBrowserNotifications` key so prior local settings are not reset. - Notification body is generic: message content is never included. - Browser Notification API remains a fallback only; Tauri app shell uses the official notification plugin. Pressure points touched: - `src-tauri/src/lib.rs` plugin registration - Settings Appearance notification controls - Conversation active and background notification entrypoints ## Validation - [ ] `pnpm check` passes locally - [ ] `pnpm typecheck` passes locally - [ ] `pnpm build` passes locally - [ ] `pnpm check:architecture` passes locally - [ ] `pnpm check:docs` passes locally - [ ] `cargo check --manifest-path src-tauri/Cargo.toml --workspace` passes locally - [ ] Rust clippy/tests were run for Rust behavior changes - [ ] Browser or Tauri app manual verification completed - [ ] Playwright, screenshot, or recording evidence added for UI changes - [ ] Remote runtime smoke checked when relevant ### Manual verification notes Codex ran: - `cargo check --manifest-path src-tauri/Cargo.toml --workspace` - `pnpm test src/shared/lib/local-notifications.test.ts` - `pnpm check` - `pnpm build` - `pnpm exec playwright test tests/e2e/issue-1217-notifications.spec.ts --project=chromium` Manual follow-up: - Manually verify the native OS notification permission prompt and delivered notification from a packaged Tauri app build. ## Docs and release impact - [ ] No docs changes needed - [ ] Updated `README.md` - [ ] Updated `CONTRIBUTING.md` - [ ] Updated `docs/developer/` - [ ] Updated repo skills or `AGENTS.md` - [ ] Confirmed this PR does not restore old staging/package-workspace/release claims ## UI evidence - Playwright verified the Settings > Appearance notification opt-in is visible in the built preview. <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **New Features** * Added native notification support for conversations when the app is in the background. * Added a "Native notifications" toggle in Settings to enable/disable conversation notifications. * Notifications display character names and only appear when the app is unfocused. * **Tests** * Added test coverage for notification permission and display logic. * Added end-to-end test for Settings notification controls. <!-- review_stack_entry_start --> [![Review Change Stack](https://storage.googleapis.com/coderabbit_public_assets/review-stack-in-coderabbit-ui.svg)](https://app.coderabbit.ai/change-stack/Pasta-Devs/Marinara-Engine/pull/1222?utm_source=github_walkthrough&utm_medium=github&utm_campaign=change_stack) <!-- review_stack_entry_end --> <!-- end of auto-generated comment: release notes by coderabbit.ai --> --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-22 04:12:18 +07:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Pasta-Devs/Marinara-Engine#4992
No description provided.