Repository navigation
Conversation
Collaborator
Author
|
Closing after adversarial review (primary reviewer + independent verifier), judged against origin/main and the optimization criteria in discussion #27143. This is not a bug fix. It reintroduces the active-state toolbar UX that maintainers removed on purpose in #833/#834, and it adds crash risk by removing nested TooltipProviders for a component rendered from multiple roots. Close. |
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.
The rich Markdown toolbar currently renders every formatting button as inactive. Moving the caret into a heading, bold text or a list gives no formatting feedback, and assistive technologies cannot tell which toggle is pressed.
Subscribe within the toolbar to the existing editor-state selector and render the current block/mark/list flags through the existing active style and
aria-pressed. Link and image remain ordinary action buttons. The selector compares formatting values so ordinary text changes do not rerender the toolbar or require transaction renders of the parent editor.Evidence
The same hidden Electron editor, document and caret position before and after:
Before (caret in the heading, Heading 1 unmarked):
After (Heading 1 visibly active):
The DOM reports the identical HTML and text selection (
anchor:1, head:1); the baseline has no pressed state and the changed heading button reportsaria-pressed=true.Validation
Four real-editor tests fail on the baseline and pass with this change. Coverage includes caret transitions across headings and marks, toolbar Bold command, exact content, undo/redo, stored marks, list changes and nested quote/list state. A React Profiler verifies zero toolbar commits across four ordinary inserts plus unrelated transaction metadata, and one commit for a changed formatting flag. This measures React commits, not total editor CPU or native assistive-technology behavior.
ORCA_BACKGROUND_LAUNCH=1 pnpm test src/renderer/src/components/editor/RichMarkdownToolbar.test.tsx --maxWorkers=1Rendered proof was captured through Playwright CDP in the verified worktree app with
ORCA_BACKGROUND_LAUNCH=1, without native-window activation. Uses existing toolbar styles and the application tooltip provider. No host, protocol or workspace-kind changes; desktop platforms share the component. Mobile has its own formatting controls. The combined local checkout passed all 21 required checks withORCA_BACKGROUND_LAUNCH=1 pnpm check:changed --maxWorkers=2(73489de71f06). This includes formatting, lint, affected tests, typechecking and repository ratchets. Individual draft CI skips broad workflows; the result above is local combined validation. This PR remains draft for review.Integration coverage
The full-editor focus-leave fixture now supplies the app-root TooltipProvider, matching the documented mounting contract after removing the nested per-button providers. The repository launcher passes all seven toolbar/focus-leave tests independently on the pinned base; the combined seven-suite batch passes 60 tests.