Skip to content

Add data set favorites: f to toggle, favorites popup with notes, wildcard favorites#24

Merged
Tannex merged 2 commits into
issue-15-dsn-copybook-mappingsfrom
issue-16-dataset-favorites
Jul 19, 2026
Merged

Add data set favorites: f to toggle, favorites popup with notes, wildcard favorites#24
Tannex merged 2 commits into
issue-15-dsn-copybook-mappingsfrom
issue-16-dataset-favorites

Conversation

@Tannex

@Tannex Tannex commented Jul 19, 2026

Copy link
Copy Markdown
Owner

Implements #16. Stacked on PR #23 (issue-15-dsn-copybook-mappings) — merge that first; this PR reuses its internal/dsnmap wildcard matcher and state-file conventions.

What's here

  • internal/favorites: JSON state store at <config>/cq/favorites.json (pattern, optional note, created/lastUsed). Same graceful degradation as dsnmap: missing file = empty store, corrupt file = read-only (never overwritten), unknown JSON fields tolerated. Wildcards use the shared cq dialect via dsnmap.MatchPattern (* any run, % exactly one char) — no new dialect.
  • f on the data set list toggles the selected data set as an exact favorite. A dedicated 1-char star column () marks rows that are favorited exactly or covered by a wildcard favorite; f on a wildcard-covered row favorites the exact DSN and never mutates the wildcard entry (status notes when a removed exact entry is still wildcard-covered).
  • F opens the favorites popup, composited over the live view with the same lipgloss Canvas/Layer mechanism and tiny-terminal full-area fallback as the help popup. Entries list in most-recently-used order with notes; enter jumps (the favorite pattern becomes the data set prefix filter and fetches — exact favorites list/select that one data set), n edits the note inline (single-line input; enter saves, esc cancels), x removes, esc/F closes.
  • Bindings surfaced in short help and the help popup; mouse wheel moves the popup selection; cmd/cqt wires favorites.DefaultStore (demo mode included, matching how Persist DSN → copybook mappings (JSON state, wildcard DSN patterns, dialog integration) #15 wires the mapping store).

Decisions on the issue's open questions

  • Popup binding: F, data set screen only (favorites act on the data set list, so that is where the popup lives).
  • Ordering: most-recently-used (jump Touches the entry), lexicographic tie-break.
  • Note editing: inline single-line input in the popup, not a separate dialog.
  • Scope: global store (matches the Persist DSN → copybook mappings (JSON state, wildcard DSN patterns, dialog integration) #15 decision for dsn-copybooks.json); per-profile scoping can be layered on later if profile collisions bite in practice.

Tests

  • internal/favorites: toggle add/remove, wildcard match without mutation, persistence round-trip incl. unknown fields, MRU ordering, corrupt-file read-only degradation, missing file, note validation.
  • internal/cqt: toggle + star marker, wildcard marking with exact-DSN toggle, popup jump (prefix + fetch + touch), navigation/remove/clamping, note editing (keys route to the input while editing), nil-store degradation, empty-popup state.
  • go build ./... && go vet ./... && go test ./... all pass; existing suite untouched.

Closes #16

🤖 Generated with Claude Code

@Tannex

Tannex commented Jul 19, 2026

Copy link
Copy Markdown
Owner Author

Follow-up: the shared pattern dialect now also accepts /regex/ patterns (see PR #23's second commit). A commit on this branch keeps regex favorites intact — normalization preserves case so classes like \d survive, regex entries count as pattern favorites for row marking, and invalid regexes are skipped with a diagnostic on load. Note: jumping to a regex favorite applies it as the dataset prefix filter, which the z/OSMF list API cannot interpret — regex favorites are mainly useful for row marking and notes.

@Tannex Tannex linked an issue Jul 19, 2026 that may be closed by this pull request
5 tasks
Tannex and others added 2 commits July 19, 2026 13:27
f on the data set list toggles the selected data set as an exact
favorite; rows covered by an exact or wildcard favorite show a star
column. F opens a composited favorites popup (most-recently-used order)
with jump-to (favorite becomes the prefix filter), inline note editing,
and removal. Favorites persist in cq/favorites.json through a new
internal/favorites store that mirrors the dsnmap state-file behavior and
reuses its shared wildcard dialect (* any run, % one char): missing file
is empty, corrupt file degrades read-only, unknown fields survive.

Closes #16

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Favorites reuse the dsnmap pattern dialect, so /…/ regex favorites are
now normalized case-preservingly (upper-casing corrupted classes like
\d), treated as pattern entries for row marking, and skipped with a
diagnostic when they fail to compile.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@Tannex
Tannex force-pushed the issue-16-dataset-favorites branch from 1e5213f to 8c8cba3 Compare July 19, 2026 11:28
@Tannex
Tannex merged commit 1927144 into issue-15-dsn-copybook-mappings Jul 19, 2026
1 check passed
@Tannex
Tannex deleted the issue-16-dataset-favorites branch July 19, 2026 12:18
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.

Dataset favorites: f to toggle, favorites popup with notes, wildcard favorites

1 participant