Skip to content

feat: customisable voice phrase pools#27

Merged
StuBehan merged 1 commit into
mainfrom
feat/notification-customization
May 1, 2026
Merged

feat: customisable voice phrase pools#27
StuBehan merged 1 commit into
mainfrom
feat/notification-customization

Conversation

@hiskudin

@hiskudin hiskudin commented May 1, 2026

Copy link
Copy Markdown
Collaborator

Summary

Voice notifications can now be curated per user. Open Settings → Edit phrases… to mute individual shipped defaults, add your own, and see a live preview using stack-nudge as the sample repo name.

How it works

  • Two pools per language: response (stop events) and notification (permission events)
  • Shipped defaults stay in phrases/<lang>.sh as today — they're the canon
  • User edits live in ~/.stack-nudge/phrases.user.json:
    json { "en": { "response": { "custom": ["%s shipped at last"], "disabled": ["task complete in %s"] }, "notification": { "custom": [], "disabled": [] } } }
  • notify.sh reads this file at fire time, filters disabled defaults out, and appends customs — final pool per event is defaults \\ disabled ∪ custom. Falls back to raw defaults if jq is missing.

UI

New PanelMode.phrases sub-view replaces the tab strip when open. Reached via a new "Edit phrases…" action row in Settings.

Key Action
↑ ↓ Navigate all rows (defaults + custom), auto-scrolls selection into view
Space Toggle the selected default phrase on/off
Remove the selected custom phrase
Type + Add a new custom phrase to the pool whose input is focused
Esc Back to Settings

Mouse equivalents: click the checkmark to toggle a default, click ✕ to remove a custom, click anywhere else on a row to select.

Test plan

  • Open panel → Settings → "Edit phrases…" → editor appears
  • ↑/↓ moves selection across both pools, auto-scrolls
  • Space on a default → row strikes through, checkmark goes empty
  • Trigger a Stop notification with the disabled default — voice never picks it
  • Add a custom phrase, fire a Stop notification a few times — it eventually gets picked
  • ⌫ on a custom phrase removes it
  • Esc returns to Settings without dismissing the panel

🤖 Generated with Claude Code

Voice notifications can now be curated per user. Open Settings →
"Edit phrases…" to:

  - Toggle individual shipped defaults on/off (Space when selected,
    or click the checkmark)
  - Add custom phrases with a live preview using "stack-nudge" as the
    sample repo name
  - Remove custom phrases (⌫ when selected, or click ✕)

State persists to ~/.stack-nudge/phrases.user.json with shape:

  { "en": { "response":     { "custom": [...], "disabled": [...] },
            "notification": { "custom": [...], "disabled": [...] } } }

notify.sh reads this file at fire time, filters disabled defaults out
of the shipped pool, and appends custom phrases — final list per pool
is `defaults\disabled ∪ custom`. Quiet fall-back to the unmodified
defaults if jq is missing or the JSON is malformed.

UI bits:
- New PanelMode.phrases sub-view, accessed via a "Edit phrases…" row
  in Settings (rowCount=13). Esc returns to Settings.
- ↑/↓ navigates every row (defaults + custom) with auto-scroll into
  view via ScrollViewReader, matching Settings' behaviour.
- TextField input clears row selection on first keystroke so ⌫ can
  edit text without removing rows.
- New Space and S keycodes; existing Space activation in Settings
  still works (handled separately).

Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>

@StuBehan StuBehan left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@StuBehan StuBehan merged commit a475922 into main May 1, 2026
4 checks passed
@StuBehan StuBehan deleted the feat/notification-customization branch May 1, 2026 14:13
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