Skip to content

Close the undo gaps, index treasure in search, and polish the ledgers - #272

Merged
it-rec merged 2 commits into
masterfrom
claude/fallinger-improvements-mvhxhm
Jul 3, 2026
Merged

Close the undo gaps, index treasure in search, and polish the ledgers#272
it-rec merged 2 commits into
masterfrom
claude/fallinger-improvements-mvhxhm

Conversation

@it-rec

@it-rec it-rec commented Jul 3, 2026

Copy link
Copy Markdown
Owner

A sweep of consistency improvements across the panels, closing gaps where sibling panels already had the feature.

Undo for every destructive shared-state action

Deletes broadcast instantly to the whole table, so an accidental tap used to be unrecoverable. All of these now raise the same Undo toast the other ledgers got in #262:

  • Journal — removing an entry (the one text ledger that was missed).
  • Heroes — removing a hero destroys a whole character sheet (skills, traits, conditions, inventory, notes); it was the most destructive delete in the app with no recourse.
  • Initiative — removing a combatant, and End encounter, which wipes every combatant's HP and conditions in one tap.
  • Treasure — the "−" button silently deleted an item (notes, holder and all) when its quantity hit zero; it now routes through the undo path.

Global search covers Treasure

The Ctrl+K finder indexed quests, people, places, keywords and journal — but not items, so @Sword of… mentions of items silently found nothing. Items are now indexed by name, notes and holder, with their own Item badge.

Keywords get inline editing

The only text ledger where fixing a typo meant delete + re-add (losing the id). Same pencil/Enter/Escape flow as every other panel.

Journal search

The longest-growing list in the app had no filter. It gets the same quick search the keywords list has (shown once more than three entries exist), matching entry text and author.

Realtime sync fix in useGameChannel

A peer's broadcast arriving while a local edit sat in the 400 ms debounce window (or in an unresolved POST) replaced the local view — and the stale local payload then landed on the server anyway. Result: this screen showed the peer's data while the server and every other player ended up with ours, a permanent desync until reload. Peer snapshots are now skipped while a local edit is pending, keeping last-write-wins consistent: the local edit stays visible here and reaches everyone else through the server broadcast once the POST settles.

Smaller fixes

  • Underscore emphasis in the Markdown formatter is word-boundary only, so identifiers like cellar_door_key no longer sprout spurious italics.
  • The eleven per-panel copies of the uid() helper collapse into one shared makeUid() utility.

Testing

  • 14 new tests (undo restore in Journal/Heroes/Treasure/Initiative, keyword inline edit incl. Escape cancel, journal search, Markdown word boundaries, treasure search indexing, and a new useGameChannel spec covering the pending-edit race).
  • Full suite: 326 tests green, ESLint clean, production build passes.

🤖 Generated with Claude Code

https://claude.ai/code/session_01BJmJivTGUXgxU8S5RcYAxz


Generated by Claude Code

claude added 2 commits July 2, 2026 21:38
A sweep of small consistency improvements across the panels:

- Every destructive shared-state action now offers an Undo toast:
  removing a journal entry, removing a hero (a whole character sheet),
  removing a combatant, and ending an encounter (which wipes all HP and
  conditions) can all be reverted with one tap. The Treasure "−" button
  no longer silently deletes an item at quantity zero — it goes through
  the same undo path, preserving notes and holder.
- The global finder (Ctrl+K) now indexes Treasure items too, searching
  name, notes and holder, so @mentions of items resolve as well.
- Keywords gain the same inline editing every other text ledger already
  has — fixing a typo no longer means delete and re-add.
- Underscore emphasis in the Markdown formatter is word-boundary only,
  so identifiers like cellar_door_key no longer sprout spurious italics.
- The eleven per-panel copies of the uid() helper collapse into one
  shared makeUid() utility.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BJmJivTGUXgxU8S5RcYAxz
Two follow-ups to the ledger polish:

- The Session Journal — the longest-growing list in the app — gains the
  same quick text filter the keywords list has, matching entry text and
  author, shown once more than three entries exist.
- useGameChannel no longer applies a peer's broadcast while a local edit
  is still in the debounce window or in a POST that has not resolved.
  Before, the remote snapshot replaced the local view and the stale
  local payload then landed on the server anyway, leaving this screen
  showing the peer's data while every other player saw ours — a
  permanent desync until reload. Skipping the snapshot keeps
  last-write-wins consistent: the local edit stays visible here and
  reaches everyone else through the server broadcast once the POST
  settles.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BJmJivTGUXgxU8S5RcYAxz
@it-rec
it-rec merged commit dba24cd into master Jul 3, 2026
4 checks passed
@it-rec
it-rec deleted the claude/fallinger-improvements-mvhxhm branch July 3, 2026 06:48
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