Skip to content

Commit 2603d3f

Browse files
committed
chore: remove dead code
Drops one module nothing loads and 53 exports nothing imports, found by running the TypeScript language service over every exported declaration in web/, electron/ and mobile/ and keeping only the symbols with zero references outside their own file. useRecentDocuments was stranded by 65dd652 (decommission the dashboard): its only remaining consumer was its own test. LayerEffectType was never referenced at all — the layer-effect union is built from the per-effect interfaces directly. The rest keep their code and lose the `export` keyword, so the modules stop advertising an interface no caller uses. electron and mobile came back clean: every candidate there is imported by a test.
1 parent fe1a45f commit 2603d3f

15 files changed

Lines changed: 54 additions & 504 deletions

File tree

web/src/components/appbuilder/merge.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ import type {
1919
import { mergeByUnits } from "../../stores/documentMerge";
2020

2121
/** One flattened component: the Puck node plus where it hangs. */
22-
export interface FlatComponent {
22+
interface FlatComponent {
2323
node: { type: string; props: Record<string, unknown> & { id: string } };
2424
parentId: string | null;
2525
slot: string | null;
@@ -31,7 +31,7 @@ export interface FlatComponent {
3131
* Puck tree on the way out (the adapter's write rebuilds it), so a merged
3232
* result drops straight back into `ui.content`.
3333
*/
34-
export interface AppMergeDoc {
34+
interface AppMergeDoc {
3535
content: unknown[];
3636
operations: unknown[];
3737
variables: unknown[];
@@ -67,7 +67,7 @@ type ComponentNodeLike = {
6767
};
6868

6969
/** Flatten a Puck content tree into per-component merge units. */
70-
export function flattenAppComponents(content: unknown[]): FlatComponent[] {
70+
function flattenAppComponents(content: unknown[]): FlatComponent[] {
7171
const out: FlatComponent[] = [];
7272
const walk = (
7373
items: AnyNode[],
@@ -107,7 +107,7 @@ export function flattenAppComponents(content: unknown[]): FlatComponent[] {
107107
* Rebuild the Puck content tree from merged flat units. Roots keep their
108108
* merged order; children hang off their parent's slot in merged order.
109109
*/
110-
export function rebuildAppComponents(flat: FlatComponent[]): unknown[] {
110+
function rebuildAppComponents(flat: FlatComponent[]): unknown[] {
111111
// Drop units whose parent is gone (recursively: a dropped child can
112112
// orphan its own children).
113113
let kept = [...flat];
@@ -170,7 +170,7 @@ const named = (unit: unknown): string => {
170170
return String(unitRecord.name ?? byId(unit));
171171
};
172172

173-
export const appMergeAdapter: DocumentMergeAdapter<AppMergeDoc> = {
173+
const appMergeAdapter: DocumentMergeAdapter<AppMergeDoc> = {
174174
collections: [
175175
{
176176
kind: "component",

web/src/components/chat/message/toolCallPhrase.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import { formatToolName } from "../../../utils/formatUtils";
1212
import { isObjectLike, isString } from "../../../utils/typePredicates";
1313

1414
/** What a tool does, as far as the row phrasing is concerned. */
15-
export type ToolPhraseKind =
15+
type ToolPhraseKind =
1616
| "search"
1717
| "page"
1818
| "read"
@@ -74,7 +74,7 @@ const DETAIL_KEYS = [
7474
] as const;
7575

7676
/** A single row's label plus the mono-rendered thing it acted on. */
77-
export interface ToolRowPhrase {
77+
interface ToolRowPhrase {
7878
label: string;
7979
detail: string | null;
8080
}
@@ -114,7 +114,7 @@ export function toolCallDetail(
114114
const LOCATION_KEYS = ["url", "uri", "path", "file", "filename"] as const;
115115

116116
/** Whether a call's detail identifies a location rather than free text. */
117-
export function hasLocationDetail(call: ToolCall): boolean {
117+
function hasLocationDetail(call: ToolCall): boolean {
118118
const args = call.args;
119119
if (!isObjectLike(args)) {
120120
return false;
@@ -144,7 +144,7 @@ function compactUrl(value: string): string {
144144
}
145145

146146
/** How a run of same-tool calls renders: one row each, or one counted row. */
147-
export type RunDisplay = "list" | "count";
147+
type RunDisplay = "list" | "count";
148148

149149
/** Above this, a run is always counted — a wall of rows is not a timeline. */
150150
const MAX_LISTED_RUN = 4;

web/src/components/projects/projectStatus.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import type { RouterOutputs } from "../../trpc/client";
1111

1212
export type ProjectDetail = RouterOutputs["projects"]["summaries"][number];
1313
export type ProjectDocument = ProjectDetail["documents"][number];
14-
export type ProjectDocumentStatus = NonNullable<ProjectDocument["status"]>;
14+
type ProjectDocumentStatus = NonNullable<ProjectDocument["status"]>;
1515

1616
const statusOfKind = <K extends ProjectDocumentStatus["kind"]>(
1717
documents: readonly ProjectDocument[],
@@ -78,7 +78,7 @@ export const projectStatusLine = (
7878
return parts.join(" · ") + partialSuffix;
7979
};
8080

81-
export interface ProjectProgress {
81+
interface ProjectProgress {
8282
label: string;
8383
/** Everything the board set out to render exists. */
8484
done: boolean;
@@ -132,7 +132,7 @@ export const documentStatusLine = (document: ProjectDocument): string => {
132132
}
133133
};
134134

135-
export interface DocumentProgress {
135+
interface DocumentProgress {
136136
label: string;
137137
tone: "done" | "neutral" | "rendering";
138138
}
@@ -183,7 +183,7 @@ export const formatDocumentSpend = (document: ProjectDocument): string => {
183183
};
184184

185185
/** The step a project is waiting on, and the document that performs it. */
186-
export interface ProjectNextStep {
186+
interface ProjectNextStep {
187187
label: string;
188188
document: ProjectDocument;
189189
}

web/src/components/sketch/sam/SamServiceNode.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ const ACTIVE_DOWNLOAD_STATUSES = new Set([
5555
"progress"
5656
]);
5757

58-
export interface SamNodeConfig {
58+
interface SamNodeConfig {
5959
backendId: SegmentBackend;
6060
nodeType: string;
6161
displayName: string;
@@ -65,7 +65,7 @@ export interface SamNodeConfig {
6565
requiredSecret: string | null;
6666
}
6767

68-
export const SAM_NODE_CONFIGS: Record<string, SamNodeConfig> = {
68+
const SAM_NODE_CONFIGS: Record<string, SamNodeConfig> = {
6969
"local-sam3": {
7070
backendId: "local-sam3",
7171
nodeType: LOCAL_SAM3_NODE_TYPE,
@@ -86,7 +86,7 @@ export const SAM_NODE_CONFIGS: Record<string, SamNodeConfig> = {
8686
}
8787
};
8888

89-
export const DEFAULT_SAM_NODE_BACKEND = "local-sam3";
89+
const DEFAULT_SAM_NODE_BACKEND = "local-sam3";
9090

9191
interface LocalSam3PromptMetadata {
9292
capabilities: SamBackendCapabilities;

web/src/components/sketch/sketchCanvasHooks/DisplayFrameCoordinator.ts

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -85,12 +85,12 @@ export type RedrawReason =
8585
* - `immediate`: composite synchronously (low-latency path for direct drawing)
8686
* - `raf`: schedule via requestAnimationFrame (batched, coalesced)
8787
*/
88-
export type RedrawUrgency = "immediate" | "raf";
88+
type RedrawUrgency = "immediate" | "raf";
8989

9090
/**
9191
* A typed redraw request that records why and how urgently a frame is needed.
9292
*/
93-
export interface RedrawRequest {
93+
interface RedrawRequest {
9494
reason: RedrawReason;
9595
urgency: RedrawUrgency;
9696
/** Optional dirty rect for partial compositing. */
@@ -106,12 +106,12 @@ export interface RedrawRequest {
106106
* - `bootstrap`: Canvas2D temp surface while WebGPU initializes
107107
* - `display`: real display canvas (WebGPU or Canvas2D final)
108108
*/
109-
export type DisplayTarget = "bootstrap" | "display";
109+
type DisplayTarget = "bootstrap" | "display";
110110

111111
/**
112112
* Which rendering backend is active.
113113
*/
114-
export type DisplayBackend = "webgpu" | "canvas2d";
114+
type DisplayBackend = "webgpu" | "canvas2d";
115115

116116
// ─── Interaction readiness ───────────────────────────────────────────────────
117117

@@ -121,7 +121,7 @@ export type DisplayBackend = "webgpu" | "canvas2d";
121121
* When all flags are true, the display pipeline is ready for preview-only
122122
* and click-only interactions without requiring a prior stroke.
123123
*/
124-
export interface InteractionReadiness {
124+
interface InteractionReadiness {
125125
/** The runtime (Canvas2D or WebGPU) has been initialized. */
126126
runtimeReady: boolean;
127127
/** A hydration cycle has been scheduled and is still pending decode/upload. */
@@ -135,7 +135,7 @@ export interface InteractionReadiness {
135135
/**
136136
* Returns true when all readiness conditions are met.
137137
*/
138-
export function isInteractionReady(state: InteractionReadiness): boolean {
138+
function isInteractionReady(state: InteractionReadiness): boolean {
139139
return (
140140
state.runtimeReady &&
141141
!state.hydrationPending &&
@@ -147,7 +147,7 @@ export function isInteractionReady(state: InteractionReadiness): boolean {
147147
/**
148148
* Create a fresh readiness state (nothing ready yet).
149149
*/
150-
export function createInitialReadiness(): InteractionReadiness {
150+
function createInitialReadiness(): InteractionReadiness {
151151
return {
152152
runtimeReady: false,
153153
hydrationPending: false,
@@ -189,7 +189,7 @@ const MAX_TRACE_EVENTS = 200;
189189
* Stores the last N events so temporal startup bugs can be debugged
190190
* without scattering temporary logs across tools and runtimes.
191191
*/
192-
export class DisplayTracer {
192+
class DisplayTracer {
193193
private events: TraceEvent[] = [];
194194
private enabled: boolean;
195195

@@ -234,7 +234,7 @@ export class DisplayTracer {
234234

235235
// ─── Frame coordinator ───────────────────────────────────────────────────────
236236

237-
export interface FrameCoordinatorCallbacks {
237+
interface FrameCoordinatorCallbacks {
238238
/** Execute pending stroke buffer merge. */
239239
drainPendingStroke: () => void;
240240
/** Run the composite pipeline immediately. */

web/src/components/sketch/sketchClipboard.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ import type { Layer, Point, Selection } from "./types";
1515
/**
1616
* For copy/export: zero or scale RGBA alpha by the document-space mask inside `bounds`.
1717
*/
18-
export function multiplyImageDataAlphaBySelectionMask(
18+
function multiplyImageDataAlphaBySelectionMask(
1919
imageData: ImageData,
2020
bounds: { x: number; y: number; width: number; height: number },
2121
sel: Selection
@@ -35,7 +35,7 @@ export function multiplyImageDataAlphaBySelectionMask(
3535
}
3636

3737
/** Best-effort: decode the first image on the system clipboard into a canvas. */
38-
export async function readSystemClipboardImageCanvas(): Promise<HTMLCanvasElement | null> {
38+
async function readSystemClipboardImageCanvas(): Promise<HTMLCanvasElement | null> {
3939
try {
4040
const items = await navigator.clipboard.read();
4141

@@ -90,7 +90,7 @@ export function writeImageCanvasToSystemClipboardPng(canvas: HTMLCanvasElement):
9090
}
9191
}
9292

93-
export interface ResolveSketchPasteImageOptions {
93+
interface ResolveSketchPasteImageOptions {
9494
internalBuffer: HTMLCanvasElement | null;
9595
/**
9696
* When true (e.g. Ctrl+Shift+V), read the in-app buffer before the OS clipboard
@@ -122,7 +122,7 @@ export async function resolveSketchPasteImageCanvas(
122122
return image;
123123
}
124124

125-
export interface BuildSketchInternalClipboardParams {
125+
interface BuildSketchInternalClipboardParams {
126126
snapshot: HTMLCanvasElement;
127127
layer: Layer;
128128
documentCanvasWidth: number;
@@ -192,7 +192,7 @@ export function buildSketchInternalClipboardCanvas(
192192
return tmp;
193193
}
194194

195-
export interface SketchPasteDrawParams {
195+
interface SketchPasteDrawParams {
196196
/** Layer composite offset in document space (from {@link getLayerGeometry}). */
197197
offset: Point;
198198
/** Document-space top-left of pixel under cursor, if known. */

web/src/components/sketch/types/document.ts

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -156,18 +156,6 @@ export interface LayerImageReference {
156156
objectFit: LayerImageObjectFit;
157157
}
158158

159-
// ─── Layer Effects ────────────────────────────────────────────────────────────
160-
161-
/**
162-
* Supported per-layer effect types.
163-
* Each effect is evaluated between "draw raster" and "blend into composite"
164-
* via the runtime's `evaluateLayerEffects` method.
165-
*/
166-
export type LayerEffectType =
167-
| "brightness_contrast"
168-
| "hue_saturation"
169-
| "exposure";
170-
171159
// ─── Per-effect typed interfaces ──────────────────────────────────────────────
172160

173161
interface BrightnessContrastEffect {

web/src/components/timeline/timelineAgentBridge.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ export interface TimelineAddShapeClipOptions {
174174
}
175175

176176
/** Render/audio params the agent can patch on any clip. */
177-
export interface TimelineClipParamsPatch {
177+
interface TimelineClipParamsPatch {
178178
name?: string;
179179
opacity?: number;
180180
speedMultiplier?: number;
@@ -207,7 +207,7 @@ interface TimelineClipBindingPatch {
207207
regenerate?: boolean;
208208
}
209209

210-
export interface TimelineTrimPatch {
210+
interface TimelineTrimPatch {
211211
/** New clip duration on the timeline (ms). */
212212
durationMs?: number;
213213
/** Source-time trim start (ms). */
@@ -216,7 +216,7 @@ export interface TimelineTrimPatch {
216216
outPointMs?: number;
217217
}
218218

219-
export interface TimelineMovePatch {
219+
interface TimelineMovePatch {
220220
/** New absolute start on the timeline (ms). */
221221
startMs?: number;
222222
/** Reassign the clip to a different track. */
@@ -285,7 +285,7 @@ export interface TimelineAddMediaClipOptions {
285285
}
286286

287287
/** How {@link TimelineAgentHandler.setClipAnimations} applies its inputs. */
288-
export type ClipAnimationMode = "add" | "replace";
288+
type ClipAnimationMode = "add" | "replace";
289289

290290
/**
291291
* Operations the live {@link TimelineEditor} exposes to the agent tooling

web/src/core/chat/chatProtocol.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ export interface WorkflowUpdatedUpdate {
7777
graph: Graph;
7878
}
7979

80-
export interface GenerationStoppedUpdate {
80+
interface GenerationStoppedUpdate {
8181
type: "generation_stopped";
8282
message: string;
8383
}
@@ -131,7 +131,7 @@ interface SecretRequestMessage {
131131
help_url: string | null;
132132
}
133133

134-
export interface ToolCallMessage {
134+
interface ToolCallMessage {
135135
type: "tool_call";
136136
tool_call_id: string;
137137
name: string;
@@ -164,7 +164,7 @@ interface ChatTurnActiveUpdate {
164164
last_seq: number;
165165
}
166166

167-
export type MsgpackData =
167+
type MsgpackData =
168168
| JobUpdate
169169
| Chunk
170170
| Prediction
@@ -191,7 +191,7 @@ export type MsgpackData =
191191
| ChatTurnActiveUpdate
192192
| ErrorMessage;
193193

194-
export interface ToolResultMessage {
194+
interface ToolResultMessage {
195195
type: "tool_result";
196196
tool_call_id: string;
197197
result: unknown;

web/src/demo/assets/storyboardStills.ts

Lines changed: 6 additions & 6 deletions
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)