Repository navigation
fix: the mode button switches modes while reading and keeps the text in place - #517
Merged
Merged
Conversation
…in place In reading mode a tap on the mode button now switches between rendered and plain text and stays in reading mode, with no focus and no keyboard, reversing the earlier rule that it only brought editing back. In edit mode it still switches without taking focus from the editor. The switch no longer scrolls: the first line starting at the top of the visible area (the caret's line while editing) stays where it was on screen. Without this the text jumped by the height change above it.
The mode button is now a plain two-state toggle between rendered and plain text. Its icon shows the current format in reading and edit mode alike: the markdown mark when rendered, the code icon in plain-text mode. The open-book icon for reading mode is gone; reading vs. edit mode is no longer shown on this button.
ScottKirvan
force-pushed
the
fix/mode-button-keeps-reading-mode
branch
from
October 16, 2026 16:06
0c5b615 to
08b1e08
Compare
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.
Description
Scott's report: in reading mode, the markdown/plain-text button switched to edit mode. The intent is to see what you're reading in the other format, not to start editing. Switching also shouldn't scroll the page.
This replaces the rule from #484 ("while reading, a tap only brings editing back"), which came from a misreading of Scott's earlier request.
Now:
mousedownhandling stays).Code:
main.ts: the click handler always switches, and refocuses the editor only in edit mode.editMode.ts:modeToggleActionis replaced bymodeToggleLabel, so the button's label names the mode a tap switches to. "Start editing" is gone.scrollAnchor.ts:keepVisibleTextInPlaceadds a scroll effect to the same dispatch as the switch.Spec (BEHAVIOR_SPEC §4) and both user-guide pages are updated. Judgment call (
[Proposed — unconfirmed]): the text kept in place is the first line starting at or below the top of the visible area. In edit mode it's the cursor's line, if the cursor is on screen.Type of Change
On-device testing
How Has This Been Tested?
modeToggle.e2e.tsupdated. The new reading-mode check failed onmain("a tap while reading must switch to plain text"). The scroll check, on a long QuKi with headings, images, lists, tables and quotes, in both directions, near the top, middle and end, in reading and edit mode, failed without the fix (a 174px jump) and passes with it. All 4 scenarios pass.editMode.test.ts17/17;npx tsc -bclean.Checklist