Skip to content

feat: view images in place, star and save from the keyboard, and show media in quotes - #224

Closed
twosox-x wants to merge 1 commit into
dev-null-sh:productionfrom
twosox-x:feat/composer-image-preview-and-shortcuts
Closed

twosox-x wants to merge 1 commit into
dev-null-sh:productionfrom
twosox-x:feat/composer-image-preview-and-shortcuts

Conversation

@twosox-x

Copy link
Copy Markdown

Summary

Quality-of-life improvements around images and the keyboard.

View images in place

  • Composer preview: tap an attached thumbnail before committing to see it full size, with the file name, size and dimensions. Images can be removed from inside the viewer. This works in the commit, reply and quote composers.
  • Posted images now open in the same viewer instead of a new tab. Cmd/Ctrl/middle-click still open the image in a new tab.
  • The viewer dims the page instead of reflowing it and goes edge-to-edge on phones. It supports ←/→ keys, arrow buttons, swipe, Esc, and clicking beside the image to close. Motion is disabled under prefers-reduced-motion.
  • It's one shared component (image-viewer.tsx), mounted once in app.tsx and opened with viewImages(), so CommitImages stays hook-free.

Keyboard

  • s stars and b saves the focused commit (j/k), using the existing aria-keyshortcuts dispatch. Both are listed in the ? dialog and shown in the buttons' titles.

Scroll to top

  • Clicking Log while already on a log scrolls back to the top, and loads waiting new commits first when there are any. Modifier-clicks still behave like normal links.

Media in quote embeds

  • A quote of a commit with images shows its first image as a side thumbnail under a gradient, with a +N count for the rest, so the full image is still a click away on the original. Text-only quotes are unchanged.
  • withQuotedCommitFor() and the moderation queue eager-load images on quoted commits, with no extra query per commit (covered by the existing N+1 test). Deleted quoted commits still serialize as tombstones with no images.

Notes

Testing

  • New feature test: quoted commits include their images; deleted ones don't.
  • New tests/Unit/CommitImagePicker.test.tsx covering the preview and remove controls.
  • Lint, PHPStan, TypeScript and 100% type coverage pass. Pest passes except tests that already fail on production: CommitRestorationControllerTest still uses the renamed Log::Everyone, and DatabaseTest needs Postgres.
  • Checked by hand at 1440×900 and 390×844: the viewer, swipe, remove, Esc, the quote thumbnail, the s/b shortcuts and Log scroll-to-top. Layout shift was ≈0.

🤖 Generated with Claude Code

…how media in quotes

- Images open in an in-app viewer instead of a new tab: attached images in the
  composer (with Remove) and posted images in the log. Arrows, ←/→, swipe, Esc.
- `s` stars and `b` saves the focused commit, listed in the `?` dialog.
- Clicking Log while on the log scrolls to the top and loads new commits.
- Quote embeds show the quoted commit's first image as a side thumbnail under a
  gradient, with a +N count for the rest.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

Copy link
Copy Markdown
Member

Closing as superseded: every part of this has since landed or is tracked elsewhere. Composer image previews shipped in #945, posted images open in the photo viewer from #144, quoted commits render their images (quoted-commit.tsx), saving/bookmarks were merged into stars by #811, and the star shortcut is canonical in open #597. Thanks for the work here!

@nunomaduro nunomaduro closed this Oct 27, 2026
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.

2 participants