Commit Graph
34 Commits
Author SHA1 Message Date
LegGasai 99e03fb7b2 Merge remote-tracking branch 'origin/master' into feat/session-panel-sections
The base branch (#7965) is merged, so this branch now targets master.
Conflicts came from #8452 in the forge changes view:

- ChangedFiles.tsx: this branch's Row component (hover marquee, rename
  tooltip) takes master's viewed state: the subdued class, its
  description for assistive technology, and `done` down the tree.
- ReviewControls.tsx: master keeps every segment's Tooltip mounted; this
  branch's 500ms hover delay stays on it.
- ChangesTab.module.css: master's gap-step rules stay; the local changes
  card's rules stay removed, as the card moved into the Session panel.
- The forge README is merged sentence by sentence and its pairing
  record re-recorded.
2026-11-15 15:26:50 +08:00
LegGasai 2b6d6de9d1 fix(forge): key corrected highlighting by the file's change
Corrected tokens were kept under a run's side and line numbers only and
survived a new comparison of the same file. Tokens carry their lines'
text, so a refresh that kept the line numbers but changed the content
drew the last change's text, and a change request's file kept it until
a gap was expanded again. Every key now names the file's change digest,
so another change finds none of the old tokens from the render that
names it.
2026-11-15 13:21:47 +08:00
LegGasai de594f702d fix(forge): highlight rows after collapsed lines with the lines before them
Rows drawn after collapsed unchanged lines were highlighted as if the
file started there, so a code block, comment, or string that opened in
the collapsed lines colored them wrongly. Once a file's whole new side
is known, each run of rows is now highlighted again in idle time after
up to 120 lines of the file before it, the old side rebuilt from the
new side and the hunks. The first draw still highlights in the same
render, and the new colors wait while the reader selects text in the
file. Local files are read for this once per comparison when they
draw; change request files only once an expansion has read them.
2026-11-13 17:50:18 +08:00
LegGasai 7ef8bed5f5 fix(forge): expand long unchanged-line gaps 20 lines at a time
A gap over 20 lines now offers a step down from the hunk above it and a
step up from the hunk below it, as GitHub's diff does, instead of drawing
every hidden line on one click. Gaps of at most 20 lines still expand at
once, and the first click on the unknown lines after the last hunk reads
the file and shows their first 20.
2026-11-13 17:50:18 +08:00
LegGasai 7bd01e1e29 Merge remote-tracking branch 'origin/master' into feat/session-panel-sections
# Conflicts:
#	apps/web/tests/jobs-panel-layering.e2e.ts
#	apps/web/tests/sidebar-subagent-activity.e2e.ts
#	apps/web/tests/subagent-conversation.e2e.ts
#	apps/web/tests/support.ts
#	docs/config-catalog.md
#	docs/config-catalog.zh.md
#	docs/event-producer-consumer.md
#	docs/event-producer-consumer.zh.md
#	docs/module-graph.md
#	docs/module-graph.zh.md
#	docs/subsystems/forge.i18n.yaml
#	packages/client/README.i18n.yaml
#	packages/client/ui-jobs/package.json
#	packages/client/ui-subagent/package.json
#	packages/client/ui-subagent/src/client/index.ts
#	packages/client/ui-subagent/tests/conversation-ui.client.spec.tsx
#	packages/client/ui-subagent/tsconfig.json
#	packages/experimental/client-ui-forge/README.i18n.yaml
#	packages/experimental/client-ui-forge/README.md
#	packages/experimental/client-ui-forge/README.zh.md
#	packages/experimental/client-ui-forge/package.json
#	packages/experimental/client-ui-forge/src/client/ChangeRequestCard.tsx
#	packages/experimental/client-ui-forge/src/client/ChangesTab.tsx
#	packages/experimental/client-ui-forge/src/client/ForgeTab.tsx
#	packages/experimental/client-ui-forge/src/client/mount.ts
#	packages/experimental/client-ui-forge/tests/forge-tab.client.spec.tsx
#	packages/experimental/client-ui-forge/tests/mount.client.spec.ts
#	packages/extensions/cordis-client-runner/src/client/slot-catalog.ts
#	packages/preset/agent-preset/skills/dsh-doc/references/packages.md
#	pnpm-lock.yaml
2026-11-11 16:34:53 +08:00
Yichen Jiang 8c8122ffb0 fix(forge-panel): settle lens runs with their plugins and keep review state through lenses
A lens registration's disposer now waits for the classification itself,
and a run whose registration ended or whose caller left before it started
never reaches the lens; changesLens refuses a lens withdrawn while the
files were read and a local result whose files changed during the run.
The extension state names each lens's version, so the view keys results
by source, files, lens, and version. Hunks holding an open comment form
or a saved browser comment stay unfolded, the view reads threads and
viewed marks again on reviewRevision, a thread jump clears a lens that
hides its file, and the Client entry re-exports the lens types.
2026-11-11 11:34:03 +08:00
Yichen Jiang b60e5985ab feat(forge-panel): open the changes view to Client plugins with lenses, annotations, and slots
Provide ctx.forgeChanges, which mints and reads changes addresses, opens a
view in the shown Session, takes the titles of Host lenses, and registers
line annotation sources. The changes toolbar gains a lens menu that keeps
the files a chosen Host lens keeps, folds the hunks it is not about, and
folds into the More menu at level 2 while no lens is chosen; failed,
refused, and interrupted runs show a notice with a retry and a clear.

Five slots open the view to plugins: forge.changes.toolbar,
forge.changes.file.menu, forge.diff.line.annotation (keyed by source),
forge.diff.comment.actions, and forge.change-request.card.actions.
Annotations stack after the comment form, the browser drafts, and the host
threads of their last line, in the column of their side; none draw before
a section comes within reach, and maxAnnotationsPerFile bounds a file.
2026-11-10 14:33:33 +08:00
LegGasai beba76079e Merge remote-tracking branch 'origin/master' into feat/session-panel-sections
# Conflicts:
#	apps/web/tests/expected/forge-panel/local-and-pr.expected.md
#	apps/web/tests/expected/forge-panel/panel.expected.md
#	apps/web/tests/forge-panel.e2e.ts
#	docs/subsystems/forge.i18n.yaml
#	packages/experimental/client-ui-forge/README.i18n.yaml
#	packages/experimental/client-ui-forge/README.md
#	packages/experimental/client-ui-forge/README.zh.md
#	packages/experimental/client-ui-forge/src/client/ChangeRequestCard.tsx
#	packages/experimental/client-ui-forge/src/client/DiffFile.tsx
#	packages/experimental/client-ui-forge/src/client/Forge.module.css
#	packages/experimental/client-ui-forge/src/client/ForgeTab.tsx
#	packages/experimental/client-ui-forge/src/client/mount.ts
#	packages/experimental/client-ui-forge/tests/change-request-card.client.spec.tsx
#	packages/experimental/client-ui-forge/tests/forge-tab.client.spec.tsx
2026-11-10 12:14:35 +08:00
LegGasai 8e86a8c85c fix(forge): show changes view tooltips after 500ms and crawl clipped tree names
Icon and info tooltips in the changes view wait 500ms of hover and still show
at once on keyboard focus. The file tree names only a renamed file's paths,
since the tree already shows each directory, and a clipped name crawls into
view on hover. The thread count, review time, and viewed shortcut hint move
from native titles to the shared tooltip.
2026-11-10 11:12:39 +08:00
Yichen Jiang 758d31869a Merge remote-tracking branch 'origin/master' into feat/forge-overview
# Conflicts:
#	apps/web/tests/forge-panel.e2e.ts
#	packages/experimental/client-ui-forge/README.i18n.yaml
2026-11-09 18:03:54 +08:00
Yichen Jiang f5fd6ed8f9 feat(forge-panel): sync viewed files with GitHub and act from the card's overview rows
A change request's view of all its commits reads and saves viewed marks
on the code host, disabling a checkbox while its mark is saved and every
checkbox when the marks cannot be read; local changes and chosen commits
keep their marks in the browser. The expanded card shows one row per
fact with a glyph and its value: checks open a grouped menu that reruns
failed ones, the review row shows reviewer avatars and requests reviews,
the merge row updates a head behind its base at the displayed head, the
changes row counts unresolved threads, and linked issues take one row.
2026-11-09 17:13:04 +08:00
Yichen Jiang 4d01598a26 Merge remote-tracking branch 'origin/master' into fix/forge-narrow-toolbar-comments
# Conflicts:
#	packages/experimental/client-ui-forge/README.i18n.yaml
#	packages/experimental/client-ui-forge/README.md
#	packages/experimental/client-ui-forge/README.zh.md
#	packages/experimental/client-ui-forge/src/client/ChangesTab.tsx
#	packages/experimental/client-ui-forge/src/client/DiffFile.tsx
#	packages/experimental/client-ui-forge/src/client/ReviewThread.tsx
2026-11-09 15:48:26 +08:00
Yichen Jiang eba697f3d4 fix(forge): fold the changes toolbar and keep comments in their own column
A narrow changes toolbar wrapped its controls onto a second row and the
header's buttons broke their labels across two lines. Side by side, a
right-side comment was placed with clamp(10px, 100% - 700px, 50% + 10px),
so below about 1,420 px it crossed into the left column, and only one
comment editor could be open at a time.

The toolbar now keeps one line. observeToolbarFold measures what each
fold level needs and sets data-fold to the shallowest level that fits:
level 1 moves the line totals, expanding all files, two columns, and
wrapping into a More view options menu, level 2 the test file switch,
with the viewed progress shown as a ring and a count, and level 3
refresh; at level 3 the file list entry shortens its label. The menu
lists the controls of the level shown when it opens. Measuring instead of
fixed widths keeps every locale on one line: the full toolbar needs about
650 px in Chinese and nearly 800 px in Russian. Header buttons keep their
labels on one line.

Side by side, the comments that end on a row now sit in a row of two
cells under its columns, each continuing its line's gutter and
background, so a left and a right comment share the row. Any number of
editors can stay open; choosing an open editor's range focuses it.

Resolves #8176
2026-11-09 15:27:21 +08:00
Yichen Jiang dacbc37209 Merge remote-tracking branch 'origin/master' into feat/forge-review-threads
# Conflicts:
#	docs/config-catalog.md
#	docs/config-catalog.zh.md
#	packages/experimental/client-ui-forge/README.i18n.yaml
#	packages/experimental/client-ui-forge/README.md
#	packages/experimental/client-ui-forge/README.zh.md
#	packages/experimental/client-ui-forge/src/client/ChangesTab.tsx
#	packages/experimental/client-ui-forge/src/client/DiffFile.tsx
#	packages/experimental/forge-github/README.i18n.yaml
#	packages/experimental/forge-github/README.md
#	packages/experimental/forge-github/README.zh.md
#	packages/experimental/forge/README.i18n.yaml
#	packages/experimental/forge/src/index.ts
#	packages/extensions/tool-cordis/src/api-catalog.ts
2026-11-09 14:28:39 +08:00
Yichen Jiang cfee330356 fix(forge-panel): highlight lines in the render that draws them
Deferred idle-time highlighting drew token text, so a file whose content
changed at the same path kept showing its previous text until the next
pass, and replacing the plain text collapsed a selection made meanwhile.
Sections highlight in their drawing render again, as before.

File sections now take the tab's visibility as a prop and the reach
tracker through their handlers, so no business component reads a React
context.
2026-11-09 11:47:05 +08:00
Yichen Jiang e7e5ed638d Merge remote-tracking branch 'origin/master' into feat/forge-review-threads
# Conflicts:
#	apps/web/tests/forge-panel.e2e.ts
#	packages/experimental/client-ui-forge/README.i18n.yaml
#	packages/experimental/client-ui-forge/src/client/DiffFile.tsx
#	scripts/type-equiv.manifest.json
2026-11-09 11:38:53 +08:00
Yichen Jiang 4a6e0e3c52 feat(forge-panel): step through a file's unresolved threads from its header count
The unresolved count on a file header opened the whole thread list scrolled to that file, which covered the code in
a narrow view and did not tell the file's threads apart. Each click now goes to the file's next unresolved thread in
the order its section shows them: threads on the whole file, threads on lines by the row of their last line,
outdated threads, then threads the chosen commits do not hold; after the last it starts again from the first. The
thread list orders each file's threads the same way, and the Threads toolbar button alone opens it.
2026-11-07 17:46:31 +08:00
Yichen Jiang b07f93af18 feat(forge-panel): filter review threads by resolution and fit the thread list to narrow views
The thread list chooses Unresolved, Resolved, or All in the segmented radio group the lens uses, and drops the
Outdated and Awaiting my reply filters with the Awaiting my reply tag. Its footer keeps only View on GitHub, after a
note when the read was truncated, and each file group names the file before its directory.

The list's width rules queried the changes view's container by name, which CSS Modules rename per file, so they never
applied and a narrow view squeezed the files beside a 320px list. The rules now query the nearest container: a view
at least 1040px wide docks the list; a narrower one floats it over the files with a scrim, moves the focus into it,
and closes it before opening a thread; below 480px it takes the files' whole width with Back to changes. Escape, the
scrim, and the close actions return the focus to the Threads button. Below 480px a file header shows the unresolved
count alone and thread cards keep 6px margins.
2026-11-07 16:46:56 +08:00
Yichen Jiang 6f088b13e7 perf(forge-panel): highlight only after scrolling settles
Highlighting waits until the page is idle and the scrollport has been still
for 200 ms, so a slow grammar's first tokenization never interrupts a scroll.
Adds the Agent Note recording the changes view decisions.
2026-11-07 16:42:40 +08:00
Yichen Jiang d4a2df736b Merge remote-tracking branch 'origin/master' into perf/forge-changes-view 2026-11-07 16:22:57 +08:00
Yichen Jiang 1754e2ea98 perf(forge-panel): draw only what changes and what the reader reaches
- Read a change request's patch and .gitattributes together.
- Publish a panel state only when it differs from the published one.
- File sections receive stable values and redraw only when theirs change;
  tab visibility reaches only the menus that need it.
- An expanded file draws its lines once its section comes within reach of
  the scrollport, and highlights them in idle time in bounded fragments,
  again only when its segments or its language's grammar change.
- A jumped-to file stays aligned while the sections around it draw.
2026-11-07 16:22:26 +08:00
Yichen Jiang 63e00f87ec fix(forge): keep narrow file header actions inside the card
The card's overflow clip cut off the viewed mark and the file menu when a
narrow header also held a long path, the changed tag, and a rename badge;
before the cards, the list could still scroll sideways to them.

The icon, path, changed tag, and badge now share one box that shrinks to
any width, so the counts, the viewed mark, and the menu after it stay
whole. The path and badge shorten in proportion to their widths, the
changed tag is capped at 30% of the box with an ellipsis, and the path
keeps its full-path tooltip.

A 390px e2e renames a long file, changes it after it is marked viewed,
and checks that the mark and menu stay inside the card, the mark still
toggles, and hovering the name shows both paths.
2026-11-07 15:46:36 +08:00
Yichen Jiang a39bcaec12 feat(forge-panel): overlay GitHub review threads on the changes view
Threads read at the shown head sit under the row of their last line, or
after the collapsed lines that hold it; resolved threads fold into one
row, file threads open their file, and outdated threads gather after the
lines with the end of their recorded hunk and the file at the commit
they were written on. Chosen commits place only new-side threads whose
lines number the last chosen commit.

The file tree and file headers count unresolved threads, and a thread
list filters unresolved, outdated, resolved, and awaiting-my-reply
threads by file and opens each at its place. A thread offers only Add to
input, which quotes the whole thread, and View on GitHub.
2026-11-07 14:28:39 +08:00
Yichen Jiang c313392bf8 feat(forge-panel): review changes by layer, mark files viewed, and view chosen commits
The changes view gains a lens of All, Interface, Implementation, and Tests
that spans the file tree above it, a switch that hides test files from the
tree and the diff, and a viewed checkbox on each file header that collapses
the file. The toolbar counts viewed files and V toggles the file being read.
Marks are kept per Session, source, path, and change digest in browser
storage, so a file that changes again reads as changed since viewed. All
commits beside Submit review, and beside the base branch of the Branch scope,
shows one commit or a Shift run of commits.
2026-11-06 17:51:22 +08:00
Yichen Jiang a012eef69a fix(forge): keep comment pluses reachable in unified rows and refuse stale presses
In unified rows that show both line numbers, the left plus now moves past the right number into the sign column, where the right plus already sits. It paints above that number's padding, the sticky file header stays above it, and a row that shows the labeled plus offers no second hover plus. The labeled plus of a left context line is reachable again, and a deleted line's plus no longer jumps one column.

A drag that starts on a hover plus extends through every row with a line on its starting side, wherever the pointer crosses the row. A press whose range is refused, such as Shift across hunks, keeps the previous selection and no longer opens the editor for it on release.

The README describes the checks mark as the filled head branch end.

Refs #7937
2026-11-05 16:27:33 +08:00
Yichen Jiang 4b07f24d8a feat(forge): open inline comments from a hover plus and restyle the checks mark
Show a comment plus beside the line number of the hovered diff line. Pressing it selects the line, dragging extends the range on that side, and releasing opens the editor, replacing the separate select and plus clicks for mouse users. Touch and keyboard users keep the existing path through the line number. Two-column code reserves an empty lane for the plus, so the number and the code stay reachable.

Draw the Session row's checks outcome inside the change request glyph as a filled head branch end, smaller and without the ring, so it cannot drift from the glyph's outline.

Refs #7937
2026-11-05 15:05:08 +08:00
Yichen Jiang aab3033c37 Merge master into worktree/forge-ui-polish 2026-10-28 13:16:42 +08:00
Yichen Jiang 3ac8daef66 fix(forge): clarify worktree controls and align change panels 2026-10-28 12:34:58 +08:00
Yichen Jiang bd1c30cd81 feat(forge): add file tree and inline review comments 2026-10-28 11:42:45 +08:00
Yichen Jiang 17b9e1536d fix(forge): release inactive diff subscriptions and menus 2026-10-27 10:46:40 +08:00
Yichen Jiang 57716b544f fix(forge): preserve diff review state and copy header paths 2026-10-26 21:44:38 +08:00
Yichen Jiang 2ee6dfb671 feat(forge): name changed files before their directories and drop the header branch label
The changes view cut each changed path from its end, so a long path lost
its file name, and the Session header's branch label crowded the actions
beside the title.

- A changed file in the files menu, a file's header, and the local
  changes card shows its name, then its directory in smaller subdued
  type. The directory shortens first, then the name shortens in the
  middle and keeps its end; hovering shows the complete path, and both
  paths of a renamed file. Assistive technology reads the complete path.
  A rename badge names the old file name, or the old path when only the
  directory changed.
- The checkout row draws a folder for the project directory and a
  branch for a worktree.
- The Session header no longer carries the branch label; the tab's
  checkout row names the branch, the kind of checkout, and its path.
- The README describes the collapsed strip of a large file, and the
  forge bundle README lists the gh commands and branches that bind
  change requests.
2026-10-20 18:15:10 +08:00
Yichen Jiang 891ea9bd33 feat(forge): show a collapsed large file as the strip of unchanged lines
A large file in the changes view started behind a notice and an outlined
button. It now starts as one strip drawn and opened like the collapsed
unchanged lines, which names its changed line count. Binary files and
files too large to show use the same strip without an action.
2026-10-20 14:30:46 +08:00
Yichen Jiang d0fc1f6458 feat(forge): show the changes of a Session and of its change requests
The forge panel opens a changes view in the right sidebar for the
checkout's local changes and for the diff of each change request.

- ForgePanelController reads local diffs in the branch, uncommitted,
  unstaged, and staged scopes through Git in the Session's read-only
  sandbox, change request diffs through the forge provider, and the text
  of a changed file to expand unchanged lines. Change request patches stay
  cached by head commit and base branch within maxCachedDiffBytes. A local
  diff over maxDiffBytes fails as forgePanel/diff-too-large, and a provider
  read over its output limit fails as too-large, which the view explains
  with a link to the code host; a gh timeout fails as unavailable.
- forge adds the diff, fileText, and fileUrl provider methods and the
  too-large failure code, and forge-github implements them with gh.
- The panel shows a local changes card that opens the view and asks the
  Agent for a change request. The view collapses files past a line
  budget, draws lines side by side or in one column with optional
  wrapping, expands unchanged lines on request, and collapses or expands
  every file from its toolbar; file headers use a bare chevron.
- The checkout row copies the worktree or project directory path, the
  refresh glyph turns while a refresh runs, change request cards keep
  their actions while collapsed, and the header entry uses the shared
  compact button.
- client-ui-forge classifies changeRequestKey and FsError as
  peer-required Host imports, which keeps forge and dsh-fs as its peers.
2026-10-20 13:34:27 +08:00