refactor: restore git skill worked examples, type-tighten TableHelper.observe()#1538
Merged
refactor: restore git skill worked examples, type-tighten TableHelper.observe()#1538
Conversation
Two clean cuts: - Duplicate changelog section (lines 439-464): exact copy of the changelog rules already defined at lines 107-134 - "When to Use Diagrams" consolidated list (lines 366-374): each diagram subsection header already states when to use that type, making the summary redundant All worked examples, the interleaving prose/visuals tutorial, and the 9-section PR structure are preserved. 631 → 595 lines.
…t<TRow['id']> Derive observer ID type from the row's id field so branded types (TabCompositeId, WindowCompositeId, etc.) flow through without casts at every consumer site. - types.ts: Set<string> → ReadonlySet<TRow['id']> in observe signature - table-helper.ts: single infrastructure cast bridges CRDT string keys to domain-level branded types - browser-state.svelte.ts: remove 3 now-redundant as-casts - table-helper.test.ts: Set<string>[] → ReadonlySet<string>[] for direct changedIds push
…-actions Tab rows from findDuplicateGroups/groupTabsByDomain already carry TabCompositeId on t.id — the as-casts were identity casts.
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.
Two independent housekeeping items that don't warrant separate PRs given their small scope.
Git skill restoration
The compression in commits 4ca8844–0dadacd removed worked diagram examples, the 9-section PR structure, and contextual guidance from the git skill. In practice, the verbose version produces measurably better PR descriptions because the worked examples use our actual vocabulary (YKeyValue, TableHelper, composition trees with O(n) annotations) to set a quality bar that generic principles can't match.
This restores the full version, then makes two targeted cuts that are genuine redundancies:
Net result: 595 lines, down from the original 631 but with all worked examples intact.
Type-tighten
TableHelper.observe()observe()previously passedSet<string>for changed IDs, forcing consumers with branded ID types to cast at every usage:Changed the callback signature to
ReadonlySet<TRow['id']>. One cast in infrastructure (table-helper.ts) replaces 3+ casts at consumer sites.ReadonlySetis covariant (no.add()), soReadonlySet<TabCompositeId>remains assignable toReadonlySet<string>for any consumer that doesn't use branded types.