Commit Graph
12 Commits
Author SHA1 Message Date
LegGasai 0c8078e196 feat(forge): name worktree branches, start them from remote branches, and show changes being read (#8536)
* feat(forge): name worktree branches, start them from remote branches, and show changes being read

The New Session worktree option's base menu now searches local branches and
each remote's branches, pins the current branch and every remote's default
branch, and names each remote group by its repository. Its last row opens a
dialog that names the new branch, starting from `worktreePrefix` and checking
Git's branch-name rules; the Host refuses an invalid or taken name. A request
records the full ref of its base and the optional name; every attempt uses the
name.

A remote-tracking base is fetched first: the worktree service gains a
`fetch` request field and a `fetch` phase, fetching only that branch without
tags. A failed fetch leaves the message waiting with Retry, Use the last
fetched version, and Continue without a worktree; a taken name offers Rename.

While the changes view reads changes it has not shown yet, it says
"Reading changes" above file card placeholders, and the files menu names no
count.

* fix(worktree): forward only the declared create_worktree arguments

The create_worktree parameter object is open, and the tool passed it to the
worktree runtime unchanged. Now that a runtime request can ask to fetch, an
undeclared `fetch: true` from the model would have fetched, or refused a local
`from`. The tool now forwards only `name` and `from`, so it never fetches.

* docs(forge): say that only generated worktree branch names come from the Session id

* fix(forge): keep the collapsed change request status on one line

In the Session panel the collapsed card's number line kept every part at
full width inside a clipping row, so a narrow panel cut the most urgent
flag off without an ellipsis, such as "有冲突" after "3 项检查失败".

The number and status now form one MarqueeText line as wide as the row.
While the line with failed checks does not fit, they take the shorter
wording without their count; a line that still does not fit ends in an
ellipsis and crawls into view with the title while the pointer rests on
the card's head. The line measures again when its width or the fonts
change. Expanded cards keep their branch names as before.

* fix(forge): hide remote credentials and read the branch a tag shares its name with

The base menu named an unrecognized remote's group by its fetch URL as
`git remote -v` prints it, so a token in the URL, such as
`https://oauth2:[email protected]/...`, reached the browser and showed
in the menu. The group now shows the URL without its user name and password.

Inspection read the checked-out branch with `symbolic-ref --short HEAD`,
which prints `heads/main` while a tag is also named `main`; the New Session
option then requested `refs/heads/heads/main` and every worktree attempt
failed. Inspection now reads the full ref and takes the name under
`refs/heads/`, so the option, the pinned current branch, and the checkout
row name `main`. HEAD that names a ref outside `refs/heads/` reads as no
branch.

* test(worktree): set up nested remotes and line endings the CI runners' Git accepts

Git 2.55 on the CI runners refuses `git remote add team` next to an
existing `team/fork` remote; the check runs only in `git remote add`, so
the longest-remote case now writes the second remote with `git config`, as
configuration written earlier or by hand holds it. The test clone also
turns off `core.autocrlf`, as `repository` does, because the Windows
runner's global setting checked the fetched file out with CRLF.
2026-11-16 16:13:00 +00:00
LegGasai c64862545f Merge branch 'feat/session-panel' into feat/session-panel-sections
The panel's row Factory is gone on the base branch: rows share their look
through `data-session-panel-row` and `data-row-part` marks that the
panel's stylesheet lays out. This merge carries the rows of this branch
over to it:

- The two-line row moves from PanelRow's stylesheet into the panel's row
  rules as the `lines` and `detail` parts.
- The forge checkout, connection, local changes, and sign-in rows write
  their own marked markup instead of calling the Factory; the connection
  row, the local changes row, and the change requests section no longer
  take `renderFactorySlot`.
- The forge e2e measures the local changes and checkout rows in the real
  panel.
2026-11-13 20:22:32 +08:00
LegGasai cb222b0b7c fix(forge): show the change request title on one line and crawl it on hover
The card title wrapped to two lines while expanded; it now stays on one line
in both states and crawls into view while the pointer rests on the card head,
as the other clipped panel rows do. The number line below it is unchanged.
2026-11-11 18:00:28 +08:00
LegGasai f3b41679cd fix(forge): show a lost stream and sign-in as status rows where they apply
A lost panel stream and the sign-in banner showed only inside the change
requests section, which is absent while the Session binds no change request,
so most Sessions saw neither. A connection row now ends the Environment
section whenever the stream has ended, with Retry, since every forge row is
then out of date; the sign-in and failed-check rows head the change requests
section, which shows for them alone. A host's reason, and the checkout row's
Git failure, sit behind an info button that opens after 500ms of hover, on
keyboard focus, or on a press.
2026-11-10 14:30:31 +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 7fce6bfcf2 fix(forge): mark change requests that need attention with a yellow dot
The toggle's mark asks for attention rather than reporting an error, so it
takes the warning color.
2026-11-07 14:46:36 +08:00
LegGasai 85006a2b10 fix(forge): let row and card More buttons follow the panel's row actions
The checkout and local changes rows render plain buttons in PanelRow's menu
column, and the change request card's More loses its tooltip and hover fill.
2026-11-07 12:02:35 +08:00
LegGasai 655db2cf38 feat(panel): show a running dot on the panel toggle while the panel is hidden
Subagents and background jobs each register an indicator that shows a blue dot
with their running count for assistive technology while work runs and the panel
does not show it. The jobs indicator keeps the roster stream open while the
toggle is mounted. The forge attention mark takes the toggle's 6px dot, up from
a 3.6px core, and paints above the running dots.
2026-11-07 11:55:54 +08:00
LegGasai f646ed70e3 Merge branch 'feat/session-panel' into feat/session-panel-sections
# Conflicts:
#	packages/experimental/client-ui-forge/README.i18n.yaml
#	packages/experimental/client-ui-forge/README.md
#	packages/experimental/client-ui-forge/README.zh.md
2026-11-06 12:37:53 +08:00
LegGasai 3e36751821 feat(panel): put the forge row menus in the PanelRow menu slot
The checkout and local changes rows pass their More buttons to PanelRow's
menu slot, so they highlight as whole rows and reveal the button the same
way as the project row; the forge-specific reveal styles go away.
2026-11-06 12:19:34 +08:00
LegGasai a2ff0fa3ed fix(web): keep change request flags whole in the Session panel
In the narrower Session panel the number line of a change request card
shrank its draft and status flags until CJK text broke between
characters; only the branch names now shorten. Ready for review gains an
icon so the card menu items share one text column.
2026-11-05 22:09:45 +08:00
LegGasai 4f3b71a4e9 feat(web): move change requests into the Session panel
The forge panel's right-sidebar tab, its header button, and its start-page
entry are replaced by Session panel entries: a Change requests section
with its count and refresh, checkout and local changes rows plus a refresh
in the Environment section, and an attention mark on the panel toggle.
Change request cards keep their expandable rows and move their actions
into a More menu; Merge stays below the rows.

Environment rows receive the section owner values so a row that opens the
sidebar can close the overlay, and PanelRow gains an action label for its
button.
2026-11-05 21:32:00 +08:00