Skip to content

feat(media): add generated images, sources and MediaViewer - #13

Closed
pratikbuilds wants to merge 1 commit into
conversation/10-attachmentsfrom
conversation/11-media
Closed

pratikbuilds wants to merge 1 commit into
conversation/10-attachmentsfrom
conversation/11-media

Conversation

@pratikbuilds

Copy link
Copy Markdown
Owner

GeneratedImages holds each tile at its final size under the dither grain while it generates, with the elapsed time beside the label. An image made while watched is revealed by the grain; one already there loads plainly; a failed one shows a message and a retry. The grain reads its colours from existing tokens and draws one still frame under reduced motion. Sources lists citations, and MediaViewer shows images on the native dialog with arrow keys between items and focus returned to the opener. Media addresses from agent data are checked before use.

Stacked on #12: review only this commit. Part of corbitsdev#94.

Notes for review

  • Grain colours: ground --muted, field --foreground, band --primary (read via getComputedStyle, like DitherCanvas); no new token. Reduced motion draws one still frame and skips the reveal; off screen it stops drawing.
  • Every image/frame/download/link address from agent data passes safeMediaSrc (PDF frames: http, https, blob only); source links use toSafeHref.
  • MediaViewer takes useMediaViewer's result as viewer; focus returns to the element passed to viewer.open(index, opener). Backdrop is bg-background/90 (no literal scrim colour).
  • BAYER_4 duplicates DitherCanvas's private matrix (existing module left untouched); follow-up: have DitherCanvas import it.
  • The elapsed counter restarts on remount: PartImage carries no start time.

Verification

  • This commit passes bun run typecheck and bun run lint on its own (the stack is checked commit by commit).
  • At the top of the stack: bun run check, bun run build, bun run dep-guard, bun run contrast-test and bun run test:e2e (Playwright specs and the Storybook axe sweep in light and dark) pass.

Closes corbitsdev#105

GeneratedImages holds each tile at its final size under the dither
grain while it generates, with the elapsed time beside the label. An
image made while watched is revealed by the grain; one already there
loads plainly; a failed one shows a message and a retry. The grain reads
its colours from existing tokens and draws one still frame under reduced
motion. Sources lists citations, and MediaViewer shows images on the
native dialog with arrow keys between items and focus returned to the
opener. Media addresses from agent data are checked before use.
@pratikbuilds

Copy link
Copy Markdown
Owner Author

Moved upstream: corbitsdev#125

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