Skip to content

feat: Phase 04 — frontend cite/export affordances#37

Open
dknauss wants to merge 5 commits into
mainfrom
phase-04/cite-export-affordances
Open

feat: Phase 04 — frontend cite/export affordances#37
dknauss wants to merge 5 commits into
mainfrom
phase-04/cite-export-affordances

Conversation

@dknauss

@dknauss dknauss commented Jun 17, 2026

Copy link
Copy Markdown
Owner

Implements Phase 04 — Frontend Cite/Export Affordances from the canonical .planning/phases/04-frontend-cite-export-affordances/ plans. Adds opt-in, per-entry "Cite / Export" disclosure panels to the static bibliography output, preserving the zero-JS / static-save() contract.

Plans (one commit each)

  • 04-01 af8a18a — Foundation: outputCiteExport + bibliographyId attributes, export cslToRisEntry, and a deprecation entry freezing the current save() shape so existing blocks stay valid.
  • 04-02 639c7a7<details> cite/export panels in save() (opt-in): visible cite text + synchronous RIS & CSL-JSON data: URI links, plus conditional BibTeX/BibLaTeX links. All encodeURIComponent-encoded.
  • 04-03 65ee699 — Editor pre-computation of per-citation BibTeX/BibLaTeX strings (a shared computeExportStrings helper wired into all four format sites with cancel guards) + stable citation IDs. Two new hook test harnesses.
  • 04-04 16ad931 — Inspector toggle ("Cite / Export affordances") + frontend CSS (hanging-indent reset, readable summary, inline export-link row).

Verification

  • npm test570 passed, 2 skipped (perf benchmarks), 0 failed.
  • lint:js, lint:css, lint:php, npm run build — all pass.
  • Every commit was independently reviewer-approved.

⚠️ Pending: human browser-verify (blocking gate in 04-04)

Plan 04-04 ends with a blocking visual checkpoint that could not run in a non-browser session. Before merge, confirm in the editor + frontend (Playground or local):
the inspector toggle appears; enabling it renders the <details> panels; the panel is flush-left (indent reset works); summary is readable; RIS/CSL-JSON (and BibTeX/BibLaTeX) links work; toggling off removes panels; content stays readable with the plugin deactivated.

🤖 Generated with Claude Code

dknauss and others added 4 commits June 17, 2026 01:31
Phase 04 Plan 01 (TDD). Lays groundwork before any save() shape change:
- block.json: add outputCiteExport (bool, false) and bibliographyId (string)
- export.js: export cslToRisEntry for synchronous per-entry RIS in save()
- deprecated.js: prepend entry freezing the current pre-Phase-4 <li> shape
  (mirrors save.js) so existing blocks stay valid when <details> is added
- edit.js: assign crypto.randomUUID() to bibliographyId on first render

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Phase 04 Plan 02 (TDD). When outputCiteExport is enabled, each saved <li>
gains a zero-JS <details> disclosure with the visible cite text and
synchronous data-URI download links for RIS and CSL-JSON (plus BibTeX/
BibLaTeX when per-citation export strings are present). All hrefs are
encodeURIComponent-encoded; opt-in is off by default.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Phase 04 Plan 03 (TDD). save() is synchronous, so the async citation-js
export builders run in the editor and their output is stored on each
citation. A shared computeExportStrings helper is wired into all four
format sites (style change, structured edit, import, manual add), each
with a post-await cancel guard, and each now assigns a stable citation id
(idempotent). The save() <details> BibTeX/BibLaTeX links now populate.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Phase 04 Plan 04. Adds the 'Cite / Export affordances' toggle to the
Metadata output inspector panel (outputCiteExport) and flat CSS for the
disclosure panels — critically resetting text-indent/padding so the panel
is flush-left rather than dragged by the hanging-indent rule, with a
readable non-italic summary and an inline export-link row.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, you can upgrade your account or add credits to your account and enable them for code reviews in your settings.

@codecov

codecov Bot commented Jun 17, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 80.76923% with 5 lines in your changes missing coverage. Please review.
✅ Project coverage is 81.43%. Comparing base (710b7aa) to head (424a840).

Files with missing lines Patch % Lines
src/hooks/use-citation-editor-state.js 75.00% 2 Missing ⚠️
src/edit.js 75.00% 1 Missing ⚠️
src/hooks/use-citation-import-actions.js 75.00% 1 Missing ⚠️
src/hooks/use-manual-citation-actions.js 75.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main      #37      +/-   ##
==========================================
- Coverage   81.47%   81.43%   -0.05%     
==========================================
  Files          40       41       +1     
  Lines        2613     2639      +26     
  Branches      464      469       +5     
==========================================
+ Hits         2129     2149      +20     
- Misses        126      131       +5     
- Partials      358      359       +1     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Update STATE.md and ROADMAP.md: Phase 04 (frontend Cite/Export) is
implementation code-complete on this branch (PR #37); only the plan 04-04
human browser-verify checkpoint remains before merge. Review date bumped.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
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