Files
deepseek-harness/packages/experimental/client-ui-forge/src/client/Forge.module.css
T
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

582 lines
12 KiB
CSS

/* Change request cards in the Session panel section, at the panel's 13px row size. */
.cards {
--forge-fill: var(--dsw-alias-card-fill);
display: flex;
flex-direction: column;
gap: 8px;
min-width: 0;
color: var(--dsw-alias-label-primary);
font-size: var(--dsh-content-font-size-secondary, 13px);
line-height: 20px;
}
.iconButton {
display: inline-flex;
flex: none;
align-items: center;
justify-content: center;
width: 28px;
height: 28px;
padding: 0;
border: 0;
border-radius: var(--dsw-radius-sm);
background: transparent;
color: var(--dsw-alias-label-tertiary);
cursor: pointer;
}
.iconButton:focus-visible {
background: var(--dsw-alias-interactive-bg-hover);
color: var(--dsw-alias-label-primary);
}
@media (hover: hover) {
.iconButton:hover {
background: var(--dsw-alias-interactive-bg-hover);
color: var(--dsw-alias-label-primary);
}
}
/* A More button shares its surface: the glyph darkens without a fill, as on Session panel rows. */
.iconButton.moreButton:focus-visible {
background: transparent;
}
@media (hover: hover) {
.iconButton.moreButton:hover {
background: transparent;
}
}
.list {
display: flex;
flex-direction: column;
gap: 8px;
margin: 0;
padding: 0;
list-style: none;
}
.change {
min-width: 0;
border: 0.5px solid var(--dsw-alias-border-l2);
border-radius: var(--dsw-radius-md);
background: var(--dsw-alias-bg-layer-1);
}
/* Glyph, title link with the number line below it, then the actions menu
and the expansion toggle. */
.changeHead {
display: flex;
align-items: flex-start;
gap: 2px;
min-width: 0;
padding: 12px 8px 10px 14px;
}
.changeHead > .glyph {
margin: 3px 10px 0 0;
}
/* The buttons center on the title's first line. */
.changeHead > .iconButton {
margin-top: -3px;
}
.headText {
display: flex;
flex: 1;
flex-direction: column;
gap: 2px;
min-width: 0;
padding-top: 1px;
}
.changeTitle {
display: block;
min-width: 0;
color: var(--dsw-alias-label-primary);
font-weight: 500;
line-height: 20px;
text-decoration: none;
}
@media (hover: hover) {
.changeTitle:hover {
color: var(--dsw-alias-label-primary);
text-decoration: underline;
text-underline-offset: 2px;
}
}
.changeTitle:focus-visible,
.rowButton:focus-visible {
outline: var(--dsw-focus-ring-width) solid var(--dsw-focus-ring-color, var(--dsw-alias-state-business-primary));
outline-offset: 1px;
}
/* Number line below the title: the status while collapsed, the branches while expanded. */
.meta {
display: flex;
align-items: center;
gap: 6px;
min-width: 0;
overflow: hidden;
padding: 1px 0;
color: var(--dsw-alias-label-tertiary);
font-size: 12px;
font-variant-numeric: tabular-nums;
line-height: 18px;
}
/* Lifecycle glyph; drawn in the current color unless the state tints it. */
.glyph {
display: inline-flex;
flex: none;
}
.tinted {
color: var(--dsw-alias-label-tertiary);
}
.tinted[data-tone='open'] {
color: var(--dsw-alias-state-success-primary);
}
/* Orange, because the closed glyph already takes red. */
.tinted[data-tone='blocked'] {
color: var(--dsw-alias-state-warn-primary);
}
.tinted[data-tone='merged'] {
color: var(--dsw-alias-state-done-primary);
}
.tinted[data-tone='closed'] {
color: var(--dsw-alias-state-error-primary);
}
/* Checks outcome filling the glyph's head branch end. */
.checksMark[data-checks='failure'] {
fill: var(--dsw-alias-state-error-primary);
}
.checksMark[data-checks='pending'] {
fill: var(--dsw-alias-state-warn-primary);
}
.checksMark[data-checks='success'] {
fill: var(--dsw-alias-state-success-primary);
}
.chevron {
flex: none;
color: var(--dsw-alias-label-tertiary);
transition: transform 120ms ease;
}
.chevronOpen {
transform: rotate(180deg);
}
.ellipsis {
min-width: 0;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.diff {
display: inline-flex;
gap: 8px;
font-variant-numeric: tabular-nums;
}
.added {
color: var(--dsw-alias-state-success-primary);
}
.deleted {
color: var(--dsw-alias-state-error-primary);
}
.ci {
display: inline-flex;
align-items: center;
gap: 5px;
color: var(--dsw-alias-label-secondary);
}
.ci[data-tone='error'],
.flag[data-flag='changesRequested'],
.flag[data-flag='conflicting'] {
color: var(--dsw-alias-state-error-primary);
}
.flag {
color: var(--dsw-alias-label-tertiary);
}
/* Only the branch names and the collapsed status line shorten; the number, checks, and flags keep whole words on one line. */
.meta > :not(.ellipsis):not(.statusLine) {
flex: none;
white-space: nowrap;
}
/* The collapsed number and status: one line as wide as the row, so a change of its wording never resizes it. It clips
with an ellipsis and crawls with the title; its parts sit inline so the ellipsis cuts between characters. */
.statusLine {
flex: 1;
}
.statusLine .dot {
margin: 0 6px;
}
.statusLine .ci {
display: inline;
}
.statusLine .checkGlyph {
margin-inline-end: 5px;
vertical-align: -2px;
}
.statusLine .flag {
margin-inline-start: 6px;
}
.finished {
color: var(--dsw-alias-label-secondary);
}
.finished[data-tone='merged'] {
color: var(--dsw-alias-state-done-primary);
}
/* Read failure or unsupported host below the head, with its one action. */
.notice {
display: flex;
align-items: center;
justify-content: space-between;
gap: 8px;
padding: 0 10px 10px 33px;
color: var(--dsw-alias-label-secondary);
font-size: 12px;
line-height: 18px;
}
/* Expanded facts, one sentence per row: an icon under the glyph, the value, an optional trailing part, and a chevron
on a row that opens something. */
.rows {
/* Contains the visually hidden row labels, so they never extend a scroll area outside the panel. */
position: relative;
display: grid;
grid-template-columns: 24px minmax(0, 1fr) auto 12px;
gap: 0 8px;
padding: 4px 6px 6px;
border-top: 0.5px solid var(--dsw-alias-border-l2);
}
.row {
display: grid;
grid-column: 1 / -1;
grid-template-columns: subgrid;
align-items: center;
column-gap: 8px;
box-sizing: border-box;
width: 100%;
min-height: 32px;
margin: 0;
padding: 0 8px;
border: 0;
border-radius: var(--dsw-radius-sm);
background: transparent;
color: var(--dsw-alias-label-primary);
font: inherit;
text-align: left;
}
.rowWide {
grid-column: 2 / 4;
}
.row:disabled {
cursor: default;
}
.rowButton {
cursor: pointer;
}
.rowButton[aria-expanded='true'] {
background: var(--dsw-alias-interactive-bg-hover);
}
@media (hover: hover) {
.rowButton:hover {
background: var(--dsw-alias-interactive-bg-hover);
}
}
.rowIcon {
display: inline-flex;
grid-column: 1;
justify-content: center;
color: var(--dsw-alias-label-tertiary);
}
.rowChevron {
grid-column: 4;
color: var(--dsw-alias-label-tertiary);
}
.rowValue {
display: inline-flex;
grid-column: 2;
align-items: center;
gap: 6px;
min-width: 0;
}
/* Trailing detail of a row, such as the reviewers' avatars or the unresolved thread count. */
.rowTrailing {
display: inline-flex;
grid-column: 3;
align-items: center;
gap: 4px;
color: var(--dsw-alias-label-tertiary);
font-size: 12px;
font-variant-numeric: tabular-nums;
}
.rowValue[data-tone='error'] {
color: var(--dsw-alias-state-error-primary);
}
.rowValue[data-tone='success'] {
color: var(--dsw-alias-state-success-primary);
}
.rowValue[data-tone='merged'] {
color: var(--dsw-alias-state-done-primary);
}
.rowValue[data-tone='closed'] {
color: var(--dsw-alias-label-secondary);
}
/* The checks menu anchors to the whole row. */
.checksAnchor {
display: grid;
grid-column: 1 / -1;
grid-template-columns: subgrid;
}
.checksList {
min-width: 280px;
}
.checkItem {
display: flex;
align-items: center;
gap: 12px;
width: 100%;
min-width: 0;
}
.checkTime {
flex: none;
margin-left: auto;
color: var(--dsw-alias-label-tertiary);
font-size: 12px;
}
.checkGlyph {
display: inline-flex;
flex: none;
color: var(--dsw-alias-label-tertiary);
}
.pass {
color: var(--dsw-alias-state-success-primary);
}
.fail {
color: var(--dsw-alias-state-error-primary);
}
.running {
color: var(--dsw-alias-state-warn-primary);
}
/* The action of an open change request below its rows. */
.footer {
display: flex;
align-items: center;
gap: 8px;
padding: 2px 14px 12px;
}
.primaryAction {
height: 32px;
padding: 0 14px;
font-size: 13px;
line-height: 20px;
}
/*
* The merge action takes the blue button fill, moved toward the label color so its 13px label keeps 4.5:1 contrast
* in both themes. The doubled class outranks the shared primary fill in any stylesheet order.
*/
.primaryAction.mergeAction {
gap: 6px;
padding: 0 10px 0 14px;
background: color-mix(in srgb, var(--dsw-alias-button-info-fill) 92%, var(--dsw-alias-label-primary));
color: var(--dsw-alias-label-primary-foreground);
}
@media (hover: hover) {
.primaryAction.mergeAction:hover:not(:disabled) {
background: color-mix(in srgb, var(--dsw-alias-button-info-fill) 85%, var(--dsw-alias-label-primary));
}
}
/* A solid caret that points down, and up while the menu is open. */
.mergeCaret {
flex: none;
transform: rotate(90deg);
transition: transform 120ms ease;
}
.mergeCaretOpen {
transform: rotate(-90deg);
}
/* A merge method row: its name with the note on what it does below. */
.method {
display: flex;
flex-direction: column;
gap: 2px;
min-width: 0;
}
.methodNote {
color: var(--dsw-alias-label-tertiary);
font-size: 12px;
}
.titleIcon {
display: inline-flex;
flex: none;
color: var(--dsw-alias-label-secondary);
}
.titleText {
min-width: 0;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
/* Change request count beside the Session panel section title. */
.count {
color: var(--dsw-alias-label-tertiary);
font: var(--dsw-font-xxs-12);
font-variant-numeric: tabular-nums;
}
/* Environment rows: the kind or size trails the name; the Session panel's row rules reveal the More button. */
.envName {
display: block;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.envName:focus-visible {
outline: var(--dsw-focus-ring-width) solid var(--dsw-focus-ring-color, var(--dsw-alias-state-business-primary));
outline-offset: 1px;
}
.envNote {
max-width: 120px;
overflow: hidden;
font: var(--dsw-font-xxs-12);
text-overflow: ellipsis;
white-space: nowrap;
}
.envRow[data-missing] .envName,
.envRow[data-missing] .envNote,
.envRow[data-failed] .envName {
color: var(--dsw-alias-state-warn-primary);
}
/* The title of a status row: what failed or needs the user, in the warning color the checkout row's failure uses. */
.statusTitle {
color: var(--dsw-alias-state-warn-primary);
}
/* The command a sign-in row asks the user to run, in code type on its detail line. */
.signinCommand {
font-family: var(--ds-font-family-code);
}
/* A failure's info button: a 24px target in the trailing area whose 16px glyph darkens on hover, focus, or while its
reason shows, without a fill; it stays visible so touch screens can press it. */
.reason {
display: inline-flex;
flex: none;
align-items: center;
justify-content: center;
width: 24px;
height: 24px;
margin: -4px;
padding: 0;
border: 0;
border-radius: var(--dsw-radius-xs);
background: transparent;
color: var(--dsw-alias-label-tertiary);
cursor: pointer;
}
.reason:focus-visible {
outline: var(--dsw-focus-ring-width) solid var(--dsw-focus-ring-color, var(--dsw-alias-state-business-primary));
outline-offset: -2px;
}
.reason[aria-describedby],
.reason:focus-visible {
color: var(--dsw-alias-label-primary);
}
@media (hover: hover) {
.reason:hover {
color: var(--dsw-alias-label-primary);
}
}
/* Attention mark over the Session panel toggle; the toggle sizes and places it. */
.attention {
background: var(--dsw-alias-state-warn-primary);
}
/* The unresolved review thread count at the end of the changes row. */
.threads {
display: inline-flex;
align-items: center;
gap: 3px;
color: var(--dsw-alias-label-secondary);
}
/* Text read only by assistive technology: a fact row's name and the attention mark's description. */
.visuallyHidden {
position: absolute;
width: 1px;
height: 1px;
overflow: hidden;
clip-path: inset(50%);
white-space: nowrap;
}