Skip to content

Feature/key span#5

Merged
bensonwong merged 2 commits intomainfrom
feature/key-span
Jan 10, 2026
Merged

Feature/key span#5
bensonwong merged 2 commits intomainfrom
feature/key-span

Conversation

@bensonwong
Copy link
Collaborator

No description provided.

@bensonwong bensonwong merged commit efef54f into main Jan 10, 2026
@bensonwong bensonwong deleted the feature/key-span branch January 10, 2026 09:19
bensonwong pushed a commit that referenced this pull request Feb 10, 2026
…ervability, and component architecture

## Summary

Phase A-C implementation of DX audit recommendations:

**Phase A - README & Hooks** (#0-2, #4, #9)
- Rewrite README.md with pain-point-first messaging, teaser code, component showcase, requirements tables, troubleshooting tips
- Add deprecation JSDoc to legacy APIs (getAllCitationsFromDeferredResponse, etc.)
- Soft-document compound components as experimental

**Phase B - Documentation** (#4, #5, #6, #8, #13)
- Create docs/error-handling.md with copy-paste retry patterns
- Create docs/MIGRATION.md for tracking breaking changes
- Cross-link docs with Related footers (getting-started, components, styling, index)

**Phase C - CSS Theming** (#5)
- Expose 12 CSS custom properties for full citation color customization
- Replace hardcoded Tailwind classes with inline CSS var() styles
- Add data-dc-indicator attributes for semantic test targeting
- Update all tests to use data attributes instead of Tailwind selectors

**Phase D - Observability** (#7, #8, #9)
- Implement structured error hierarchy (DeepCitationError with 5 subclasses)
- Map HTTP status codes to appropriate error types (401→Auth, 429→RateLimit, etc.)
- Add optional DeepCitationLogger for structured observability
- Add logging to all client methods: uploads, verification, caching, cache cleanup

**Phase E - Component Architecture** (#10)
- Extract useCitationEvents() hook to eliminate duplicate event handlers (30+ lines per variant)
- Extract StatusIndicators component for shared verified/partial/miss/pending rendering
- Reduce CitationVariants.tsx from 690→609 lines (81 lines removed, ~20-30 per variant)

**Phase F - Accessibility** (#12)
- Add aria-live regions for verification status change announcements
- Add aria-describedby linking citations to their status descriptions

## Test Coverage
- All 718 tests pass (624 main + 94 rendering)
- TypeScript compiles cleanly
- No breaking changes to public APIs (error classes are new exports, logging is optional)

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
bensonwong pushed a commit that referenced this pull request Feb 24, 2026
- React Compiler: change panicThreshold from "none" to "critical_errors"
  so the compiler surfaces real issues (e.g. sync ref updates) instead of
  silently producing potentially incorrect memoization
- esbuild plugin: add try-catch that gracefully falls back to uncompiled
  source when the compiler bails out, with a console.warn for visibility
- Extract resolveEvidenceSrc() shared utility in EvidenceTray.tsx to
  deduplicate evidence image resolution between EvidenceTray and
  CitationDrawer (review finding #5)
- Update CLAUDE.md canonical locations table

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
bensonwong added a commit that referenced this pull request Feb 24, 2026
)

* fix(react): drawer page pill, evidence expand, and miss thumbnail bugs

- Deactivate page pill on Escape from inline image (track hasInlineOpen
  state mirroring inlineKeysRef so pill reactivity works)
- Keyhole click now expands evidence image instead of full page by
  resolving evidenceSrc separately and routing onImageClick to it
- Use object-center instead of object-top for miss thumbnails so
  white-header pages show useful content

* docs: update npm package name from @deepcitation/deepcitation-js to deepcitation

* feat(build): adopt React Compiler for pre-optimized library output

Add babel-plugin-react-compiler to the tsup/esbuild build pipeline via a
custom esbuild plugin, so consumers get automatic memoization out of the
box without manual useMemo/useCallback/React.memo. The compiler only
targets src/react/ files; non-React entry points are unaffected.

- New esbuild-plugin-react-compiler.ts with panicThreshold: "none"
- Wire plugin into tsup.config.ts esbuildPlugins
- Add compiler to playwright-ct.config.ts Vite React plugin
- Bump react/react-dom peer deps from >=17 to >=19 (compiler-runtime)
- Bump react bundle size limit from 40 KB to 55 KB (memoization cache)

* remove external page proof link (not ready)

* fix(react): address review findings — compiler fallback, evidence dedup

- React Compiler: change panicThreshold from "none" to "critical_errors"
  so the compiler surfaces real issues (e.g. sync ref updates) instead of
  silently producing potentially incorrect memoization
- esbuild plugin: add try-catch that gracefully falls back to uncompiled
  source when the compiler bails out, with a console.warn for visibility
- Extract resolveEvidenceSrc() shared utility in EvidenceTray.tsx to
  deduplicate evidence image resolution between EvidenceTray and
  CitationDrawer (review finding #5)
- Update CLAUDE.md canonical locations table

* fix(react): remove unused ExternalLinkIcon import and comment out proof link

Removes unused ExternalLinkIcon import and temporarily disables the
proof URL link in SourceContextHeader (not ready for production).

* fix(ci): resolve lint, test, and Playwright failures from review round

- VerificationLog: remove unused validatedProofUrl variable and
  isValidProofUrl import (proof link is temporarily disabled)
- VerificationLog: prefix unused proofUrl prop with underscore
- VerificationLog: fix biome formatting
- Playwright CT: remove React Compiler from Vite config (Vite's babel
  integration doesn't support graceful fallback; compiler is only needed
  in production tsup builds which have the esbuild fallback)
- Skip proof link test (feature temporarily disabled)

* fix(test): skip Playwright proof link tests (feature temporarily disabled)

Skip 2 Playwright CT tests that expect the proof link in
SourceContextHeader — the feature is not ready for production.
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