Repository navigation
Make Markdown files readable: wrap toggle, width, links, images, and a Refresh that re-reads files - #120
Merged
Conversation
- The Wrap lines button now works on Markdown and other prose. Prose still starts wrapped, but a second stored switch (prose-wrap) lets the button unwrap it; the button sets both switches. - A repository's Files tab gets the same wide layout as a review's Browse tab instead of the list screens' 768px. - Links in the Markdown preview to other files of the repository open them in the app (Back returns), #heading links scroll, a folder link opens its README, and links in a review's diff preview open the file in Browse files. - HTML <img> and <a href> tags, which READMEs use for every picture, are read into ordinary images and links instead of showing up as literal tags. Root-relative /paths resolve from the repository root, and a numeric width is honoured. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
After a new commit, Refresh on Files changed brought back a new diff but left every file's text and image in the cache as it was, so a Markdown preview compared the new diff against old text. The repository Files tab's Refresh had the same gap for the open file. Each review and repository now has a read generation that is part of its file and image cache keys. Refresh bumps it once the new diff (or file list) has arrived. Files on screen are read again and keep showing the previous answer until the new one lands; files opened later read fresh. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
michal-wrzosek
marked this pull request as ready for review
October 14, 2026 09:18
Merged
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.
Four fixes to reading Markdown files in GitWarren.
What changed
Wrap lines works on Markdown. Prose files were always wrapped no matter what the button said, so the button did nothing on them. Prose still starts wrapped, but a second stored switch (
prose-wrap, default on) sits beside the existingdiff-wrap, and the button sets both. On Browse files and the repository's Files tab the button shows and flips the open file's state. In Files changed it shows the code switch. Anyone who has already saveddiff-wrapsees no difference until they press the button. (lib/line-wrap.ts)The repository's Files tab is wide. It was capped at
max-w-3xl(768px) like the list screens. It now gets the samemax-w-[110rem]as a review's Browse files tab, because it shows the same tree and the same file card. (App.tsx)Links to local files work in the preview.
[x](docs/guide.md)opens that file in the app. The move goes into history, so Back returns to the page the link was on.#headingscrolls the document, andother.md#headingopens the other file and lands on that heading. Headings get GitHub-style ids.docs/) opens the folder's README.Images draw. The main cause: READMEs, including ours, draw every picture with HTML
<img>tags, often inside<a href>. Raw HTML is never rendered here, so react-markdown showed those tags as literal text. A remark plugin now reads<img>(onlysrc,altand a pixelwidth) and<a href>into ordinary Markdown images and links. No HTML is rendered, and both still go through the existingimg/aoverrides, so only repository files are drawn and anything remote stays a link. Root-relative/assets/x.pngnow resolves from the repository root, as it does on GitHub. (remark-document.ts,document-links.ts)Screenshots
GitWarren's own README in a repository's Files tab: full width, and the logo (at its
width="112") and screenshot draw. Before this change they showed as literal<img …>text:A Markdown source view with Wrap lines on (the default for prose):
…and with Wrap lines off, which used to be impossible:
After clicking
docs/guide.mdin a review's diff preview: Browse files opens with the guide, and its../and sibling images draw:Phone (390×844, touch emulated). The README preview with an HTML
<img>drawn, and nothing scrolls sideways:…and after tapping the Guide link:
How it was checked
npm run typecheck,eslint .andnpm testall pass (774 tests, 0 failures). 14 of them are new, indocument-links.test.ts../,../and/root.#far-sectionscrolls,docs/guide.md#costs-and-budgetopens and lands on the heading, Back returns, anddocs/opensdocs/README.md.Refresh re-reads the files too
Found while testing this. On Files changed, Refresh re-read only the diff. Each file's text (behind the expanders and the Markdown preview) and each image stayed cached, so after a new commit the preview compared the new diff against old text. The repository Files tab's Refresh had the same gap: it re-read the file list but not the open file.
Each review and repository now has a read generation that is part of its file and image cache keys. Refresh bumps it once the new diff (or list) has arrived, so a preview never pairs a new file with an old diff. Files on screen are read again and keep showing their previous content until the new read lands, so nothing flashes. Files opened later read fresh. (
use-reviews.ts)Checked in the app:
🤖 Generated with Claude Code