Repository navigation
feat(web): add the comment card, opened from its passage when narrow - #306
Closed
pratikbuilds wants to merge 6 commits into
Closed
pratikbuilds wants to merge 6 commits into
pratikbuilds wants to merge 6 commits into
Conversation
pratikbuilds
force-pushed
the
document-comments-storybook
branch
from
November 19, 2026 10:06
f182ff2 to
a9d91d5
Compare
pratikbuilds
force-pushed
the
document-comments-storybook
branch
from
November 19, 2026 12:35
a9d91d5 to
e413f4b
Compare
Contributor
|
A comment's stage is defined twice here, with different names for the same four stages. The page has Whatever places these in the app will have to keep the two in step for every comment, so the underline and the card can disagree about the same comment. Could there be one stage type that both read? The card's four names already cover every case, so the page could take that type and pick its highlight from it, and the host would hold one value per comment. |
pratikbuilds
force-pushed
the
document-comments-storybook
branch
from
November 20, 2026 09:14
e413f4b to
5b51141
Compare
pratikbuilds
force-pushed
the
document-comments-storybook
branch
2 times, most recently
from
November 20, 2026 09:52
32a96b8 to
513fdb3
Compare
pratikbuilds
force-pushed
the
document-comments-storybook
branch
from
November 20, 2026 11:21
513fdb3 to
dea718d
Compare
This was referenced Nov 20, 2026
Closed
pratikbuilds
force-pushed
the
document-comments-storybook
branch
from
November 20, 2026 14:19
dea718d to
f30ecf0
Compare
A comment sits beside the passage it is about. Comments collect until the person sends them with their next message, then each card follows its own change: written, saved, being changed, changed in a version. A tick clears a changed comment once the person has seen it. Enter saves, Shift+Enter starts a new line and Escape cancels. An Enter that ends an input-method composition is left alone, including Safari's, which reports it with isComposing already false.
With no room for cards beside the page, the margin stays empty and a press on an underlined passage opens its card under the line, or above it where the view ends first. A hidden button per passage does the same from the keyboard; the card then takes focus, so Escape hands it back. Scrolling closes the card.
A comment is a draft in the browser until the person sends it, so the card has no state for a change being made or made, no version and no tick to clear it. The making and changed states go, with their wording, their status line and their stories.
A passage's comment is saved or being written; nothing on the page follows it once it is sent, so the grey dashed and green underlines go.
pratikbuilds
force-pushed
the
document-comments-storybook
branch
from
November 20, 2026 16:53
f30ecf0 to
234e614
Compare
This was referenced Nov 21, 2026
Contributor
Author
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.
Fourth of four stacked PRs. Base: #305.
Storybook only; nothing in the app renders comment cards yet.
What changed
CommentCard: a comment beside the passage it is about. Comments collect until the person sends their next message. Then each card follows its own change: written, saved, being changed, changed in a version. A tick clears it once seen. Enter saves, Shift+Enter starts a new line and Escape cancels. An Enter that ends an input-method composition is left alone, including Safari's.DocumentPage: when the margin is too narrow for cards, pressing an underlined passage opens its card under the line. Each passage has a button that only appears on keyboard focus and opens the card from the keyboard; the card then takes focus, and Escape hands it back. Scrolling closes it.Design
Figma: #306 · Comments, with this PR's boards and masters.
Screenshots
Comment card: writing, saved, saved with edit and delete, being changed, changed in a version, changed.
A narrow page, with a passage's card opened from its underline:
How it was verified
oxlint --deny-warnings, dependency boundaries, typecheck.bun --conditions=intx-src test apps/web/src/pages/workspace packages/plugin-ui plugins: 251 pass, includingcomment-card.test.tsfor the Enter/Escape/composition rules.