Skip to content

[claude] Give every activity change one identity header - #2885

Closed
myieye wants to merge 3 commits into
claude/activity-5-focused-difffrom
claude/activity-6-change-header
Closed

myieye wants to merge 3 commits into
claude/activity-5-focused-difffrom
claude/activity-6-change-header

Conversation

@myieye

@myieye myieye commented Oct 31, 2026

Copy link
Copy Markdown
Collaborator

[Claude, autonomous]

Stacked on #2883.

In #2883 an entry change showed the current headword in a button and the historical before→after anchor right below it, so the headword appeared twice with no stated relationship. Object changes had no anchor at all. Now every change gets one header: [parent crumb, current, muted] › [historical identity as a before→after inline diff] [badge]. The identity text is the link to the entry.

Desktop Phone (390px)

(Storybook activity/change preview, demo data.)

As built

Change Crumb Identity Badge Body
Entry edit none headword anchor, links to the entry Now: X (Headwords + HomographNumber) when the current headword or homograph number differs from the anchor's after-side; Now: Deleted when the entry was deleted since as #2883
Entry create / delete none headword Added / Deleted (no link on delete) everything, no toggle (already the primitives' behavior)
Sense info.owningEntryHeadword gloss (or definition) anchor, links to the entry Added / Deleted as #2883
Example entry › gloss, from info.subject, sense number stripped sentence anchor, links to the entry Added / Deleted as #2883
Reorder (SetOrderChange:*, from the change's $type) the kind's parent crumb moved item Moved as #2883, without "No visible changes"
ComplexFormComponent complex form's current headword, linked component's current headword (snapshot headword if missing), linked Added / Removed / Moved none
Objects (POS, WS, SD, publication, CFT, morph type, custom view) none name; WS: name + muted wsId; SD: code name Added / Deleted / Moved DiffFieldRows mode="changes" with DiffCollapsed, filtered by valueChanged
Unknown / opaque no header as today
  • ActivityItem now passes the change and its IActivityChangeInfo into the preview. If info.subject is null there's no crumb; "Not found" is gone.
  • Crumb parts are split on owningEntryHeadword, so a homograph subscript stays and only the trailing sense number (and the backend's gloss-less ◌) is dropped.
  • The kebab menu only appears when multiWindowService exists ("Open in new Window"). "Go to entry" is the link itself now.
  • The anchor moved out of the primitives: DiffEntryPrimitive/DiffSensePrimitive/DiffExamplePrimitive take anchor={false} and noVisibleChangesNote={false}. Both default to on, so standalone use and the existing stories are unchanged. The anchor text lives in anchor-text.ts, shared by the primitives and the header. "No visible changes" moved to DiffNoVisibleChanges.svelte.
  • Accessibility: the header is role="group" with aria-label={changeName}, links are labelled Go to entry: {headword} / Go to word: {headword}, and every header target is at least 24×24 (checked in the browser).
  • Phones: the crumb truncates with an ellipsis. The header uses contain: inline-size, so a long unbreakable crumb can't widen its container.

Deviations from the design

  • Unknown/opaque changes get no header. The design's identity was context.changeName, but ActivityItem already prints that name directly above the tabs, so it would show twice.
  • Sense and example create/delete get Added / Deleted badges (the table had none), to be consistent with entries and objects.
  • Now: Deleted is shown when an edited entry was deleted later. The old button showed "(Deleted)". A bare Deleted badge on an edit would read as "this change deleted it".
  • CFC identity uses current headwords (Headwords from affectedEntries), falling back to the snapshot's componentHeadword. The link changes don't rename either entry, so a historical anchor would add nothing.
  • The "Current version" toggle stays as its own row under the header. The design didn't mention it.
  • Added / Moved / Removed reuse DiffMarker's existing msgids. I extended their translator comments to cover the badge use. New msgids: Now: #, Go to entry: {0}, Go to word: {0}, More options, all with comments. Dropped: Complex form:, Component:, Not found.

Test plan

  • svelte-check: 0 errors, 0 warnings
  • eslint: clean. The one warning, in vitest.config.ts, was already there.
  • vitest --project unit: 281 passed. New tests: change-header.test.ts (kind, reorder detection, badge, sense-number stripping, crumb splitting) and anchor-text.test.ts.
  • i18n:extract, with translator comments added
  • New Storybook story activity/change preview covers all 20 cases. I checked it with Playwright and system Chrome at 1100px and 390px, light and dark: no horizontal scroll, no header target under 24px. editor/diff/entities "Changes only" adds the object changes-only rows.
  • Not run: the storybook vitest project and the viewer Playwright UI suite (no Playwright browsers here). Also, Storybook can't resolve its addons with the repo's global pnpm virtual store, so I checked it from a project-local install (PNPM_CONFIG_VIRTUAL_STORE_TYPE=project).

Open questions

  1. Reorder detection reads change.change.$type, which the generated IChange type doesn't declare. Is it acceptable to rely on that serialized discriminator, or should the backend expose it, e.g. on IActivityChangeInfo?
  2. Should sense and example changes also show Now: X when the gloss or sentence moved on since? Today only entries do, as specified.
  3. Should the crumb's entry headword (sense/example) also be a link? Right now only the CFC crumb is.
  4. When a reorder has no visible change, the whole entity still shows. Should a reorder show nothing below the header?

Generated by Claude Code

The change preview showed the current headword in a button and the
historical before/after anchor right below it, with nothing saying how
the two relate. Object changes had no anchor at all.

Each change now gets one header: the parent's current name as a muted
crumb, the historical identity as a before/after inline diff that links
to the entry, and a badge for what the change did (Added, Deleted,
Removed, Moved, or "Now: X" when an entry's headword moved on since).
The anchor moves out of the Entry/Sense/Example primitives into the
header; the primitives keep it by default for standalone use. Object
diffs get the primitives' changes-only mode.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AM78WBzrZB97vduoZFtHSr
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AM78WBzrZB97vduoZFtHSr
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AM78WBzrZB97vduoZFtHSr
@coderabbitai

coderabbitai Bot commented Oct 31, 2026

Copy link
Copy Markdown
Contributor

Important

Draft PR not reviewed

Draft PRs are not automatically reviewed by default.

  • Trigger a manual review

To automatically review draft PRs, update your CodeRabbit configuration:

reviews:
  auto_review:
    drafts: true
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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

@github-actions github-actions Bot added the 💻 FW Lite issues related to the fw lite application, not miniLcm or crdt related label Oct 31, 2026
@myieye
myieye added this pull request to stack #2887 October 31, 2026 10:27
@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 Oct 31, 2026 — with Claude
@myieye myieye removed the self-reviewed 👁️ I reviewed this myself and with AI and decided it was safe to merge without a second set of eyes label Oct 31, 2026

myieye commented Oct 31, 2026

Copy link
Copy Markdown
Collaborator Author

[Claude, autonomous]

Combined into #2889 with #2883 and #2886.


Generated by Claude Code

@myieye myieye closed this Oct 31, 2026
myieye added a commit that referenced this pull request Nov 1, 2026
Activity diffs now narrow to what a change touched, each change gets one header, and a second tab compares the result of the change with the entity's current state.

- Load ChangeContext.CurrentSnapshot with GetLatest, so a deleted entity comes back with DeletedAt set instead of being guessed from the affected entry.
- Second tab reads Later changes, Deleted later (red label, Deleted badge, diffed against the last state before deletion) or No later changes (aria-disabled but still focusable).
- Collapsed diffs also hide unchanged writing systems; "Show unchanged fields" shows the whole form.
- Created or deleted entities show plain values with a green Added or red Deleted badge and an edge rule, not all-green or all-red text.
- A muted "Now called: <headword>" line shows when a later change renamed the entry.
- Fix the stray pink bar on homograph number changes and the n→m spacing.
- Compare picture captions as plain text.

Replaces #2883 and #2885. Homograph numbers on complex form links moved to #2890.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AM78WGasYNwZjGRQswP6JQ
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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants