diff options
| author | Shoubhit Dash <[email protected]> | 2026-04-16 17:30:14 +0530 |
|---|---|---|
| committer | Shoubhit Dash <[email protected]> | 2026-04-16 17:30:14 +0530 |
| commit | 2e18a603f0ea24154908e748493fd4bfaa74fc00 (patch) | |
| tree | b723e00af2821b213573b16fa199b64babd5f1f5 /packages/ui/src/components/file.tsx | |
| parent | 9819eb04614fd607cacb07d754052f1531a82331 (diff) | |
| parent | 7341718f9234b0cf3a8758c87e91d2006b71bff6 (diff) | |
| download | opencode-2e18a603f0ea24154908e748493fd4bfaa74fc00.tar.gz opencode-2e18a603f0ea24154908e748493fd4bfaa74fc00.zip | |
merge dev
Diffstat (limited to 'packages/ui/src/components/file.tsx')
| -rw-r--r-- | packages/ui/src/components/file.tsx | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/packages/ui/src/components/file.tsx b/packages/ui/src/components/file.tsx index b78f0bae4..633b23b70 100644 --- a/packages/ui/src/components/file.tsx +++ b/packages/ui/src/components/file.tsx @@ -1,4 +1,4 @@ -import { sampledChecksum } from "@opencode-ai/util/encode" +import { sampledChecksum } from "@opencode-ai/shared/util/encode" import { DEFAULT_VIRTUAL_FILE_METRICS, type DiffLineAnnotation, @@ -655,7 +655,7 @@ function ViewerShell(props: { style={styleVariables} class="relative outline-none" classList={{ - ...(props.classList || {}), + ...props.classList, [props.class ?? ""]: !!props.class, }} ref={(el) => (props.viewer.wrapper = el)} @@ -698,6 +698,7 @@ function TextViewer<T>(props: TextFileProps<T>) { if (typeof value === "string") return value if (Array.isArray(value)) return value.join("\n") if (value == null) return "" + // oxlint-disable-next-line no-base-to-string -- file contents cast to unknown, coercion is intentional return String(value) } @@ -712,11 +713,13 @@ function TextViewer<T>(props: TextFileProps<T>) { if (typeof value === "string") return value.length if (Array.isArray(value)) { return value.reduce( + // oxlint-disable-next-line no-base-to-string -- array parts coerced intentionally (sum, part) => sum + (typeof part === "string" ? part.length + 1 : String(part).length + 1), 0, ) } if (value == null) return 0 + // oxlint-disable-next-line no-base-to-string -- file contents cast to unknown, coercion is intentional return String(value).length }) |
