Skip to content

Improve accessibility and UX with keyboard support and better file previews#5

Merged
pibulus merged 3 commits into
mainfrom
claude/code-review-app-DqlKy
Mar 17, 2026
Merged

Improve accessibility and UX with keyboard support and better file previews#5
pibulus merged 3 commits into
mainfrom
claude/code-review-app-DqlKy

Conversation

@pibulus
Copy link
Copy Markdown
Owner

@pibulus pibulus commented Mar 17, 2026

Summary

This PR enhances accessibility and user experience by adding keyboard navigation support to interactive elements, improving file preview displays, and updating production URLs to use the Deno Deploy domain.

Key Changes

Accessibility Improvements

  • Keyboard Navigation: Added keyboard support (Enter/Space keys) to QR code and bucket URL elements
    • BucketQR.tsx: QR code canvas now responds to keyboard input with proper role, tabIndex, and aria-label attributes
    • QRCanvas.tsx: Download button supports keyboard activation
  • ARIA Labels: Added descriptive labels for screen readers on interactive elements

File Preview & Display Enhancements

  • Unified File Info Card (BucketQR.tsx): Replaced separate image/audio/video preview components with a single file info card that:
    • Shows contextual emoji based on file type (🖼️ for images, 🎵 for audio, 🎬 for video, etc.)
    • Displays file size in MB
    • Shows MIME type information
    • Removes potentially problematic embedded previews while maintaining file information
  • FileSlideshow.tsx: Enhanced placeholder display with:
    • Type-specific emoji (🖼️, 🎬, 🎵, 📦)
    • File name and size information
    • Dynamic download button text based on file type

Code Organization

  • BucketQR.tsx: Extracted URL copy logic into handleCopyUrl() function for reusability and cleaner code

URL Configuration Updates

  • Updated production URLs from https://qrbuddy.app to https://qrbuddy.deno.dev across:
    • supabase/functions/_shared/cors.ts
    • supabase/functions/create-bucket/index.ts
    • supabase/functions/create-dynamic-qr/index.ts
    • supabase/functions/upload-file/index.ts
    • routes/bucket/[code].tsx
    • routes/f/[code].tsx
  • Added support for APP_URL environment variable for flexible deployment configuration

Documentation

  • Updated CLAUDE.md to reflect 50MB file size limit (already implemented in code)

Implementation Details

  • Keyboard handlers use standard event checking (e.key === "Enter" || e.key === " ")
  • File type detection uses MIME type string matching for emoji selection
  • File size formatting uses MB with 2 decimal places for readability
  • All changes maintain existing styling and visual hierarchy

https://claude.ai/code/session_01UPmVAFb2KTRv9LoN5cxr8m

claude added 3 commits March 12, 2026 09:21
- BucketQR: Replace inline media previews (img/audio/video) that used
  the destructive download-from-bucket endpoint with a safe file info
  card. Previously, just rendering the page would claim and delete the
  bucket contents before the user could click download.

- FileSlideshow: Make download button text dynamic based on file type
  (Image/Video/Audio/File) instead of always saying "Download Image".
  Show filename, size, and MIME type in the non-preview fallback state
  instead of generic "Preview not available".

- CORS: Fix production origin from qrbuddy.app (DNS pending) to
  qrbuddy.deno.dev so client-side Supabase edge function calls aren't
  blocked. Added APP_URL env var support for easy domain migration.

- URLs: Update all hardcoded qrbuddy.app fallback URLs in edge
  functions (upload-file, create-bucket, create-dynamic-qr) and bucket
  route to use qrbuddy.deno.dev, matching the actual live deployment.

https://claude.ai/code/session_01UPmVAFb2KTRv9LoN5cxr8m
The get-file-metadata edge function returns the theme field but the
FileData interface in the route was missing it, so it was silently
dropped. FileSlideshow already accepts theme as a prop and defaults
to "sunset" - now it will use the actual theme the user chose.

https://claude.ai/code/session_01UPmVAFb2KTRv9LoN5cxr8m
…R components

- Fix file-validation.ts: constant is 50MB but docs/error message said 25MB — aligned all to 50MB
- Add role="button", tabIndex, aria-label, and keyboard handlers to QRCanvas clickable div
- Add same accessibility attributes to BucketQR clickable div, extract copy logic to shared handler
- Update CLAUDE.md security section to reflect correct 50MB limit

https://claude.ai/code/session_01UPmVAFb2KTRv9LoN5cxr8m
@pibulus pibulus merged commit c599e85 into main Mar 17, 2026
1 check passed
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