Skip to content

feat(extension): hint that a chapter has no changes on Completed - #89

Merged
RJiazhen merged 4 commits into
mainfrom
RJiazhen/issue85
Oct 19, 2026
Merged

RJiazhen merged 4 commits into
mainfrom
RJiazhen/issue85

Conversation

@RJiazhen

Copy link
Copy Markdown
Owner

Summary

An unchanged chapter still offered an enabled Completed action, and chapter rows without a chevron started left of their neighbours, so the list shifted on every chapter switch.

  • Mark unchanged rows with an -unchanged contextValue token and swap the Completed action for an always-disabled pass icon whose contributed command title explains why the chapter has nothing to apply. A disabled toolbar action only surfaces its title, hence the separate learnByDiff.chapterHasNoChanges command (no-op handler, enablement: "false").
  • Give every chapter row an iconPath, chevron or not: the applied chapter keeps its Not Started (circle-large) / Completed (pass) status icon and every other chapter gets a mortar-board course marker. VS Code drops the twistie column on non-collapsible rows, so this keeps one title edge across row kinds.
  • Keep the detected chapter diffs when setSession runs for the same workspace root. Both snapshots live in the same workspace, so a chapter switch does not change which files differ; clearing the cache made rows briefly rebuild as expandable and then collapse again.
  • New locales for the hint title in package.nls.json, zh-cn, zh-tw, ja; menus.test.ts covers the inline/navigation when clauses.

Closes #85

Test plan

  • pnpm exec vp check
  • pnpm exec vp run -r test (124 tests, 21 files)
  • pnpm exec vp run learn-by-diff#pack
  • F5 in sandbox/: an unchanged chapter shows a disabled pass icon, hovering it reads "No changes in this chapter"
  • Switch chapters: row titles keep one left edge, no short chevron flash
  • Expand a changed chapter: U/M/D file rows still render as before

Made with Cursor

An unchanged chapter still offered an enabled Completed action, so clicking
it applied the same tree. Mark such rows with `-unchanged` and swap that
action for an always-disabled pass icon whose command title explains why.
A disabled toolbar action shows only its title as a tooltip, hence the
separate contributed command.
Both snapshots of every chapter live in the same workspace, so changing the
applied chapter does not change which files differ. Clearing the cache on each
same-root switch made every row briefly rebuild as expandable before the
from/to check landed, so the list shifted twice on a chapter click.

Keep the detected diffs when the workspace root is unchanged; a new course
session still starts from an empty cache.
VS Code drops the twistie column on a row that is not collapsible, so an
unchanged chapter started 22px left of its expandable neighbours and the whole
list shifted whenever the applied chapter changed.

Set iconPath on every chapter row: the applied chapter keeps its Not Started or
Completed status icon, and every other chapter gets a mortar-board course
marker. Rows now share one title edge regardless of chevron state, and no
chapter shows a status it does not have.
The disabled hint is meant to occupy the inline Completed slot so hovering
that slot explains why the action is unavailable. Contributing it to the
navigation group as well duplicated the same no-op entry in the right-click
menu, where it reads as an action the user could pick.

Contribute it only to inline@3 and assert that the manifest has exactly one
listing, so a later menu change cannot reintroduce the duplicate.
@RJiazhen
RJiazhen merged commit 5450121 into main Oct 19, 2026
1 check passed
@RJiazhen
RJiazhen deleted the RJiazhen/issue85 branch October 19, 2026 12:09
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.

Hint that a chapter has no changes on the disabled Completed button

1 participant