Skip to content

Commit a0a2daa

Browse files
committed
chore: merge main into composer Escape fix
2 parents be368b4 + a9ab904 commit a0a2daa

15 files changed

Lines changed: 181 additions & 42 deletions

‎apps/web/package.json‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232
"@tanstack/react-pacer": "^0.19.4",
3333
"@tanstack/react-router": "^1.160.2",
3434
"@tiptap/core": "^3.31.3",
35+
"@tiptap/extension-code": "^3.31.3",
3536
"@tiptap/extension-task-item": "^3.31.3",
3637
"@tiptap/extension-task-list": "^3.31.3",
3738
"@tiptap/pm": "^3.31.3",

‎apps/web/src/components/BranchToolbar.tsx‎

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ import {
5454
} from "./ui/menu";
5555
import { Separator } from "./ui/separator";
5656
import { Tooltip, TooltipPopup, TooltipTrigger } from "./ui/tooltip";
57+
import { MiddleTruncate } from "./ui/middle-truncate";
5758
import { ComposerSurface } from "./chat/ComposerSurface";
5859
import { useComposerMenuProps } from "./chat/composerEventScope";
5960
import { measureRestingComposerControls } from "./chat/restingComposerControlsMeasurement";
@@ -283,9 +284,7 @@ const MobileRunContextSelector = memo(function MobileRunContextSelector({
283284
) : (
284285
<FolderIcon className="size-3" />
285286
)}
286-
<span className="min-w-0 truncate">
287-
{resolveCurrentWorkspaceLabel(activeWorktreePath)}
288-
</span>
287+
<MiddleTruncate value={resolveCurrentWorkspaceLabel(activeWorktreePath)} />
289288
</span>
290289
</MenuRadioItem>
291290
<MenuRadioItem disabled={envModeLocked} value="worktree" closeOnClick>
@@ -298,7 +297,7 @@ const MobileRunContextSelector = memo(function MobileRunContextSelector({
298297
<MenuRadioItem disabled={envModeLocked} value="previous-worktree" closeOnClick>
299298
<span className="flex min-w-0 items-center gap-1.5">
300299
<HistoryIcon className="size-3" />
301-
<span className="min-w-0 truncate">{previousWorktreeLabel}</span>
300+
<MiddleTruncate value={previousWorktreeLabel} />
302301
</span>
303302
</MenuRadioItem>
304303
) : null}

‎apps/web/src/components/BranchToolbarBranchSelector.tsx‎

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@ import {
7373
} from "./ui/combobox";
7474
import { stackedThreadToast, toastManager } from "./ui/toast";
7575
import { Tooltip, TooltipPopup, TooltipTrigger } from "./ui/tooltip";
76+
import { MiddleTruncate } from "./ui/middle-truncate";
7677

7778
export interface BranchToolbarBranchSelectorHandle {
7879
open: () => void;
@@ -757,7 +758,7 @@ export function BranchToolbarBranchSelector({
757758
onContextMenu={(event) => handleBranchContextMenu(event, itemValue)}
758759
>
759760
<div className="flex w-full min-w-0 items-center justify-between gap-2">
760-
<span className="min-w-0 flex-1 truncate">{itemValue}</span>
761+
<MiddleTruncate value={itemValue} className="flex-1" />
761762
{badge && <span className="shrink-0 text-[10px] text-muted-foreground/45">{badge}</span>}
762763
</div>
763764
</ComboboxItem>
@@ -818,12 +819,11 @@ export function BranchToolbarBranchSelector({
818819
data-composer-label
819820
className="min-w-0 max-w-[240px] group-data-[compact]/composer-context:max-w-0"
820821
>
821-
<span
822+
<MiddleTruncate
823+
value={triggerLabel}
822824
data-composer-label-motion
823-
className="block w-full min-w-0 max-w-[240px] truncate transition-opacity duration-180 ease-[cubic-bezier(0.32,0.72,0,1)] group-data-[compact]/composer-context:opacity-0 motion-reduce:transition-none"
824-
>
825-
{triggerLabel}
826-
</span>
825+
className="flex w-full max-w-[240px] transition-opacity duration-180 ease-[cubic-bezier(0.32,0.72,0,1)] group-data-[compact]/composer-context:opacity-0 motion-reduce:transition-none"
826+
/>
827827
</span>
828828
<ChevronDownIcon className="size-3 shrink-0 opacity-50" />
829829
</ComboboxTrigger>

‎apps/web/src/components/ComposerPromptEditorTiptap.tsx‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ import {
4646
buildDocJson,
4747
buildTiptapContent,
4848
collapsedToFlat,
49+
ComposerCodeExtension,
4950
ComposerTaskItemExtension,
5051
flatToCollapsed,
5152
flatToMarkdown,
@@ -754,8 +755,9 @@ function ComposerPromptEditorTiptapInner(props: ComposerPromptEditorProps) {
754755
dropcursor: false,
755756
gapcursor: false,
756757
trailingNode: false,
758+
code: false,
757759
// Plain mode has no marks: typed markers stay literal characters.
758-
...(richText ? {} : { bold: false, italic: false, strike: false, code: false }),
760+
...(richText ? {} : { bold: false, italic: false, strike: false }),
759761
}),
760762
ComposerMentionExtension,
761763
ComposerSkillExtension,
@@ -764,6 +766,7 @@ function ComposerPromptEditorTiptapInner(props: ComposerPromptEditorProps) {
764766
ComposerMarkersExtension,
765767
...(richText
766768
? [
769+
ComposerCodeExtension,
767770
TaskList,
768771
ComposerTaskItemExtension.extend({
769772
addInputRules() {

‎apps/web/src/components/Sidebar.tsx‎

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -242,6 +242,7 @@ import { SidebarChromeFooter, SidebarChromeHeader } from "./sidebar/SidebarChrom
242242
import { SidebarHeaderIconButton, SidebarThreadHeader } from "./sidebar/SidebarThreadHeader";
243243
import { Popover, PopoverPopup, PopoverTrigger } from "./ui/popover";
244244
import { Tooltip, TooltipPopup, TooltipProvider, TooltipTrigger } from "./ui/tooltip";
245+
import { MiddleTruncate } from "./ui/middle-truncate";
245246
import {
246247
composerDraftHasUserContent,
247248
DraftId,
@@ -379,7 +380,7 @@ function SidebarThreadTooltip({
379380
{thread.branch ? (
380381
<div className="flex min-w-0 items-center gap-2">
381382
<GitBranchIcon className="size-3 shrink-0 stroke-muted-foreground" />
382-
<div className="min-w-0 truncate text-foreground/75">{thread.branch}</div>
383+
<MiddleTruncate value={thread.branch} className="flex text-foreground/75" />
383384
</div>
384385
) : null}
385386
{branchMismatch ? (
@@ -1932,9 +1933,11 @@ const SidebarThreadRow = memo(function SidebarThreadRow(props: {
19321933
{thread.branch ? (
19331934
<>
19341935
<ThreadWorktreeIndicator thread={thread} />
1935-
<span className="min-w-0 flex-1 truncate whitespace-nowrap text-muted-foreground/40">
1936-
{thread.branch}
1937-
</span>
1936+
<MiddleTruncate
1937+
value={thread.branch}
1938+
showTitle={false}
1939+
className="flex-1 text-muted-foreground/40"
1940+
/>
19381941
</>
19391942
) : (
19401943
<span className="flex-1" />

‎apps/web/src/components/ThreadCommandSubtitle.tsx‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ import { ProjectFavicon, type ProjectFaviconProject } from "./ProjectFavicon";
44
import { ProviderInstanceIcon } from "./chat/ProviderInstanceIcon";
55
import { cn } from "~/lib/utils";
66

7+
import { MiddleTruncate } from "./ui/middle-truncate";
8+
79
/**
810
* Flip this while reviewing command-palette thread subtitles.
911
* - favicon-workspace-harness: favicon + Folder/FolderGit2 + branch + harness (default)
@@ -84,7 +86,7 @@ export function ThreadCommandSubtitle(props: {
8486
{projectLabel ? <CommandPaletteMetaDot /> : null}
8587
<span className="inline-flex min-w-0 items-center gap-1">
8688
<WorkspaceIcon variant={variant} isWorktree={isWorktree} />
87-
<span className="min-w-0 truncate">{branchLabel}</span>
89+
<MiddleTruncate value={branchLabel} />
8890
</span>
8991
</>
9092
) : null}

‎apps/web/src/components/chat/ChangedFilesTree.tsx‎

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ import { DiffStatLabel, hasNonZeroStat } from "./DiffStatLabel";
1919
import { PierreEntryIcon } from "./PierreEntryIcon";
2020
import { Button } from "../ui/button";
2121
import { Tooltip, TooltipPopup, TooltipTrigger } from "../ui/tooltip";
22+
import { MiddleTruncate } from "../ui/middle-truncate";
2223

2324
const EMPTY_DIRECTORY_OVERRIDES: Record<string, boolean> = {};
2425

@@ -246,9 +247,10 @@ export const ChangedFilesTree = memo(function ChangedFilesTree(props: {
246247
theme={resolvedTheme}
247248
className="size-3.5 text-muted-foreground/70"
248249
/>
249-
<span className="truncate font-mono text-xs text-foreground/85 group-hover:text-foreground">
250-
{node.name}
251-
</span>
250+
<MiddleTruncate
251+
value={node.name}
252+
className="font-mono text-xs text-foreground/85 group-hover:text-foreground"
253+
/>
252254
{node.stat && (
253255
<span className="ml-auto shrink-0 font-mono text-[10px] tabular-nums">
254256
<DiffStatLabel additions={node.stat.additions} deletions={node.stat.deletions} />

‎apps/web/src/components/chat/WorktreeSetupCard.tsx‎

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ import { useEffect, useState, type ReactNode } from "react";
1919

2020
import { Button } from "~/components/ui/button";
2121
import { Spinner } from "~/components/ui/spinner";
22+
import { MiddleTruncate } from "../ui/middle-truncate";
2223
import { observeVisibleAnimation } from "~/lib/visibleAnimation";
2324
import { cn } from "~/lib/utils";
2425

@@ -260,19 +261,25 @@ function SetupDetails({ snapshot }: { snapshot: WorktreeSetupSnapshot }) {
260261
{snapshot.branch ? (
261262
<>
262263
<dt className="text-foreground/80">Branch</dt>
263-
<dd className="truncate font-mono">{snapshot.branch}</dd>
264+
<dd className="min-w-0 font-mono">
265+
<MiddleTruncate value={snapshot.branch} className="flex" />
266+
</dd>
264267
</>
265268
) : null}
266269
{snapshot.baseRef ? (
267270
<>
268271
<dt className="text-foreground/80">Base</dt>
269-
<dd className="truncate font-mono">{snapshot.baseRef}</dd>
272+
<dd className="min-w-0 font-mono">
273+
<MiddleTruncate value={snapshot.baseRef} className="flex" />
274+
</dd>
270275
</>
271276
) : null}
272277
{snapshot.worktreePath ? (
273278
<>
274279
<dt className="text-foreground/80">Path</dt>
275-
<dd className="truncate font-mono">{snapshot.worktreePath}</dd>
280+
<dd className="min-w-0 font-mono">
281+
<MiddleTruncate value={snapshot.worktreePath} className="flex" />
282+
</dd>
276283
</>
277284
) : null}
278285
{snapshot.setupScript ? (

‎apps/web/src/components/pullRequest/PullRequestDetailPanel.tsx‎

Lines changed: 35 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,7 @@ import {
121121
import { Popover, PopoverPopup, PopoverTrigger } from "../ui/popover";
122122
import { toastManager } from "../ui/toast";
123123
import { Tooltip, TooltipPopup, TooltipProvider, TooltipTrigger } from "../ui/tooltip";
124+
import { MiddleTruncate } from "../ui/middle-truncate";
124125
import { PullRequestDetailGhost, PullRequestTimelineGhost } from "./PullRequestGhosts";
125126
import { PullRequestCopyableCode } from "./PullRequestCopyableCode";
126127
import { PullRequestActivityUnavailableState } from "./PullRequestActivityUnavailableState";
@@ -848,6 +849,9 @@ export function PullRequestDetailPanel({
848849
// and at worst answer from it.
849850
const invalidate = useAtomCommand(pullRequestEnvironment.invalidate, { reportFailure: false });
850851
const [isInvalidating, setIsInvalidating] = useState(false);
852+
// One word for "the host is being asked again", whichever of the two halves is in flight:
853+
// the invalidation round trip, then the detail read it kicks off.
854+
const refreshing = isInvalidating || detailQuery.isPending;
851855
const refreshFromHost = useCallback(async () => {
852856
setIsInvalidating(true);
853857
try {
@@ -1986,18 +1990,29 @@ export function PullRequestDetailPanel({
19861990
<MenuTrigger
19871991
render={
19881992
<Button
1989-
aria-label="More pull request actions"
1993+
aria-label={
1994+
refreshing ? "Refreshing pull request" : "More pull request actions"
1995+
}
19901996
className="size-6"
19911997
size="icon-xs"
19921998
variant="ghost-muted"
19931999
/>
19942000
}
19952001
>
1996-
<MoreHorizontalIcon className="size-4" />
2002+
{/* The refresh lives in this menu, so while one runs the trigger wears
2003+
the spinning glyph in place of the dots: the reader sees the panel
2004+
is fetching without a control appearing or the row shifting. */}
2005+
{refreshing ? (
2006+
<RefreshIcon refreshing className="size-4" />
2007+
) : (
2008+
<MoreHorizontalIcon className="size-4" />
2009+
)}
19972010
</MenuTrigger>
19982011
}
19992012
/>
2000-
<TooltipPopup>More pull request actions</TooltipPopup>
2013+
<TooltipPopup>
2014+
{refreshing ? "Refreshing pull request" : "More pull request actions"}
2015+
</TooltipPopup>
20012016
</Tooltip>
20022017
<MenuPopup align="end" side="bottom" className="min-w-72">
20032018
<PullRequestThreadLinks
@@ -2011,14 +2026,8 @@ export function PullRequestDetailPanel({
20112026
}
20122027
onPickerOpenChange={setThreadPickerOpen}
20132028
/>
2014-
<MenuItem
2015-
disabled={isInvalidating || detailQuery.isPending}
2016-
onClick={() => void refreshFromHost()}
2017-
>
2018-
<RefreshIcon
2019-
className="size-3.5"
2020-
refreshing={isInvalidating || detailQuery.isPending}
2021-
/>
2029+
<MenuItem disabled={refreshing} onClick={() => void refreshFromHost()}>
2030+
<RefreshIcon className="size-3.5" refreshing={refreshing} />
20222031
Refresh
20232032
</MenuItem>
20242033
<MenuItem disabled={handoff !== null} onClick={askAboutPullRequest}>
@@ -2267,7 +2276,9 @@ export function PullRequestDetailPanel({
22672276
className="size-3 shrink-0"
22682277
/>
22692278
) : null}
2270-
<code className="min-w-0 truncate">{detail.baseBranch}</code>
2279+
<code className="flex min-w-0">
2280+
<MiddleTruncate value={detail.baseBranch} showTitle={false} />
2281+
</code>
22712282
</PullRequestBaseFreshnessWarning>
22722283
) : (
22732284
<Tooltip>
@@ -2280,7 +2291,9 @@ export function PullRequestDetailPanel({
22802291
className="size-3 shrink-0"
22812292
/>
22822293
) : null}
2283-
<code className="min-w-0 truncate">{detail.baseBranch}</code>
2294+
<code className="flex min-w-0">
2295+
<MiddleTruncate value={detail.baseBranch} showTitle={false} />
2296+
</code>
22842297
</span>
22852298
}
22862299
/>
@@ -2298,7 +2311,9 @@ export function PullRequestDetailPanel({
22982311
<Tooltip>
22992312
<TooltipTrigger
23002313
render={
2301-
<code className="min-w-0 flex-1 truncate">{detail.headBranch}</code>
2314+
<code className="flex min-w-0 flex-1">
2315+
<MiddleTruncate value={detail.headBranch} showTitle={false} />
2316+
</code>
23022317
}
23032318
/>
23042319
<TooltipPopup side="top">{detail.headBranch}</TooltipPopup>
@@ -2452,7 +2467,9 @@ export function PullRequestDetailPanel({
24522467
className="size-3 shrink-0"
24532468
/>
24542469
) : null}
2455-
<code className="min-w-0 truncate">{detail.baseBranch}</code>
2470+
<code className="flex min-w-0">
2471+
<MiddleTruncate value={detail.baseBranch} showTitle={false} />
2472+
</code>
24562473
</PullRequestBaseFreshnessWarning>
24572474
) : (
24582475
<Tooltip>
@@ -2465,7 +2482,9 @@ export function PullRequestDetailPanel({
24652482
className="size-3 shrink-0"
24662483
/>
24672484
) : null}
2468-
<code className="min-w-0 truncate">{detail.baseBranch}</code>
2485+
<code className="flex min-w-0">
2486+
<MiddleTruncate value={detail.baseBranch} showTitle={false} />
2487+
</code>
24692488
</span>
24702489
}
24712490
/>

‎apps/web/src/components/pullRequest/PullRequestGhosts.tsx‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ import { formatRelativeTimeLabel } from "~/timestampFormat";
2727

2828
import { Button, InlineButton } from "../ui/button";
2929
import { Toggle, ToggleGroup } from "../ui/toggle-group";
30+
import { MiddleTruncate } from "../ui/middle-truncate";
3031
import { PullRequestCopyableCode } from "./PullRequestCopyableCode";
3132
import {
3233
PullRequestActorLabel,
@@ -252,7 +253,9 @@ export function PullRequestDetailGhost({
252253
<span className="flex min-w-0 flex-1 items-center gap-1.5 font-mono text-xs text-muted-foreground/70">
253254
{seed ? (
254255
<span className="inline-flex min-w-0 max-w-[40%] shrink-0 items-center gap-1">
255-
<code className="min-w-0 truncate">{seed.baseBranch}</code>
256+
<code className="flex min-w-0">
257+
<MiddleTruncate value={seed.baseBranch} />
258+
</code>
256259
</span>
257260
) : (
258261
<span className="inline-flex min-w-0 max-w-[40%] shrink-0 items-center gap-1">

0 commit comments

Comments
 (0)