Skip to content

Commit 835e6a7

Browse files
authored
refactor(ui): localize unused module exports (#101339)
1 parent 31432bf commit 835e6a7

37 files changed

Lines changed: 62 additions & 68 deletions

ui/src/api/gateway.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -235,15 +235,15 @@ export type GatewayConnectAuth = {
235235
password?: string;
236236
};
237237

238-
export type GatewayConnectDevice = {
238+
type GatewayConnectDevice = {
239239
id: string;
240240
publicKey: string;
241241
signature: string;
242242
signedAt: number;
243243
nonce: string;
244244
};
245245

246-
export type GatewayConnectClientInfo = {
246+
type GatewayConnectClientInfo = {
247247
id: GatewayClientName;
248248
version: string;
249249
platform: string;
@@ -319,7 +319,7 @@ type GatewayRequestTiming = {
319319
errorCode?: string;
320320
};
321321

322-
export type GatewayConnectTimingPhase =
322+
type GatewayConnectTimingPhase =
323323
| "socket-open"
324324
| "challenge"
325325
| "fallback"

ui/src/api/types.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -369,7 +369,7 @@ export type AgentsFilesSetResult = {
369369
file: AgentFileEntry;
370370
};
371371

372-
export type SessionWorkspaceFileEntry = {
372+
type SessionWorkspaceFileEntry = {
373373
path: string;
374374
workspacePath?: string;
375375
name: string;
@@ -397,7 +397,7 @@ type SessionWorkspaceBrowserResult = {
397397
truncated?: boolean;
398398
};
399399

400-
export type SessionWorkspaceArtifactEntry = {
400+
type SessionWorkspaceArtifactEntry = {
401401
id: string;
402402
type: string;
403403
title: string;

ui/src/app-routes.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ import { page as usagePage } from "./pages/usage/route.ts";
2323
import { page as workboardPage } from "./pages/workboard/route.ts";
2424
import { page as worktreesPage } from "./pages/worktrees/route.ts";
2525

26-
export type AppRouteModule = {
26+
type AppRouteModule = {
2727
render: (data: unknown) => unknown;
2828
};
2929

ui/src/app/settings.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ export type BorderRadiusStop = (typeof BORDER_RADIUS_STOPS)[number];
5656
export const TEXT_SCALE_STOPS = [90, 100, 110, 125, 140] as const;
5757
export type TextScaleStop = (typeof TEXT_SCALE_STOPS)[number];
5858

59-
export const CHAT_AUTO_SCROLL_MODES = ["always", "near-bottom", "off"] as const;
59+
const CHAT_AUTO_SCROLL_MODES = ["always", "near-bottom", "off"] as const;
6060
export type ChatAutoScrollMode = (typeof CHAT_AUTO_SCROLL_MODES)[number];
6161

6262
export function normalizeChatAutoScrollMode(value: unknown): ChatAutoScrollMode {
@@ -65,7 +65,7 @@ export function normalizeChatAutoScrollMode(value: unknown): ChatAutoScrollMode
6565
: "near-bottom";
6666
}
6767

68-
export const CHAT_SEND_SHORTCUTS = ["enter", "modifier-enter"] as const;
68+
const CHAT_SEND_SHORTCUTS = ["enter", "modifier-enter"] as const;
6969
export type ChatSendShortcut = (typeof CHAT_SEND_SHORTCUTS)[number];
7070

7171
export function normalizeChatSendShortcut(value: unknown): ChatSendShortcut {
@@ -143,7 +143,7 @@ export function setLastActiveSessionKey(host: LastActiveSessionHost, next: strin
143143
host.applySettings({ ...host.settings, lastActiveSessionKey: trimmed });
144144
}
145145

146-
export type ApplicationStartupLocation = {
146+
type ApplicationStartupLocation = {
147147
pathname: string;
148148
search: string;
149149
hash: string;

ui/src/components/markdown.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -405,7 +405,7 @@ const TAIL_LINK_BLUR_CLASS = "chat-link-tail-blur";
405405
const FENCE_OPEN_RE = /^[ \t]{0,3}(`{3,}|~{3,})/;
406406
const FENCE_CONTAINER_PREFIX_RE = /^[ \t]{0,3}(?:(?:>\s?)|(?:(?:[-+*]|\d{1,9}[.)])[ \t]+))/;
407407

408-
export type MarkdownCodeBlockChrome = "copy" | "none";
408+
type MarkdownCodeBlockChrome = "copy" | "none";
409409

410410
export type MarkdownRenderOptions = {
411411
codeBlockChrome?: MarkdownCodeBlockChrome;
@@ -1407,7 +1407,7 @@ export function toSanitizedMarkdownHtml(
14071407
return sanitized;
14081408
}
14091409

1410-
export function toEscapedPlainTextHtml(value: string): string {
1410+
function toEscapedPlainTextHtml(value: string): string {
14111411
return `<div class="markdown-plain-text-fallback">${escapeHtml(value.replace(/\r\n?/g, "\n"))}</div>`;
14121412
}
14131413

ui/src/components/terminal/terminal-connection.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ export type TerminalSessionInfo = {
3131
createdAtMs: number;
3232
};
3333

34-
export type TerminalExitInfo = {
34+
type TerminalExitInfo = {
3535
exitCode: number | null;
3636
signal: number | null;
3737
reason?: string;

ui/src/lib/agents/index.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -60,13 +60,13 @@ type AgentGateway = {
6060
subscribe: (listener: (snapshot: AgentGatewaySnapshot) => void) => () => void;
6161
};
6262

63-
export type AgentFilesStatus = {
63+
type AgentFilesStatus = {
6464
list: AgentsFilesListResult | null;
6565
loading: boolean;
6666
error: string | null;
6767
};
6868

69-
export type AgentCapabilityState = {
69+
type AgentCapabilityState = {
7070
client: GatewayBrowserClient | null;
7171
connected: boolean;
7272
agentsLoading: boolean;
@@ -86,7 +86,7 @@ export type AgentCapability = {
8686
dispose: () => void;
8787
};
8888

89-
export async function loadAgentsList(client: GatewayBrowserClient): Promise<AgentsListResult> {
89+
async function loadAgentsList(client: GatewayBrowserClient): Promise<AgentsListResult> {
9090
return client.request<AgentsListResult>("agents.list", {});
9191
}
9292

ui/src/lib/channels/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ export type ChannelsState = {
3434
whatsappBusy: boolean;
3535
};
3636

37-
export type LoadChannelsOptions = {
37+
type LoadChannelsOptions = {
3838
softTimeoutMs?: number;
3939
};
4040

ui/src/lib/chat/commands.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ import { normalizeLowercaseStringOrEmpty } from "../string-coerce.ts";
55

66
export type SlashCommandCategory = "session" | "model" | "agents" | "tools";
77

8-
export type SlashCommandTier = "essential" | "standard" | "power";
9-
export type ChatIconName = string;
8+
type SlashCommandTier = "essential" | "standard" | "power";
9+
type ChatIconName = string;
1010

1111
export type SlashCommandDef = {
1212
key: string;

ui/src/lib/chat/model-ref.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,7 @@ function createNameProviderKey(name: string, provider?: string | null): string {
211211
return `${name.toLowerCase()}\u0000${provider?.trim().toLowerCase() ?? ""}`;
212212
}
213213

214-
export type ChatModelDisplayLookup = ReadonlyMap<string, string>;
214+
type ChatModelDisplayLookup = ReadonlyMap<string, string>;
215215

216216
export function buildCatalogDisplayLookup(catalog: ModelCatalogEntry[]): Map<string, string> {
217217
const nameToValues = new Map<string, Set<string>>();

0 commit comments

Comments
 (0)