Repository navigation
feat: add a preview to the quote composer - #1029
Merged
Merged
Conversation
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
The commit and reply composers both have a preview (
⌘/Ctrl+Shift+P), but the quote composer didn't, so there was no way to check how code blocks, mentions or images would look before quoting. This PR adds the same preview to the quote dialog: an eye button next to the image picker swaps the textarea for the rendered draft. The shortcut works the same,Escgoes back to editing, and⌘/Ctrl+Entersubmits the quote, also while previewing.Changes
QuoteComposernow uses the shareduseComposerPreview,PreviewToggleandComposerPreviewBody, in the same way as the commit composer (preview stacked over the textarea in a grid, image thumbnails hidden while previewing). The preview shows the first link as the link card, since quotes can't pick another one.useComposerPreviewinQuoteDraft.test.tsx, which calls the composer outside React.KNOWLEDGE_BASE.md, which said the quote composer has no preview.Validation
test:types,test:lint(0 errors),test:unit(128/128): passtests/draft-images.config.ts, 353/353): passVisual evidence
No before image, since that should be quite obvious.
Quote writing (light)

Quote Preview (light)

Quote Writing (dark)

Quote Preview (dark)

Light also shows how a draft/stash appears.
And finally one with a URL (in light mode):

Device verification