diff --git a/src/client/changes/GitLens.tsx b/src/client/changes/GitLens.tsx index 3d16a409..9f593721 100644 --- a/src/client/changes/GitLens.tsx +++ b/src/client/changes/GitLens.tsx @@ -10,7 +10,8 @@ import { memo, useCallback, useEffect, useLayoutEffect, useMemo, useRef, useState, type MouseEvent, type ReactNode } from 'react' import { Button, IconBranchOutlineRegular, IconCheckOutlineRegular, IconChevronRightOutlineRegular, - IconCodeOutlineRegular, IconCopyOutlineRegular, IconEllipsisOutlineRegular, IconPlusOutlineRegular, + IconCloseFillRegular, IconCodeOutlineRegular, IconCopyOutlineRegular, IconEllipsisOutlineRegular, + IconPlusOutlineRegular, IconRefreshOutlineRegular, IconSparkleRegular, IconTrashOutlineRegular, Menu, writeClipboard, } from '@deepseek-ai/dsh-client-ui-primitives' import type { Context } from '../../context-types.ts' @@ -1090,7 +1091,11 @@ export function GitLens(props: GitLensProps) { {/* A sibling of the scroller: usable even with both sections folded. */} {isRepo &&
- {actionError !== null && {actionError}} + {actionError !== null && + {actionError} + } label={t('dismiss')} + onClick={() => { setActionError(null) }} /> + }
{ setBranchOpen(false) }} portal compact side="top" autoFocus className={css.branchMenu} diff --git a/src/client/changes/changes.module.css b/src/client/changes/changes.module.css index 55560688..37b5e261 100644 --- a/src/client/changes/changes.module.css +++ b/src/client/changes/changes.module.css @@ -51,6 +51,12 @@ tab — the branch control must never leave the bottom of the pane. */ .gitFooter { flex: none; min-width: 0; position: sticky; bottom: 0; z-index: 1; border-top: 1px solid var(--dsw-alias-border-l1); background: var(--dsw-alias-bg-base); } .footerRow { display: flex; align-items: center; min-width: 0; min-height: 28px; } + +/* A failed remote op reports above the branch row and git's stderr can be long: + it keeps its own height (never truncated) but gets a dismiss control instead + of living in the docked footer until the next action. */ +.actionError { display: flex; align-items: flex-start; gap: 6px; white-space: normal; } +.actionErrorText { flex: 1; min-width: 0; white-space: pre-wrap; overflow-wrap: anywhere; } .branchMenu { display: flex; flex: 1; min-width: 0; } .branchButton, .syncButton { display: flex; align-items: center; gap: 5px; min-width: 0; min-height: 28px; padding: 3px 8px; border: none; background: transparent; color: var(--dsw-alias-label-secondary); font: var(--dsw-font-xxxs-11); cursor: pointer; } .branchButton { flex: 1; text-align: left; } diff --git a/tests/git-remote-actions-ui.spec.tsx b/tests/git-remote-actions-ui.spec.tsx index a22ddec2..f82a7bdc 100644 --- a/tests/git-remote-actions-ui.spec.tsx +++ b/tests/git-remote-actions-ui.spec.tsx @@ -107,7 +107,14 @@ describe('GitLens More Actions menu: remote actions', () => { const error = errorLine(container, `${t('pullError')}: Not possible to fast-forward`) expect(error).toBeDefined() expect(container.querySelectorAll('[role="alert"]')).toHaveLength(1) - expect(error!.parentElement).toBe(container.querySelector('[data-git-footer]')) + expect(container.querySelector('[data-git-footer]')!.contains(error!)).toBe(true) + + // A screenful of git stderr keeps its height but must be dismissible + // instead of squatting in the docked footer. + const dismiss = error!.querySelector(`button[aria-label="${t('dismiss')}"]`) + expect(dismiss).not.toBeNull() + act(() => { dismiss!.click() }) + expect(container.querySelectorAll('[role="alert"]')).toHaveLength(0) } finally { act(() => { root.unmount() }) container.remove()