refactor: delete orphan declarations flagged by fallow (#949)

* ci: run fallow audit in lefthook pre-commit

Mirrors the same `fallow audit --base ... --fail-on-issues` check that
runs in CI, but locally against HEAD so issues surface at commit time
instead of after the push round-trip.

Scoped to `packages/**` source files via the glob — non-code edits
(README, docs, top-level configs) skip the hook entirely.

Measured locally: ~5s in parallel with the existing lint/format/typecheck
checks. Doesn't extend wall-clock time because typecheck (~11s) is the
long pole, and lefthook runs commands in parallel.

The default `--gate new-only` means inherited findings don't block the
commit — same gate behavior as CI, so local pre-commit and PR audit
agree.

* refactor: delete orphan declarations flagged by fallow

After fallow's auto-fix de-exports unused symbols, oxlint surfaces them
as no-unused-vars. This PR deletes those orphan declarations outright.

Biggest cleanup: studio/src/icons/SystemIcons.tsx shrinks from 132 to 57
lines — 33 unused icon wrappers and their phosphor-icon imports deleted.

Other deletions across 14 more files covering paired getter/setters,
helper functions, dead env constants, internal components with no
callers, and cascading unused imports.

Cascade-causing files held back for follow-up PRs: renderOrchestrator
barrel of captureCost re-exports, telemetry/portUtils/remote barrels,
Button.tsx + ui/index.ts (would orphan whole file), studioMotion
type re-exports.

Test plan: typecheck clean across 8 packages, oxlint + oxfmt clean,
fallow audit exit 0 (remaining findings inherited), cli + studio
vitest suites pass.
This commit is contained in:
James Russo
2026-05-18 21:11:03 -07:00
committed by GitHub
parent b6b7bcb51a
commit 2729ee5087
16 changed files with 9 additions and 453 deletions
@@ -158,46 +158,6 @@ export async function initHdrReadback(page: Page, width: number, height: number)
// ── HDR frame conversion ──────────────────────────────────────────────────────
/**
* Convert raw rgba64le pixels (from FFmpeg) to a base64 string for FFmpeg encoding.
*
* For HLG sources: the pixel values are already HLG-encoded. We pass them through
* as-is (normalized to 16-bit) and tag the output as HLG. No OETF conversion needed —
* the HLG signal values ARE the correct encoding. Converting to linear and back to
* PQ produces worse results because every viewer's PQ→display tone-mapping differs
* from its HLG→display tone-mapping.
*
* The WebGPU round-trip is skipped for pass-through — the pixels go directly from
* FFmpeg extraction to FFmpeg encoding. WebGPU is only needed when transforms
* (scale, rotate, opacity from GSAP) must be applied to the HDR pixels.
*/
export function convertHdrFrameToRgb48le(
rawRgba64le: Buffer,
width: number,
height: number,
): Buffer {
const input = new Uint16Array(
rawRgba64le.buffer,
rawRgba64le.byteOffset,
rawRgba64le.byteLength / 2,
);
// Convert RGBA → RGB (drop alpha) for rgb48le output
const output = Buffer.alloc(width * height * 6);
for (let y = 0; y < height; y++) {
for (let x = 0; x < width; x++) {
const srcIdx = (y * width + x) * 4;
const dstIdx = (y * width + x) * 6;
output.writeUInt16LE(input[srcIdx] ?? 0, dstIdx);
output.writeUInt16LE(input[srcIdx + 1] ?? 0, dstIdx + 2);
output.writeUInt16LE(input[srcIdx + 2] ?? 0, dstIdx + 4);
}
}
return output;
}
// ── Frame upload + readback ───────────────────────────────────────────────────
/**