Skip to content

Issue #5: micro-frontend profile pages, comparison view, and full E2E coverage#6

Merged
konard merged 6 commits into
mainfrom
issue-5-422de4b625cb
May 12, 2026
Merged

Issue #5: micro-frontend profile pages, comparison view, and full E2E coverage#6
konard merged 6 commits into
mainfrom
issue-5-422de4b625cb

Conversation

@konard
Copy link
Copy Markdown
Contributor

@konard konard commented May 11, 2026

Summary

Fixes #5. Reorganizes the chat-demos gallery so our own React UI is a first-class entry, expands the catalog to a broader set of popular React chat libraries, ships a true micro-frontend page per profile, adds Telegram-style appearance toggles, supports markdown in both messages and the composer, exposes a feature/limitation comparison view, and covers every demo with E2E tests that verify rendering and sending in real browsers.

What changed

  • Own chat UI as a separate entry. "Our own chat UI" is pinned at the top of the gallery, scored independently, and reimplemented in React based on the GPTutor reference.
  • Expanded catalog. Researched, scored, and ranked the most popular React chat libraries (see src/extended-chat-catalog.js, src/profile-scoring.js). The list is sorted top-down by feature richness, maintenance, and flexibility.
  • Micro-frontend architecture. Every profile gets its own isolated HTML entry. docs/chat-demos/scripts/generate-profile-pages.mjs materializes docs/chat-demos/profiles/<id>.html + Vite entry chunk per profile, registered via vite.config.js rollupOptions.input. The page-per-profile build prevents library dependencies from clashing on a single bundle.
  • Comparison view. New "Compare" tab lists features, limitations, lock-ins, and license per profile in a single matrix ([data-testid="compare-view"]).
  • Appearance toggles. Avatar / sender name / reply chrome toggles (Telegram-style) wired to [data-testid="toggle-*"].
  • Composer kinds. Switch the composer between textarea, input, and contenteditable via [data-testid="composer-kind"]. Markdown is rendered in both messages and the preview side of the composer.
  • Case study. docs/case-studies/issue-5/ captures the requirements decomposition, profile data, and scoring methodology.
  • E2E coverage. tests/e2e/chat-demos.e2e.js exercises every demo in the main gallery (render, switchers, source visible, send), toggles, locale switching, composer kinds, the comparison view, and a full sweep of every isolated micro-frontend page. The send path is asserted by a delta in [data-testid="chat-message"] count plus a transcript match.
  • Reliability fix in E2E. browser-commander's clickButton reported success without triggering the React onClick for some buttons (aria-pressed stayed false). Switched the demo-tab clicks to native page.locator(...).click() via a selectDemoTab helper.
  • Pipeline. npm run test:e2e now regenerates profile pages first. The auto-generated docs/chat-demos/profiles/ and experiments/ folders are gitignored / prettierignored to keep the working tree clean.
  • Changeset. Minor bump recorded in .changeset/issue-5-micro-frontends-and-comparison.md.

Verification

  • npm test — 48 unit tests pass.
  • npm run test:e2e — 10/10 E2E tests pass (gallery, every profile send, locale, toggles, composer kinds, compare view, every micro-frontend page).
  • npm run check — lint + prettier + jscpd clean.
  • npm run demo:build — builds the gallery and all 16 isolated micro-frontend profile pages.

Screenshot

Chat demo gallery

Test plan

  • Unit tests pass locally (npm test)
  • E2E tests pass locally (npm run test:e2e)
  • Lint / format / duplication clean (npm run check)
  • Demo build succeeds (npm run demo:build)
  • CI checks green on this branch
  • Post-deploy E2E against GitHub Pages preview (after merge)

Adding .gitkeep for PR creation (default mode).
This file will be removed when the task is complete.

Issue: #5
@konard konard self-assigned this May 11, 2026
konard added 4 commits May 11, 2026 14:08
…ed catalog

Captures research and analysis artifacts for issue #5 in
docs/case-studies/issue-5/, including npm/GitHub data for ~18 chat
packages and the issue/PR metadata.

Adds three new source modules:
- src/profile-scoring.js: scoring formula that weights feature count,
  configurable surfaces, recency, stars, and a "live render" bonus.
- src/own-chat-profile.js: dedicated profile entry for our own chat UI
  ported from GPTutor.
- src/extended-chat-catalog.js: 7 additional library profiles
  (MinChat, react-simple-chatbot, react-chatbot-kit, NLUX, LiveChat,
  Rocket.Chat Fuselage, Vercel AI SDK) with featureMatrix, limitations,
  and lockIns metadata.
Pin our own chat profile to the top and append the extended profiles,
sorted by computed score from src/profile-scoring.js. The catalog now
includes 16 entries (own + 8 base + 7 extended) and exposes
getComparisonMatrix() and an isOwn flag on listChatDemoSummaries().

Adds tests/chat-comparison.test.js covering scoring, ranking,
catalog pinning, and the comparison matrix shape.

Adds featureMatrix, limitations, and lockIns metadata to the 8 base
profiles so the comparison view has consistent fields.
- Generate isolated micro-frontend pages for every profile (docs/chat-demos/profiles/)
- Add comparison view tab listing features, limitations, lock-ins, and license per profile
- Wire toggles for avatar, sender name, reply chrome, and composer kind
- Cover every profile with E2E tests (gallery, toggles, locale, composer kind, isolated page)
- Switch demo selection clicks to native Playwright to bypass a browser-commander silent failure
- Regenerate auto-generated profile pages before demo:dev/demo:build/test:e2e
@konard konard changed the title [WIP] Fixes and improvements Issue #5: micro-frontend profile pages, comparison view, and full E2E coverage May 11, 2026
@konard konard marked this pull request as ready for review May 11, 2026 14:40
@konard
Copy link
Copy Markdown
Contributor Author

konard commented May 11, 2026

Working session summary

Done. PR #6 is ready for review: #6

What landed:

  • Own React chat UI pinned as a standalone entry; catalog expanded and scored top-down by features/maintenance/flexibility.
  • Micro-frontend page per profile (docs/chat-demos/profiles/<id>.html) generated and wired through Vite rollupOptions.input.
  • Comparison tab listing features, limitations, lock-ins, and license per profile.
  • Avatar / sender name / reply chrome toggles and a switchable composer kind (textarea/input/contenteditable), with markdown in both messages and composer.
  • docs/case-studies/issue-5/ captures the requirements decomposition and methodology.
  • E2E tests cover every demo (render + send), toggles, locale, composer kinds, comparison view, and every isolated micro-frontend page. Switched demo-tab clicks to native Playwright to bypass a browser-commander.clickButton silent failure.
  • All 3 CI checks green on 2982bdc (Checks and release, Chat demo pages, Broken Link Checker). Changeset (minor) included.

This summary was automatically extracted from the AI working session output.

@konard
Copy link
Copy Markdown
Contributor Author

konard commented May 11, 2026

🤖 Solution Draft Log

This log file contains the complete execution trace of the AI solution draft process.

💰 Cost: $17.190504

📊 Context and tokens usage:

Claude Opus 4.7: (5 sub-sessions)

  1. 101.4K / 1M (10%) input tokens, 27.3K / 128K (21%) output tokens
  2. 115.2K / 1M (12%) input tokens, 19.1K / 128K (15%) output tokens
  3. 117.1K / 1M (12%) input tokens, 39.4K / 128K (31%) output tokens
  4. 117.7K / 1M (12%) input tokens, 26.3K / 128K (21%) output tokens
  5. 48.6K / 1M (5%) input tokens, 5.1K / 128K (4%) output tokens

Total: (11.1K new + 443.5K cache writes + 21.6M cache reads) input tokens, 143.3K output tokens, $17.190504 cost

🤖 Models used:

  • Tool: Anthropic Claude Code
  • Requested: opus
  • Model: Claude Opus 4.7 (claude-opus-4-7)

📎 Log file uploaded as Gist (7546KB)


Now working session is ended, feel free to review and add any feedback on the solution draft.

@konard
Copy link
Copy Markdown
Contributor Author

konard commented May 11, 2026

✅ Ready to merge

This pull request is now ready to be merged:

  • All CI checks have passed
  • No merge conflicts
  • No pending changes

Monitored by hive-mind with --auto-restart-until-mergeable flag

@konard konard merged commit aa85f6d into main May 12, 2026
23 checks 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.

Fixes and improvements

1 participant