fix(web): keep Git progress title anchored
- Prevent the title row from shifting when output is revealed - Preserve panel and compact button sizing
This commit is contained in:
1 parent
1e52051723
commit
d2d785cebf
1 file changed
+15
-3
@@ -358,7 +358,13 @@ function GitQuickActionIcon({
|
||||
return <InfoIcon className={iconClassName} />;
|
||||
}
|
||||
|
||||
function GitActionProgressButtonContent({ progress }: { progress: GitActionProgressPresentation }) {
|
||||
function GitActionProgressButtonContent({
|
||||
progress,
|
||||
isPanel,
|
||||
}: {
|
||||
progress: GitActionProgressPresentation;
|
||||
isPanel: boolean;
|
||||
}) {
|
||||
const [nowMs, setNowMs] = useState(() => Date.now());
|
||||
|
||||
useEffect(() => {
|
||||
@@ -379,7 +385,13 @@ function GitActionProgressButtonContent({ progress }: { progress: GitActionProgr
|
||||
<div
|
||||
aria-atomic="false"
|
||||
aria-live="polite"
|
||||
className="grid min-w-0 flex-1 grid-cols-[auto_minmax(0,1fr)_auto] items-center gap-x-2.5 gap-y-0.5"
|
||||
className={cn(
|
||||
"grid min-w-0 flex-1 grid-cols-[auto_minmax(0,1fr)_auto] items-center gap-x-2.5 gap-y-0.5",
|
||||
// Pin the title row to the button's minimum content height (min-height
|
||||
// minus vertical padding) so revealing the output row extends the
|
||||
// button downward without re-centering — the title must not shift.
|
||||
isPanel ? "grid-rows-[1.75rem]" : "grid-rows-[1.25rem] sm:grid-rows-[1rem]",
|
||||
)}
|
||||
role="status"
|
||||
>
|
||||
<Spinner
|
||||
@@ -1657,7 +1669,7 @@ export default function GitActionsControl({
|
||||
size="xs"
|
||||
variant={isPanel ? "ghost" : "outline"}
|
||||
>
|
||||
<GitActionProgressButtonContent progress={gitActionProgress} />
|
||||
<GitActionProgressButtonContent isPanel={isPanel} progress={gitActionProgress} />
|
||||
</Button>
|
||||
) : quickActionDisabledReason ? (
|
||||
<Popover>
|
||||
|
||||
Reference in new issue
Block a user