Skip to content

Show discussion avatars in the page margin - #291

Draft
cwillia9 wants to merge 2 commits into
mainfrom
coltonw/more-visible-comments
Draft

cwillia9 wants to merge 2 commits into
mainfrom
coltonw/more-visible-comments

Conversation

@cwillia9

Copy link
Copy Markdown
Collaborator

What changed and why

Open discussions were easy to miss. The only sign of a comment was a faint highlight in the text, and you had to click it to learn who said what.

Now each open discussion also shows the first commenter's avatar in the page margin, to the right of the document card, on the line it refers to.

  • Clicking an avatar opens the same discussion window as clicking the highlight. The avatar gets a blue ring while its discussion is open.
  • Hovering an avatar highlights its text. Hovering the text highlights its avatar. The avatar grows slightly while highlighted.
  • Avatars on the same line stack instead of overlapping.
  • Avatars update live when comments arrive. Resolved discussions stay hidden until you press s.
  • The markers sit outside the document card, so the text column keeps its full width. They hide when the window leaves no room in the margin, below about 1200px. Phones are unchanged.
  • Table-cell and diagram comments keep their existing badges and get no margin avatar.

The new coplan--comment-margin controller reads the highlights that coplan--text-selection already builds, plus the thread popovers in #plan-threads. It needs no new server data. A one-line change in text_selection_controller.js keeps a discussion opened from an avatar beside that avatar when highlights rebuild.

Evidence

Light theme, default: the avatar sits in the margin beside its highlighted text.

Light theme: avatar marker in the page margin beside its highlight

Light theme, hovering the highlighted text: the avatar grows and gets a ring.

Light theme: hovering the text highlights its avatar

Several discussions close together stack in the margin.

Light theme: stacked avatar markers

Dark theme, with a discussion opened from its avatar.

Dark theme: open discussion beside its ringed avatar

How to try it

  1. Run bin/setup --skip-server, then bin/dev.
  2. Sign in as hampton@example.com with a window at least 1280px wide.
  3. Open "Search latency: cutting p95 with a two-tier cache". It has four open discussions.
  4. Expect avatars in the grey margin beside the highlighted text. Hover one, then hover its highlighted text. Click an avatar to open its discussion.
  5. Narrow the window below about 1200px. The avatars disappear and the page looks as it did before.

Testing

  • bundle exec rspec spec/system/comment_ux_spec.rb: a new spec covers marker placement outside the document, alignment with each line, hidden resolved threads, hover in both directions, and opening a discussion.

  • bundle exec rspec: 3054 examples, 0 failures.

  • Checked by hand in the browser in light and dark themes at 1280, 1440, and 1680px.

  • Added or updated real JavaScript-enabled browser specs in spec/system/ for changed UI behavior, covering the user interaction and visible result; or explained why no browser UI is involved.

  • Added model, service, or request specs where needed for domain behavior, authorization, or API cases. (Not needed: client-side only.)

  • Ran bundle exec rspec, or explained why it could not run and listed the specs that did run.

  • Tested affected UI behavior in both light and dark themes, or explained why theme testing does not apply.

  • Attached a video or images demonstrating the change, if this PR adds or changes a feature or fixes a UI bug.

Generated with Amp

cwillia9 and others added 2 commits October 30, 2026 15:36
Open comment threads were only visible as faint highlights in the text.
Each one now gets the first commenter's avatar in the page margin beside
the document, aligned with its line. Clicking the avatar opens the
discussion, and hovering the avatar or its text highlights both.

The markers sit outside the document card, so the text keeps its width.
They hide when the window leaves no room in the margin.

Co-authored-by: Amp <amp@ampcode.com>
Amp-Thread-ID: https://ampcode.com/threads/T-01a18e32-b8a4-7319-95b9-7279b536d0f1
ubuntu-latest now resolves to Ubuntu 26.04, where ruby/setup-ruby has
no Ruby 3.4.7 build, so the lint job failed before RuboCop ran.

Co-authored-by: Amp <amp@ampcode.com>
Amp-Thread-ID: https://ampcode.com/threads/T-01a18e32-b8a4-7319-95b9-7279b536d0f1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant