Favorites: add and edit pattern favorites, including regexes#60
Merged
Conversation
Favorites could only be toggled from the selected data set, so a favorite always started as an exact DSN even though the store and matcher already understood wildcard and /regex/ patterns. The popup now has an add input (a) for new patterns and an edit input (e) that renames the selected favorite in place, both validated through dsnmap.ValidatePattern with the error held inline while the input stays open. The store grows Add and Rename; renames preserve note and timestamps, duplicates and invalid regexes are rejected. Closes #56 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01CS2LZMn2YJdebAiry2jzdP
selectedLineIndex ignored the add-pattern input line prepended to the popup content, so long scrolled lists rendered one row off while the input was open. The store's three identical sort closures and two duplicate-existence scans collapse into sortByPattern and has. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01CS2LZMn2YJdebAiry2jzdP
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.
Closes #56. Stacked on #59; retarget as the chain merges.
Store (
internal/favorites): newAdd(pattern)andRename(old, new)— normalized viadsnmap.NormalizePattern(wildcards upper-case, regexes keep their case), validated viadsnmap.ValidatePattern, duplicates rejected, renames preserve note/created/lastUsed.Popup (
internal/compaz/favorites.go): a second text input alongside the note editor —aopens an empty pattern input (placeholder documents the dialect: name,*/%wildcards,/regex/),eopens it prefilled with the selected favorite's pattern,inputActive()feeds the existingFavoritesInputkey-context gate, soa/estill type into the note editor).Regex favorites render with the existing
~pattern marker and behave like other pattern favorites when applied as a filter.Verified with store tests (normalization, duplicate/invalid/empty rejection, rename preservation), popup tests (add regex via keystrokes, inline invalid-regex error, edit prefill + note preservation, note-input typing guard), and a demo-mode capture adding
/^demo.cust/through the real key path.🤖 Generated with Claude Code
https://claude.ai/code/session_01CS2LZMn2YJdebAiry2jzdP