fix(editor): render visible highlight + popover for Flag marks - #70
Open
vishalsachdev wants to merge 1 commit into
Open
fix(editor): render visible highlight + popover for Flag marks#70vishalsachdev wants to merge 1 commit into
vishalsachdev wants to merge 1 commit into
Conversation
Flag from the selection menu wrote a proofFlagged mark to the doc but createDecorations skipped 'flagged' entirely (case fell into the authored/approved continue), so flagging produced zero visual feedback even though STYLES.flagged already existed unused. Comment/Suggest were unaffected because their kinds are handled in the switch. - marks.ts: give 'flagged' its own decoration case (mark-flagged class, dusty-rose left border + tint) and a rose box-shadow-only glow for new flags so the forwards-filled green glow doesn't override the flag tint. - mark-popover.ts: clicking a flagged span now shows a 'Flagged by ...' card (note or quote) with Remove flag / Close, instead of an empty Suggestion card with dead Apply/Reject. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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.
Problem
Flagging a selection via the selection bar creates a
kind: 'flagged'mark (correctly anchored, saved, and counted by the heatmap gutter) but produces no visible feedback in the document — the decoration pass increateDecorationsexplicitly skips flagged marks:Meanwhile
STYLES.flagged(the dusty-rose treatment) is defined directly above but never used. From a user's perspective the only observable effect of clicking Flag is the document saving again. Clicking an (invisible) flagged range would also open an empty "Suggestion" popover whose Apply/Reject buttons are no-ops for flagged marks.Fix
src/editor/plugins/marks.ts— give'flagged'its own decoration case (mark-flaggedclass, wired to the existingSTYLES.flagged: 3px rose left border + pale rose background), plus a flag-specific new-mark glow keyframe (box-shadow only, mirroring delete's). Without the dedicated keyframe, the default green glow'sforwardsfill permanently overrides the rose tint on freshly created flags.src/editor/plugins/mark-popover.ts— add arenderFlag()card: "Flagged by {actor}", body shows the flag note (or quoted text), actions are Remove flag (viadeleteMark) and Close — replacing the broken empty suggestion popover.Notes
STYLES.flagged, just connected; the popover card follows the existing comment-card pattern.npm run buildclean; test suites pass at parity with baseline on our fork (no new failures). No decoration/DOM-level test harness existed to extend naturally — happy to add one if you can point at a preferred pattern.🤖 Generated with Claude Code
https://claude.ai/code/session_01Ro6KiE6zCSSzsqeyVoAu8M