feat(web): add word wrap to file source previews - #1754
Open
techotaku39 wants to merge 1 commit into
Open
Conversation
There was a problem hiding this comment.
Findings
- None.
Summary
Review mode: initial. No Blocker, Major, Minor, or Nit issues found in the added/modified lines. The source preview uses the existing shared wrap preference, retains the unwrapped horizontal-scroll path, and keeps the syntax-highlighted content inside the styled pre element. Residual testing risk: the added unit test mocks the Shiki renderer and cannot validate real highlighted DOM or narrow-viewport overflow geometry.
Testing
- Not run (automation); static review only.
- GitHub checks at review time: integration passed; test pending.
HAPI Bot
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
hapi-code-wrappreference used by conversation detail code surfaces.Problem / Motivation
Source-mode file previews currently render long lines using horizontal scrolling and do not expose the existing word-wrap control. This makes large files difficult to read on narrow screens and makes file previews inconsistent with conversation detail code blocks.
Validation
bun typecheck— passed.bun run --cwd web test -- src/routes/sessions/file.test.tsx src/components/CodeBlock.test.tsx src/components/assistant-ui/shiki-highlighter.test.tsx src/components/assistant-ui/markdown-text-codeblock.test.tsx src/hooks/useCodeWrap.test.ts— 5 files, 32 tests passed.pwsh -NoProfile -File .\scripts\Invoke-HapiTaskPlaywright.ps1 -Name file-preview-code-wrap -Suite Root -TestArgs terminal-wrap-fidelity.spec.ts— 2/2 passed.bun run build— passed.git diff --check— passed.Related Issues
Refs #1074
AI Disclosure
OpenAI Codex assisted with the implementation and validation. Model: GPT-5.6.