Skip to content

Commit 49e2992

Browse files
committed
refactor: hide ui helper internals
1 parent ff56db1 commit 49e2992

9 files changed

Lines changed: 13 additions & 18 deletions

File tree

ui/src/ui/assistant-identity.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ const MAX_ASSISTANT_AVATAR_REASON = 200;
1414
// this module free of UI view imports (avoids an import cycle).
1515
const RENDERABLE_AVATAR_URL_RE = /^(data:image\/|\/(?!\/))/i;
1616

17-
export const DEFAULT_ASSISTANT_NAME = "Assistant";
17+
const DEFAULT_ASSISTANT_NAME = "Assistant";
1818
export const DEFAULT_ASSISTANT_AVATAR = "A";
1919

2020
export type AssistantIdentity = {

ui/src/ui/chat/attachment-payload-store.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ export function getChatAttachmentPreviewUrl(attachment: ChatAttachment): string
5050
);
5151
}
5252

53-
export function cloneChatAttachmentMetadata(attachment: ChatAttachment): ChatAttachment {
53+
function cloneChatAttachmentMetadata(attachment: ChatAttachment): ChatAttachment {
5454
const { dataUrl: _dataUrl, ...metadata } = attachment;
5555
return metadata;
5656
}
@@ -76,7 +76,7 @@ export function releaseChatAttachmentPayloads(attachments: readonly ChatAttachme
7676
}
7777
}
7878

79-
export function discardChatAttachmentDataUrl(id: string): void {
79+
function discardChatAttachmentDataUrl(id: string): void {
8080
const payload = payloads.get(id);
8181
if (!payload) {
8282
return;

ui/src/ui/chat/session-cache.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
export const MAX_CACHED_CHAT_SESSIONS = 20;
1+
const MAX_CACHED_CHAT_SESSIONS = 20;
22

33
export function getOrCreateSessionCacheValue<T>(
44
map: Map<string, T>,

ui/src/ui/controllers/config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ export async function loadConfigSchema(state: ConfigState) {
7878
}
7979
}
8080

81-
export function applyConfigSchema(state: ConfigState, res: ConfigSchemaResponse) {
81+
function applyConfigSchema(state: ConfigState, res: ConfigSchemaResponse) {
8282
state.configSchema = res.schema ?? null;
8383
state.configUiHints = res.uiHints ?? {};
8484
state.configSchemaVersion = res.version ?? null;

ui/src/ui/controllers/cron.ts

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -89,9 +89,7 @@ export type CronModelSuggestionsState = {
8989
cronModelSuggestions: string[];
9090
};
9191

92-
export function supportsAnnounceDelivery(
93-
form: Pick<CronFormState, "sessionTarget" | "payloadKind">,
94-
) {
92+
function supportsAnnounceDelivery(form: Pick<CronFormState, "sessionTarget" | "payloadKind">) {
9593
return form.sessionTarget !== "main" && form.payloadKind === "agentTurn";
9694
}
9795

@@ -523,7 +521,7 @@ function jobToForm(job: CronJob, prev: CronFormState): CronFormState {
523521
return normalizeCronFormState(next);
524522
}
525523

526-
export function buildCronSchedule(form: CronFormState) {
524+
function buildCronSchedule(form: CronFormState) {
527525
if (form.scheduleKind === "at") {
528526
const ms = Date.parse(form.scheduleAt);
529527
if (!Number.isFinite(ms)) {
@@ -559,7 +557,7 @@ export function buildCronSchedule(form: CronFormState) {
559557
return { kind: "cron" as const, expr, tz: form.cronTz.trim() || undefined, staggerMs };
560558
}
561559

562-
export function buildCronPayload(form: CronFormState) {
560+
function buildCronPayload(form: CronFormState) {
563561
if (form.payloadKind === "systemEvent") {
564562
const text = form.payloadText.trim();
565563
if (!text) {

ui/src/ui/controllers/exec-approvals.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -106,10 +106,7 @@ export async function loadExecApprovals(
106106
}
107107
}
108108

109-
export function applyExecApprovalsSnapshot(
110-
state: ExecApprovalsState,
111-
snapshot: ExecApprovalsSnapshot,
112-
) {
109+
function applyExecApprovalsSnapshot(state: ExecApprovalsState, snapshot: ExecApprovalsSnapshot) {
113110
state.execApprovalsSnapshot = snapshot;
114111
if (!state.execApprovalsDirty) {
115112
state.execApprovalsForm = cloneConfigObject(snapshot.file ?? {});

ui/src/ui/gateway.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ type SelectedConnectAuth = {
147147
canFallbackToShared: boolean;
148148
};
149149

150-
export const CONTROL_UI_OPERATOR_ROLE = "operator";
150+
const CONTROL_UI_OPERATOR_ROLE = "operator";
151151

152152
export const CONTROL_UI_OPERATOR_SCOPES = [
153153
"operator.admin",

ui/src/ui/session-key.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ export function parseAgentSessionKey(
3636
return { agentId, rest };
3737
}
3838

39-
export function normalizeMainKey(value: string | undefined | null): string {
39+
function normalizeMainKey(value: string | undefined | null): string {
4040
return normalizeOptionalLowercaseString(value) ?? DEFAULT_MAIN_KEY;
4141
}
4242

ui/src/ui/theme.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ export type ResolvedTheme =
1111
| "custom-light";
1212

1313
export const VALID_THEME_NAMES = new Set<ThemeName>(["claw", "knot", "dash", "custom"]);
14-
export const VALID_THEME_MODES = new Set<ThemeMode>(["system", "light", "dark"]);
14+
const VALID_THEME_MODES = new Set<ThemeMode>(["system", "light", "dark"]);
1515

1616
type ThemeSelection = { theme: ThemeName; mode: ThemeMode };
1717

@@ -29,7 +29,7 @@ const LEGACY_MAP: Record<string, ThemeSelection> = {
2929
system: { theme: "claw", mode: "system" },
3030
};
3131

32-
export function prefersLightScheme(): boolean {
32+
function prefersLightScheme(): boolean {
3333
if (typeof globalThis.matchMedia !== "function") {
3434
return false;
3535
}

0 commit comments

Comments
 (0)