Some checks failed
Main Branch Build / republish-pr-artifacts (Linux) (push) Has been cancelled
Main Branch Build / republish-pr-artifacts (macOS) (push) Has been cancelled
PR Checks / track-rerun (push) Has been cancelled
PR Checks / prettier-check (push) Has been cancelled
PR Checks / core-checks (push) Has been cancelled
PR Checks / gui-checks (push) Has been cancelled
PR Checks / binary-checks (push) Has been cancelled
PR Checks / vscode-checks (push) Has been cancelled
PR Checks / get-packages-matrix (push) Has been cancelled
PR Checks / vscode-get-test-file-matrix (push) Has been cancelled
PR Checks / vscode-package-extension-linux (push) Has been cancelled
PR Checks / jetbrains-tests (push) Has been cancelled
Submit Gradle Dependency Graph For Dependabot / dependency-submission (push) Has been cancelled
PR Checks / packages-checks (push) Has been cancelled
PR Checks / unknown () (push) Has been cancelled
PR Checks / require-all-checks-to-pass (push) Has been cancelled
Third report of the same overflow class after fixing InputToolbar and BlockSettingsTopToolbar -- this time PendingApplyStatesToolbar (the filename + Accept/Reject row shown while a diff is pending). Rather than keep fixing these one report at a time, audited every sibling in LumpToolbar's mutually-exclusive render states (StreamingToolbar, EditToolbar, EditOutcomeToolbar, IsApplyingToolbar, PendingToolCallToolbar) -- all shared the identical missing-min-w-0 pattern on a justify-between row with one growable/truncating side and one fixed-content side (buttons/shortcuts). Fixed all of them: min-w-0 on the truncating side (needed even with flex-1, since flex-basis:0 does not override the default min-width:auto), flex-shrink-0 + whitespace-nowrap on the fixed side so it's what stays fully visible if anything has to give. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
44 lines
1.4 KiB
TypeScript
44 lines
1.4 KiB
TypeScript
import { ApplyState } from "core";
|
|
import { getUriPathBasename } from "core/util/uri";
|
|
import AcceptRejectDiffButtons from "../../../AcceptRejectDiffButtons";
|
|
import FileIcon from "../../../FileIcon";
|
|
|
|
interface PendingApplyStatesToolbarProps {
|
|
pendingApplyStates: ApplyState[];
|
|
}
|
|
|
|
export function PendingApplyStatesToolbar({
|
|
pendingApplyStates,
|
|
}: PendingApplyStatesToolbarProps) {
|
|
// Group apply states by filepath
|
|
const applyStatesByFilepath = pendingApplyStates.reduce(
|
|
(acc, state) => {
|
|
const filepath = state.filepath || ""; // Use empty string as fallback
|
|
if (!acc[filepath]) {
|
|
acc[filepath] = [];
|
|
}
|
|
acc[filepath].push(state);
|
|
return acc;
|
|
},
|
|
{} as Record<string, ApplyState[]>,
|
|
);
|
|
|
|
return (
|
|
<div className="flex flex-col gap-2">
|
|
{Object.entries(applyStatesByFilepath).map(([filepath, states]) => (
|
|
<div key={filepath} className="flex min-w-0 justify-between gap-3">
|
|
{filepath && (
|
|
<span className="bg-badge flex min-w-0 max-w-[75%] flex-shrink items-center gap-1 truncate rounded pr-1 text-xs">
|
|
<FileIcon filename={filepath} height="18px" width="18px" />
|
|
<span className="truncate">{getUriPathBasename(filepath)}</span>
|
|
</span>
|
|
)}
|
|
<AcceptRejectDiffButtons
|
|
applyStates={states}
|
|
onAcceptOrReject={async () => {}}
|
|
/>
|
|
</div>
|
|
))}
|
|
</div>
|
|
);
|
|
}
|