Skip to content

fix(web): keep the source pane within ES2022 - #257

Merged
kinqsradio merged 1 commit into
feat/web-rebuildfrom
fix/web-es2022-findlast
Nov 3, 2026
Merged

kinqsradio merged 1 commit into
feat/web-rebuildfrom
fix/web-es2022-findlast

Conversation

@kinqsradio

Copy link
Copy Markdown
Member

See CONTRIBUTING before starting engineering work.

Change

The Markdown source pane in web/src/screens/library/page/Source.tsx used Array.findLast, which is not in the web package's ES2022 lib. With a web-only install, tsc --noEmit fails on the call, so the web package's stock build fails.

Replace it with a backward scan over the existing blocks, keeping the existing blocks[0] fallback and selecting the same line range. No tsconfig, lib, dependency or compiler-config change is included.

The failing command was the web package build, npm run build -w web (which runs tsc --noEmit && vite build). The repository root npm run build does not include the web workspace.

Checks and limits

Run from the fix/web-es2022-findlast worktree at 5a332e21:

  • npm run typecheck -w web - pass.
  • npm run build -w web - pass; tsc --noEmit and the Vite bundle complete.
  • npx --yes prettier --check web/src/screens/library/page/Source.tsx - pass.
  • git diff --check - pass.
  • rg findLast web/src - no matches.
  • A standalone comparison of the old and new selection - matched for lines before the first block, between blocks, on every boundary and after the last block.

Limits:

  • No browser-rendered check; this is a mechanical range lookup in the scroll handler.
  • No unit test added. The web package has no test script, and this change was not requested with tests.
  • A web-only install was the configuration that exposed the original type error. A full workspace install can mask it through transitive esnext declarations; the committed code no longer relies on those declarations.

Workspace

  • Used the outer Orbyn Engineering workspace with this target nested under repo/, and read the relevant project guides.

This contributor confirmation is not an automated claim that a host loaded policies.

Agent disclosure

  • Tools: Freebuff Desktop coding agent, terminal, git, gh, npm, npx (Prettier), TypeScript and Vite.
  • Models: host-selected model; the exact identifier was not exposed to the session and was not guessed. No model override was requested.
  • Effort: host default; the exact setting was not separately exposed.
  • Human role: requested this fix and the pull request; no human code edits.
  • External sources: none. The change is original and copies no external code.

The Markdown source pane used Array.findLast, which is outside the web package ES2022 lib. A web-only install therefore fails typecheck and the stock build. Scan backwards from the existing blocks[0] fallback instead, with the same line-range behavior and no compiler config change.
@kinqsradio
kinqsradio merged commit 5a9aa0f into feat/web-rebuild Nov 3, 2026
7 checks passed
@kinqsradio
kinqsradio deleted the fix/web-es2022-findlast branch November 7, 2026 04:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant