Skip to content

Activity redesign 1/8: resolve change subjects server-side and generate the change-type list - #2435

Merged
myieye merged 13 commits into
developfrom
claude/activity-1-backend-change-info
Jul 22, 2026
Merged

Activity redesign 1/8: resolve change subjects server-side and generate the change-type list#2435
myieye merged 13 commits into
developfrom
claude/activity-1-backend-change-info

Conversation

@myieye

@myieye myieye commented Jul 12, 2026

Copy link
Copy Markdown
Collaborator

Part 1 of 8 of the activity redesign (readable summaries + before/after diffs, #2170). The full assembled result of parts 1–6 — reviewed end-to-end by CodeRabbit and verified green — lived in #2434 (now closed); it was too large to merge in one piece, so it's split into a stacked sequence where each part is independently green and reviewable. This PR is the only one open; each next part gets its PR when its predecessor merges.

The sequence (each branch builds on the previous; part 6's tree is byte-identical to the reviewed #2434 head):

  1. claude/activity-1-backend-change-info (this PR) — backend enrichment + change-type codegen. No user-visible change.
  2. claude/activity-2-ws-code-chips — writing-system codes render as monospace chips app-wide (editor field labels, dictionary preview) for parity with the upcoming read-only diffs.
  3. claude/activity-3-diff-components — the read-only diff-view component library (field-level before/after, inline text diff via @sanity/diff-match-patch, audio diffs) + storybook gallery + field-coverage guard tests. No consumer yet.
  4. claude/activity-4-list-summaries — the activity list rows become readable summaries ("Apfel › apple · Set Definition (en) to …") grouped by entry, with per-author colours, badges, and bulk-create collapsing; exhaustiveness tests fail if a new change type lacks a summary.
  5. claude/activity-5-detail-previews — the detail panel renders real before/after diffs through the diff components; single-entry create commits collapse to an assembled read-only view; per-card failure containment.
  6. claude/activity-6-list-detail-layout — extracts Browse's responsive list↔detail shell into a shared ListDetailLayout and adopts it in Activity: resizable split panes on desktop, full-width list on mobile with full-screen detail + back-button support.
  7. claude/activity-7-change-type-filter — replaces the flat ~65-row activity-type multi-select with a grouped, searchable, tri-state filter (sections by what a change touches, collapsed by default, hover "Only" shortcuts, empty selection = unfiltered, debounced instant apply).
  8. claude/activity-8-author-filter — unifies the author facet onto the same shell and semantics (shared FacetFilter component, empty = unfiltered, ×-clear, "Only"), deleting the old 'all'-sentinel machinery and the "No authors → empty feed" state.

UI previews for the filter parts (7 and 8) — open in a browser:

This part

Adds ActivityChangeInfoResolver: one batched pass per activity page that labels each change with the entity it's about (entry headword with homograph subscript, "headword › gloss" for senses, vocab object names), any item the change references only by id (the part of speech set, the semantic domain removed, the component linked), and the change's root entry so the frontend can group a commit's changes. Deleted objects are recovered from their latest snapshot (one Take(1) query per missing id) so a delete can still name its subject. ProjectActivity returns a materialized page (Task<ProjectActivity[]>) of enriched record copies (ChangeInfo is init-only) since the resolver batch-loads across the page — every consumer already materialized.

ChangeContext gains PreviousSnapshot (the entity's state just before the commit), the data needed for true before/after diffs (#2170).

A Reinforced.Typings generator emits a ChangeType string-literal union + knownChangeTypes array from the registered CRDT change types, using the same discriminator helper the runtime uses — parts 4 and 7's coverage tests are built on it, so a new change type can't silently ship without a summary or a filter group.

Tests: HistoryServiceActivityTests covers subject/target naming (homograph only-when-assigned, morph-type markers, sense numbering, deleted-object recovery, component endpoints, reorders) — 36 tests, all passing. Frontend impact is limited to regenerated types (additive) and a one-line HistoryView fix for the new required changeInfo property.

🤖 Generated with Claude Code

https://claude.ai/code/session_01Vm9mEUzcfgX4oUPAbhcfsj

@coderabbitai

coderabbitai Bot commented Jul 12, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Important

Review skipped

Auto incremental reviews are disabled on this repository.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 0aed1c44-e2d1-4067-b682-4591e799d558

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • ✅ Review completed - (🔄 Check again to review again)
📝 Walkthrough

Walkthrough

Changes

Project activity now returns materialized pages enriched with resolved subjects and targets. Backend context handling, generated TypeScript contracts, invokable callers, viewer data construction, and extensive naming tests were updated accordingly.

Project Activity Enrichment

Layer / File(s) Summary
Activity contract and batch resolution
backend/FwLite/LcmCrdt/HistoryService.cs
ProjectActivity returns enriched arrays, ChangeContext tracks previous snapshots, and change-type key lookup is public.
Change-info label resolution
backend/FwLite/LcmCrdt/ActivityChangeInfoResolver.cs
Loads current or recovered entities and resolves subjects, targets, headwords, sense labels, reorder metadata, and component endpoints.
Generated frontend contracts
backend/FwLite/FwLiteShared/TypeGen/*, frontend/viewer/src/lib/dotnet-types/generated-types/LcmCrdt/*
Generates activity metadata interfaces and a complete ChangeType union with its known-value array.
Callers and validation
backend/FwLite/FwLiteShared/Services/HistoryServiceJsInvokable.cs, backend/FwLite/LcmCrdt.Tests/*, frontend/viewer/src/lib/history/HistoryView.svelte
Updates callers and tests for materialized results and adds coverage for change-info naming across change scenarios.

Estimated code review effort: 4 (Complex) | ~45 minutes

Possibly related PRs

Suggested reviewers: rmunn, hahn-kev

Poem

I hop through changes, neat and bright,
With labels blooming into sight.
Old snapshots found, new types agree,
A tidy trail for history.
The rabbit stamps: “Enriched—whee!”

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 15.28% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Title check ✅ Passed The title clearly summarizes the main backend change and generated change-type list.
Description check ✅ Passed The description directly matches the PR's backend enrichment and change-type generation work.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch claude/activity-1-backend-change-info

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@argos-ci

argos-ci Bot commented Jul 12, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Argos notifications ↗︎

Build Status Details Updated (UTC)
default (Inspect) ✅ No changes detected - Jul 22, 2026, 1:37 PM
e2e (Inspect) ✅ No changes detected - Jul 22, 2026, 1:46 PM

@myieye

myieye commented Jul 12, 2026

Copy link
Copy Markdown
Collaborator Author

Note for the Argos review: this part is backend-only and intends zero visual change — the deterministic default build agrees (✅ no changes detected). The 5 diffs on the e2e build should therefore be environment noise (the e2e suite screenshots live pages with relative timestamps/seeded data, and it has flagged diffs on every recent build regardless of branch). If any of the 5 shows a real content difference rather than timestamp/data churn, please flag it here — that would mean the enriched activity payload is affecting the current UI, which would be a bug in this part.


Generated by Claude Code

@myieye myieye changed the title Activity redesign 1/6: resolve change subjects server-side and generate the change-type list Activity redesign 1/7: resolve change subjects server-side and generate the change-type list Jul 12, 2026
@myieye myieye changed the title Activity redesign 1/7: resolve change subjects server-side and generate the change-type list Activity redesign 1/8: resolve change subjects server-side and generate the change-type list Jul 12, 2026
@myieye

myieye commented Jul 12, 2026

Copy link
Copy Markdown
Collaborator Author

@coderabbitai review


Generated by Claude Code

@coderabbitai

coderabbitai Bot commented Jul 12, 2026

Copy link
Copy Markdown
Contributor

@myieye: Got it, I'll review the changes now.

✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@hahn-kev hahn-kev 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.

looks good, I glossed over the change info resolver.

Comment thread backend/FwLite/FwLiteShared/Services/HistoryServiceJsInvokable.cs
Comment thread backend/FwLite/FwLiteShared/TypeGen/ChangeTypesCodeGenerator.cs
Comment thread backend/FwLite/LcmCrdt.Tests/HistoryServiceActivityTests.cs Outdated
Comment thread backend/FwLite/LcmCrdt/HistoryService.cs Outdated
Comment thread backend/FwLite/LcmCrdt/ActivityChangeInfoResolver.cs Outdated
…type list

Adds ActivityChangeInfoResolver: one batched pass per activity page that labels each
change with the entity it's about (entry headword with homograph subscript, 'headword › gloss'
for senses, vocab object names), the referenced item it names only by id (part of speech set,
semantic domain removed, component linked), and the root entry so the frontend can group a
commit's changes. Deleted objects are recovered from their latest snapshot so a delete can
still name its subject. ProjectActivity returns a materialized page (Task<ProjectActivity[]>)
of enriched record copies since the resolver batch-loads across it.

ChangeContext gains PreviousSnapshot (the entity's state just before the commit) so the
frontend can render true before/after diffs (#2170).

A Reinforced.Typings generator emits a ChangeType union + knownChangeTypes array from the
registered CRDT change types via the same discriminator helper the runtime uses, giving the
frontend a generated, exhaustive list to guard summary coverage with.

Part 1/6 of the activity redesign (#2434 shows the assembled result).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Vm9mEUzcfgX4oUPAbhcfsj
@myieye
myieye force-pushed the claude/activity-1-backend-change-info branch from b532dcf to cba8373 Compare July 15, 2026 04:30
@myieye
myieye merged commit ccd29d0 into develop Jul 22, 2026
36 checks passed
@myieye
myieye deleted the claude/activity-1-backend-change-info branch July 22, 2026 15:15
@myieye myieye added the self-reviewed 👁️ I reviewed this myself and with AI and decided it was safe to merge without a second set of eyes label Jul 22, 2026
myieye added a commit that referenced this pull request Jul 27, 2026
RecordingMiniLcmApi and WriteIgnoringMiniLcmApi forwarded tasks directly (return _api.X()).
Awaiting keeps the wrapper frame on the stack trace when the inner call throws — worth it
here since these are dry-run-only diagnostic aids, not a hot path. Task<T> forwarders become
`return await`, non-generic Task ones `await`.

Record the team convention in backend/AGENTS.md, citing Kevin's rationale on #2435.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

💻 FW Lite issues related to the fw lite application, not miniLcm or crdt related self-reviewed 👁️ I reviewed this myself and with AI and decided it was safe to merge without a second set of eyes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants