Skip to content

UX revamp: image-gallery + rag-document-qa-svelte#1681

Closed
IEvangelist wants to merge 4 commits into
mainfrom
ievangelist/ux-revamp-gallery-and-rag
Closed

UX revamp: image-gallery + rag-document-qa-svelte#1681
IEvangelist wants to merge 4 commits into
mainfrom
ievangelist/ux-revamp-gallery-and-rag

Conversation

@IEvangelist
Copy link
Copy Markdown
Member

What

Part of the coordinated effort to give every Aspire sample frontend a distinct, accessible, secure identity (they all shared the same purple gradient). This PR revamps two samples, each with its own CSS approach and icon pack:

1. samples/image-gallery — "Lumina" bright media-library SaaS

  • Light, airy productized media manager (CSS Modules + Heroicons) — deliberately the opposite of a dark photo gallery.
  • React 19 + TS, Vite build still embedded in the backend wwwroot via PublishWithContainerFiles (verified npm run build output lands in the API target).
  • Preserves all functionality and security: antiforgery/XSRF token flow, upload validation, XHR upload progress, thumbnail polling, lightbox (with focus trap + Escape). alert() replaced by an inline aria-live error banner.

2. samples/rag-document-qa-svelte — "Athenaeum" scholarly reading room

  • Refined dark academic reading-room (Svelte 5 scoped styles + custom tokens, Phosphor icons): warm ink + brass, serif headings, solid/opaque text surfaces so contrast holds. Calm light "daytime" counterpart included.
  • Preserves the /documents, /upload (.txt validation, drag/drop), and /ask flows verbatim.

Accessibility

Both apps validated with axe-core 4.11.3 (wcag2a/2aa/21a/21aa/22aa + color-contrast-enhanced) in light and dark:

  • Zero AA violations and zero AAA enhanced-contrast issues in both themes for both apps.
  • Semantic landmarks, skip link, visible focus, keyboard-operable controls, labelled inputs, aria-live regions, honors prefers-reduced-motion + prefers-color-scheme.
  • Inline SVG favicon (no /favicon.ico 404); zero console errors during driven flows.

Validation

  • Each app run via aspire run; all resources reported Healthy (image-gallery; rag = Qdrant + FastAPI + Vite).
  • Every flow driven with Playwright (image-gallery: upload→poll→lightbox→delete; rag: catalogue, ask→answer→citations).
  • New deterministic 2880×2048 light + dark screenshots; READMEs use GitHub theme-switch markup (#gh-light-mode-only / #gh-dark-mode-only).
  • Branding uses "Aspire" (never ".NET Aspire"). Latest deps pinned (tailwind n/a here; React 19.2, Vite 8, Svelte 5, Heroicons 2, Phosphor 3, @axe-core/playwright 4.11.3).

Credential-gated note (rag-document-qa-svelte)

OpenAI credentials were not available, so real embeddings/answers are not validated. Against the live backend I verified the empty catalogue state and the real upload error-state (backend returns 401/500 without a valid key, surfaced as the error banner). The populated catalogue / answer / citation screenshots use stubbed /documents, /upload, and /ask responses (Playwright route interception) to depict a representative populated reading room. No secrets are committed.

Notes

  • Per-app commits, each with the Co-authored-by: Copilot trailer.
  • Endpoints in tests/SamplesIntegrationTests/AppHostTests.cs (/, /health, /alive) are unaffected; routing unchanged.

Opening as draft for review.

IEvangelist and others added 4 commits June 6, 2026 11:01
Replace the generic purple-gradient React UI with "Lumina", a bright,
productized media-library identity for the image-gallery frontend.

- CSS Modules + design tokens with light/dark themes (honors
  prefers-color-scheme, persisted theme toggle, no-flash inline script).
- Heroicons icon set; airy aqua/slate palette, productized app shell,
  card grid, status badges and a keyboard-operable lightbox.
- Accessibility: skip link, landmarks, labelled controls, visible focus,
  aria-live status, reduced-motion support, inline SVG favicon. WCAG 2.2
  AA verified with zero violations and zero AAA color-contrast issues in
  both themes (axe-core 4.11.3), zero console errors.
- Preserve every flow and security control: XSRF antiforgery token on
  upload/delete, image validation, 3s thumbnail polling, drag-and-drop.
- Pin latest deps (react 19.2, vite 8, @heroicons/react 2.2); add
  vite-env.d.ts for CSS module typings. Verified npm run build.
- Add light + dark screenshots and README theme-switch markup.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Give the RAG Document Q&A Svelte sample a distinct scholarly identity: a
dark academic reading-room (warm ink + brass, serif headings, opaque
panels) with a calm light "daytime" counterpart, replacing the generic
purple-gradient look.

- Svelte 5 scoped styles + custom design tokens (app.css); Phosphor icons
  (phosphor-svelte deep imports, tree-shaken).
- Accessibility: skip link, landmarks, labelled controls, aria-live
  regions, role=alert errors, visible focus, honors prefers-reduced-motion
  and prefers-color-scheme. axe-core (wcag2a/2aa/21a/21aa/22aa) passes with
  zero AA violations and zero AAA enhanced-contrast issues in light + dark.
- Inline SVG favicon (no /favicon.ico 404); no-flash theme bootstrap
  defaulting to the dark reading room.
- Branding uses "Aspire" (not ".NET Aspire").
- Preserves all functionality: /documents, /upload (.txt validation,
  drag/drop), /ask flow and fetch logic unchanged; converted alert() to an
  inline aria-live error banner.
- Pinned latest deps (svelte 5, vite 8, phosphor-svelte 3).
- New deterministic 2880x2048 light + dark screenshots; README uses
  GitHub theme-switch image markup.

Validated locally via Aspire (Qdrant + FastAPI + Vite) with Playwright:
empty-state and real upload error-state (credential-gated) exercised
against the live backend; the populated catalogue/answer/citations
screenshots use stubbed responses because OpenAI credentials are not
available, so real embeddings/answers are not validated.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Address review feedback on the UX revamp:

- image-gallery: make the lightbox close button fully opaque (was a 62%
  translucent dark over the displayed image, where a white icon could drop
  toward ~3.8:1 over a bright photo). Make the sticky header opaque too.
  The lightbox content/info bar where filename text lives was already on an
  opaque surface; no other overlay/popover carries text.
- rag-document-qa-svelte: make the sticky masthead opaque. Answers, cited
  passages, and the catalogue already render on opaque cards; there is no
  lightbox/overlay/popover.
- rag README: caption the catalogue/answer/citation screenshots as
  illustrative (an OpenAI API key is required for live embeddings/answers);
  note the empty and upload-error states are captured against the real
  backend.

Sticky headers are visually identical at scroll-0 and the close button is
not in the gallery screenshot, so the committed screenshots are unchanged.
Both frontends rebuild cleanly; the changes only increase contrast.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Eliminate the last semi-transparent text background: the thumbnail status
badge previously sat on an 88%-opaque surface over the image. Make it
fully opaque so its label can never lose contrast over arbitrary thumbnail
content (zero translucent text backgrounds anywhere now).

Re-validated image-gallery end to end via Aspire + Playwright (upload/XSRF,
thumbnail polling, lightbox, delete): 0 axe AA violations, 0 AAA
enhanced-contrast issues, 0 console errors in light and dark. Refreshed the
2880x2048 light + dark screenshots to reflect the solid badge.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@IEvangelist
Copy link
Copy Markdown
Member Author

Consolidated into the single umbrella UX-revamp PR #1682. The image-gallery (Lumina) and rag-document-qa-svelte (Athenaeum) commits have been merged into ievangelist/samples-ux-revamp (merge e56a6b8); all fleet work now lands in one branch/PR. Closing in favor of #1682 — branch ievangelist/ux-revamp-gallery-and-rag preserved, no history rewrite.

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