Skip to content

Commit dec7d74

Browse files
refactor(web): keep component implementation helpers private
1 parent fba39bb commit dec7d74

31 files changed

Lines changed: 46 additions & 79 deletions

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ import {
1818
SelectValue,
1919
} from "./ui/select";
2020

21-
export const PREVIOUS_WORKTREE_SELECT_VALUE = "previous-worktree";
21+
const PREVIOUS_WORKTREE_SELECT_VALUE = "previous-worktree";
2222

2323
interface BranchToolbarEnvModeSelectorProps {
2424
envLocked: boolean;

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ type ConfirmationCopy = {
2323
readonly description: string | null;
2424
};
2525

26-
export function resolveConfirmDialogCopy(message: string): ConfirmationCopy {
26+
function resolveConfirmDialogCopy(message: string): ConfirmationCopy {
2727
const normalizedMessage = message.trim();
2828
const lines = normalizedMessage.split("\n");
2929
const questionLineIndex = lines.findIndex((line) => line.trim().endsWith("?"));

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

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,8 +104,6 @@ interface DiffPanelProps {
104104
workspaceMutationId: string | null;
105105
}
106106

107-
export { DiffWorkerPoolProvider } from "./DiffWorkerPoolProvider";
108-
109107
export default function DiffPanel({
110108
mode = "inline",
111109
composerDraftTarget,

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ function LucideLike(props: SVGProps<SVGSVGElement>) {
2323
}
2424

2525
/** A Mac mini: squat rounded slab with a front-edge LED. */
26-
export function MacMiniIcon(props: SVGProps<SVGSVGElement>) {
26+
function MacMiniIcon(props: SVGProps<SVGSVGElement>) {
2727
return (
2828
<LucideLike {...props}>
2929
<rect width="20" height="8" x="2" y="8" rx="2" />
@@ -33,7 +33,7 @@ export function MacMiniIcon(props: SVGProps<SVGSVGElement>) {
3333
}
3434

3535
/** A Mac Studio: the same slab twice as tall, ports along the front foot. */
36-
export function MacStudioIcon(props: SVGProps<SVGSVGElement>) {
36+
function MacStudioIcon(props: SVGProps<SVGSVGElement>) {
3737
return (
3838
<LucideLike {...props}>
3939
<rect width="18" height="14" x="3" y="5" rx="2" />

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -354,7 +354,7 @@ interface SidebarThreadRowProps {
354354
) => boolean;
355355
}
356356

357-
export const SidebarThreadRow = memo(function SidebarThreadRow(props: SidebarThreadRowProps) {
357+
const SidebarThreadRow = memo(function SidebarThreadRow(props: SidebarThreadRowProps) {
358358
const {
359359
orderedProjectThreadKeys,
360360
isActive,

‎apps/web/src/components/ProviderUpdateLaunchNotification.logic.ts‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,7 @@ export function providerUpdateNotificationKey(
220220
return parts.length > 0 ? parts.join("|") : null;
221221
}
222222

223-
export function formatProviderList(providers: ReadonlyArray<Pick<ServerProvider, "driver">>) {
223+
function formatProviderList(providers: ReadonlyArray<Pick<ServerProvider, "driver">>) {
224224
const names = providers.map(
225225
(provider) => PROVIDER_DISPLAY_NAMES[provider.driver] ?? provider.driver,
226226
);
@@ -249,7 +249,7 @@ export function shouldShowPrimaryProviderUpdateToast(view: ProviderUpdateToastVi
249249
return view.phase !== "running";
250250
}
251251

252-
export function getProviderUpdateRunningToastView(providerCount: number): ProviderUpdateToastView {
252+
function getProviderUpdateRunningToastView(providerCount: number): ProviderUpdateToastView {
253253
return {
254254
phase: "running",
255255
type: "loading",

‎apps/web/src/components/Sidebar.logic.ts‎

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -15,18 +15,18 @@ import type { SidebarThreadSummary, Thread } from "../types";
1515
import { cn } from "../lib/utils";
1616
import { isLatestTurnSettled } from "../session-logic";
1717

18-
export const THREAD_SELECTION_SAFE_SELECTOR = "[data-thread-item], [data-thread-selection-safe]";
18+
const THREAD_SELECTION_SAFE_SELECTOR = "[data-thread-item], [data-thread-selection-safe]";
1919
export const THREAD_JUMP_HINT_SHOW_DELAY_MS = 200;
2020
// Visible sidebar rows are prewarmed into the thread-detail cache so opening a
2121
// nearby thread usually reuses an already-hot subscription. Each prewarmed
2222
// thread holds a live, fully hydrated detail subscription (all messages and
2323
// activities, growing as agents work) for as long as the row stays visible,
2424
// so this limit is a direct renderer-heap and server-load multiplier — keep
2525
// it small; cold opens still render instantly from the cached snapshot.
26-
export const SIDEBAR_THREAD_PREWARM_LIMIT = 3;
26+
const SIDEBAR_THREAD_PREWARM_LIMIT = 3;
2727
// A small buffer keeps the next few rows warm without leasing every row that
2828
// content-visibility leaves mounted below the scroll viewport.
29-
export const SIDEBAR_ROW_SUBSCRIPTION_OVERSCAN_PX = 160;
29+
const SIDEBAR_ROW_SUBSCRIPTION_OVERSCAN_PX = 160;
3030

3131
export function useSidebarRowSubscriptionLease(isActive: boolean): {
3232
readonly leaseLiveStatus: boolean;
@@ -544,13 +544,6 @@ export function resolveSidebarThreadStatus(thread: SidebarThreadStatusInput): Si
544544
return "ready";
545545
}
546546

547-
/** NaN-safe Date.parse for sort comparators: a malformed timestamp must not
548-
poison the whole ordering, so it sinks to the epoch instead. */
549-
export function parseTimestampMs(isoDate: string): number {
550-
const parsed = Date.parse(isoDate);
551-
return Number.isNaN(parsed) ? 0 : parsed;
552-
}
553-
554547
/** First VALID timestamp wins: `a ?? b` falls through on null, but a present-
555548
yet-malformed string must also fall through to the next candidate rather
556549
than sink the row to the epoch. */
@@ -567,7 +560,7 @@ export function firstValidTimestampMs(
567560

568561
/** String twin of firstValidTimestampMs for callers that need the ISO string
569562
(display labels, tick anchors) rather than epoch ms. */
570-
export function firstValidTimestamp(
563+
function firstValidTimestamp(
571564
...candidates: ReadonlyArray<string | null | undefined>
572565
): string | null {
573566
for (const candidate of candidates) {

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

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,7 @@ export type ThreadCommandSubtitleVariant =
1515
| "favicon-workspace"
1616
| "favicon-branch-harness";
1717

18-
export const THREAD_COMMAND_SUBTITLE_VARIANT: ThreadCommandSubtitleVariant =
19-
"favicon-workspace-harness";
18+
const THREAD_COMMAND_SUBTITLE_VARIANT: ThreadCommandSubtitleVariant = "favicon-workspace-harness";
2019

2120
export const COMMAND_PALETTE_META_ICON_CLASS = "size-3 shrink-0 text-muted-foreground/70";
2221

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ function buildTooltipContent(context: ElementContextDraft): string {
3939
return lines.join("\n");
4040
}
4141

42-
export function ComposerPendingElementContextChip({
42+
function ComposerPendingElementContextChip({
4343
context,
4444
onRemove,
4545
}: ComposerPendingElementContextChipProps) {
Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,10 @@
1-
import { cn } from "~/lib/utils";
21
import {
32
type TerminalContextDraft,
43
formatTerminalContextLabel,
54
isTerminalContextExpired,
65
} from "~/lib/terminalContext";
76
import { TerminalContextInlineChip } from "./TerminalContextInlineChip";
87

9-
interface ComposerPendingTerminalContextsProps {
10-
contexts: ReadonlyArray<TerminalContextDraft>;
11-
className?: string;
12-
}
13-
148
interface ComposerPendingTerminalContextChipProps {
159
context: TerminalContextDraft;
1610
}
@@ -26,19 +20,3 @@ export function ComposerPendingTerminalContextChip({
2620

2721
return <TerminalContextInlineChip label={label} tooltipText={tooltipText} expired={expired} />;
2822
}
29-
30-
export function ComposerPendingTerminalContexts(props: ComposerPendingTerminalContextsProps) {
31-
const { contexts, className } = props;
32-
33-
if (contexts.length === 0) {
34-
return null;
35-
}
36-
37-
return (
38-
<div className={cn("flex flex-wrap gap-1.5", className)}>
39-
{contexts.map((context) => (
40-
<ComposerPendingTerminalContextChip key={context.id} context={context} />
41-
))}
42-
</div>
43-
);
44-
}

0 commit comments

Comments
 (0)