# Files changed · PR \#10227 · pingdotgg/t3code

[View on GitCafe](https://git.cafe/pingdotgg/t3code/pull/10227/diffs)

Repository: [pingdotgg/t3code](https://git.cafe/pingdotgg/t3code)

Visibility: public

[refactor\(web\): keep app utilities private and remove dead helpers](https://git.cafe/pingdotgg/t3code/pull/10227.md)

Version: 2

Head commit: ce43c55df9b28f06c5a80b1e34bfd98e02813385

Base commit: dec7d74ac579e2a16c6d3efcff698aff256d3ed7

Comparison base: dec7d74ac579e2a16c6d3efcff698aff256d3ed7

Showing up to 20 entries from this revision. If the pull request changes, reopen the first page before continuing.

## apps/web/src/browser/browserViewportActions.ts

Status: modified; +1; −1

```diff
@@ -4,7 +4,7 @@
 
 export const BROWSER_VIEWPORT_COMMIT_TIMEOUT_MS = 15_000;
 
-export class BrowserViewportCommitTimeoutError extends Error {
+class BrowserViewportCommitTimeoutError extends Error {
   override readonly name = "BrowserViewportCommitTimeoutError";
 
   constructor(readonly tabId: string) {
```

## apps/web/src/browser/webviewCrashRecovery.ts

Status: modified; +2; −2

```diff
@@ -1,6 +1,6 @@
 export const WEBVIEW_CRASH_RECOVERY_WINDOW_MS = 30_000;
-export const WEBVIEW_CRASH_RECOVERY_MAX_ATTEMPTS = 3;
-export const WEBVIEW_CRASH_RECOVERY_BASE_DELAY_MS = 250;
+const WEBVIEW_CRASH_RECOVERY_MAX_ATTEMPTS = 3;
+const WEBVIEW_CRASH_RECOVERY_BASE_DELAY_MS = 250;
 
 export interface WebviewCrashRecoveryState {
   readonly attempts: number;
```

## apps/web/src/browserFaviconLogic.ts

Status: modified; +1; −1

```diff
@@ -9,7 +9,7 @@
 };
 
 export const BROWSER_FAVICON_MAX_ENTRIES = 40;
-export const BROWSER_FAVICON_MAX_KEY_LENGTH = 4_096;
+const BROWSER_FAVICON_MAX_KEY_LENGTH = 4_096;
 const BROWSER_FAVICON_MAX_FUTURE_SKEW_MS = 5 * 60 * 1_000;
 export const BROWSER_FAVICON_MAX_ALIASES_PER_ENTRY = 4;
 const BROWSER_FAVICON_MAX_ALIAS_LENGTH = 255;
```

## apps/web/src/browserHistoryStore.ts

Status: modified; +2; −2

```diff
@@ -14,7 +14,7 @@
 
 export const BROWSER_HISTORY_MAX_ENTRIES_PER_PROJECT = 50;
 export const BROWSER_HISTORY_MAX_PROJECTS = 20;
-export const BROWSER_HISTORY_MAX_URL_LENGTH = 2048;
+const BROWSER_HISTORY_MAX_URL_LENGTH = 2048;
 export const BROWSER_HISTORY_MAX_TITLE_LENGTH = 512;
 const MAX_VALID_DATE_MS = 8_640_000_000_000_000;
 
@@ -35,7 +35,7 @@
   return parsed.href.length > BROWSER_HISTORY_MAX_URL_LENGTH ? null : parsed.href;
 }
 
-export function titleLookupKey(normalized: string, environmentHostname?: string | null): string {
+function titleLookupKey(normalized: string, environmentHostname?: string | null): string {
   const parsed = new URL(visitLookupKey(normalized, environmentHostname));
   if (parsed.pathname !== "/" && parsed.pathname.endsWith("/"))
     parsed.pathname = parsed.pathname.slice(0, -1);
```

## apps/web/src/clientPersistenceStorage.ts

Status: modified; +1; −1

```diff
@@ -2,7 +2,7 @@
 
 import { getLocalStorageItem, setLocalStorageItem } from "./hooks/useLocalStorage";
 
-export const CLIENT_SETTINGS_STORAGE_KEY = "t3code:client-settings:v1";
+const CLIENT_SETTINGS_STORAGE_KEY = "t3code:client-settings:v1";
 
 function hasWindow(): boolean {
   return typeof window !== "undefined";
```

## apps/web/src/composerDraftStore.ts

Status: modified; +2; −4

```diff
@@ -769,7 +769,7 @@
  * slice — adding a new field to the interface (e.g. `elementContexts`) only
  * has to be reflected here, not in every stub.
  */
-export function createEmptyThreadDraft(): ComposerThreadDraftState {
+function createEmptyThreadDraft(): ComposerThreadDraftState {
   return {
     prompt: "",
     images: [],
@@ -4050,9 +4050,7 @@
   );
 }
 
-export function useComposerDraftModelState(
-  threadRef: ComposerThreadTarget,
+function useComposerDraftModelState(threadRef: ComposerThreadTarget): ComposerDraftModelState {
-): ComposerDraftModelState {
   return useComposerDraftStore(
     useShallow((state) => {
       const draft = getComposerDraftState(state, threadRef);
```

## apps/web/src/desktopAppActivation.ts

Status: modified; +1; −1

```diff
@@ -44,7 +44,7 @@
   return { version: 1, requestId, ok: false, code, message };
 }
 
-export function desktopPlatformToEnvironmentOs(
+function desktopPlatformToEnvironmentOs(
   platform: DesktopAppActivationRequest["platform"],
 ): ExecutionEnvironmentPlatformOs {
   return platform === "win32" ? "windows" : platform;
```

## apps/web/src/keybindings.ts

Status: modified; +0; −8

```diff
@@ -377,14 +377,6 @@
   return matchesCommandShortcut(event, keybindings, "diff.toggle", options);
 }
 
-export function isPreviewRefreshShortcut(
-  event: ShortcutEventLike,
-  keybindings: ResolvedKeybindingsConfig,
-  options?: ShortcutMatchOptions,
-): boolean {
-  return matchesCommandShortcut(event, keybindings, "preview.refresh", options);
-}
-
 export function isOpenFavoriteEditorShortcut(
   event: ShortcutEventLike,
   keybindings: ResolvedKeybindingsConfig,
```

## apps/web/src/lib/attachmentUploadQueue.ts

Status: modified; +1; −1

```diff
@@ -445,7 +445,7 @@
  * persisted draft upload survives cancellation (an environment switch cancels
  * the old job, and the draft still references that server copy).
  */
-export function cancelAttachmentUpload(imageId: string): void {
+function cancelAttachmentUpload(imageId: string): void {
   const job = jobsByImageId.get(imageId);
   if (!job) {
     return;
```

## apps/web/src/lib/diffRendering.ts

Status: modified; +2; −2

```diff
@@ -1,7 +1,7 @@
 import { parsePatchFiles } from "@pierre/diffs/utils/parsePatchFiles";
 import type { FileDiffMetadata } from "@pierre/diffs/types";
 
-export const DIFF_THEME_NAMES = {
+const DIFF_THEME_NAMES = {
   light: "pierre-light",
   dark: "pierre-dark",
 } as const;
@@ -81,7 +81,7 @@
   compactPartialHunkOffsets?: boolean;
 }
 
-export function compactPartialHunkOffsets(file: FileDiffMetadata): FileDiffMetadata {
+function compactPartialHunkOffsets(file: FileDiffMetadata): FileDiffMetadata {
   if (!file.isPartial) return file;
 
   let splitLineStart = 0;
```

## apps/web/src/lib/previewAnnotation.ts

Status: modified; +1; −1

```diff
@@ -111,7 +111,7 @@
 }
 
 /** Upper bound on turning a picked element's crop into a composer attachment. */
-export const PREVIEW_ANNOTATION_CAPTURE_TIMEOUT_MS = 5_000;
+const PREVIEW_ANNOTATION_CAPTURE_TIMEOUT_MS = 5_000;
 
 export type PreviewAnnotationCapture =
   /** The crop is ready to attach. */
```

## apps/web/src/lib/storage.ts

Status: modified; +1; −1

```diff
@@ -26,7 +26,7 @@
   };
 }
 
-export function isStateStorage(
+function isStateStorage(
   storage: Partial<StateStorage> | null | undefined,
 ): storage is StateStorage {
   return (
```

## apps/web/src/lib/terminalContext.ts

Status: modified; +2; −5

```diff
@@ -65,7 +65,7 @@
   return contexts.filter((context) => hasTerminalContextText(context));
 }
 
-export function normalizeTerminalContextSelection(
+function normalizeTerminalContextSelection(
   selection: TerminalContextSelection,
 ): TerminalContextSelection | null {
   const text = normalizeTerminalContextText(selection.text);
@@ -85,10 +85,7 @@
   };
 }
 
-export function formatTerminalContextRange(selection: {
+function formatTerminalContextRange(selection: { lineStart: number; lineEnd: number }): string {
-  lineStart: number;
-  lineEnd: number;
-}): string {
   return selection.lineStart === selection.lineEnd
     ? `line ${selection.lineStart}`
     : `lines ${selection.lineStart}-${selection.lineEnd}`;
```

## apps/web/src/lib/windowControlsOverlay.ts

Status: modified; +1; −1

```diff
@@ -43,7 +43,7 @@
   };
 }
 
-export function getElectronPlatformClassNames(
+function getElectronPlatformClassNames(
   platform: string,
 ):
   | readonly [typeof ELECTRON_CLASS_NAME]
```

## apps/web/src/logicalProject.ts

Status: modified; +0; −1

```diff
@@ -4,7 +4,6 @@
   deriveLogicalProjectKeyFromSettings,
   derivePhysicalProjectKey,
   derivePhysicalProjectKeyFromPath,
-  deriveProjectGroupLabel,
   deriveProjectGroupingOverrideKey,
   getProjectOrderKey,
   resolveProjectGroupingMode,
```

## apps/web/src/portDiscoveryState.ts

Status: modified; +1; −1

```diff
@@ -43,7 +43,7 @@
   return bounded;
 }
 
-export function useDiscoveredPorts(
+function useDiscoveredPorts(
   environmentId: EnvironmentId | null,
   configuredUrls?: ReadonlyArray<string>,
 ): ReadonlyArray<DiscoveredLocalServer> {
```

## apps/web/src/projectIconOptions.ts

Status: modified; +1; −1

```diff
@@ -1,7 +1,7 @@
 import { iconNames, type IconName } from "lucide-react/dynamic";
 export { PROJECT_ICON_COLORS, projectIconColorClassName } from "./projectIconColors";
 
-export const POPULAR_PROJECT_ICONS = [
+const POPULAR_PROJECT_ICONS = [
   "folder-code",
   "code-2",
   "terminal",
```

## apps/web/src/reviewCommentContext.ts

Status: modified; +0; −6

```diff
@@ -180,12 +180,6 @@
   return segments;
 }
 
-export function hasReviewCommentMessageSegments(value: string): boolean {
-  return parseReviewCommentMessageSegments(value).some(
-    (segment) => segment.kind === "review-comment",
-  );
-}
-
 export function formatReviewCommentFence(language: string, contents: string): string {
   const longestBacktickRun = Math.max(
     0,
```

## apps/web/src/rightPanelStore.ts

Status: modified; +2; −2

```diff
@@ -14,7 +14,7 @@
 
 import { resolveStorage } from "./lib/storage";
 
-export const RIGHT_PANEL_KINDS = [
+const RIGHT_PANEL_KINDS = [
   "diff",
   "files",
   "file",
@@ -193,7 +193,7 @@
   return `pull-request:${scope}${encodeURIComponent(target.projectId)}:${encodeURIComponent(target.repository)}:${target.number}`;
 }
 
-export function pullRequestSurface(target: {
+function pullRequestSurface(target: {
   environmentId?: string;
   projectId: string;
   repository: string;
```

## apps/web/src/test/reactHookHarness.ts

Status: modified; +1; −1

```diff
@@ -34,7 +34,7 @@
  * Call `beginRender()` before each component invocation and `reset()` in
  * `beforeEach` to drop persisted state between tests.
  */
-export function createReactHookHarness() {
+function createReactHookHarness() {
   let cursor = 0;
   let slots: unknown[] = [];
   const nextIndex = () => cursor++;
```

[Next page](https://git.cafe/pingdotgg/t3code/pull/10227/diffs?after=ImFwcHMvd2ViL3NyYy90ZXN0L3JlYWN0SG9va0hhcm5lc3MudHMi&expectedVersion=2&format=markdown)
