Skip to content

Collapse REICAT/SBN and MAG digital-assets sections on the book form (#274)#276

Merged
fabiodalez-dev merged 1 commit into
mainfrom
feat/274-collapsible-plugin-book-sections
Jul 21, 2026
Merged

Collapse REICAT/SBN and MAG digital-assets sections on the book form (#274)#276
fabiodalez-dev merged 1 commit into
mainfrom
feat/274-collapsible-plugin-book-sections

Conversation

@fabiodalez-dev

@fabiodalez-dev fabiodalez-dev commented Jul 21, 2026

Copy link
Copy Markdown
Owner

Closes #274.

Both plugin-injected sections on the book form — z39-server's REICAT/SBN cataloguing panel and oai-pmh-server's MAG digital-copies panel — rendered fully expanded, crowding the form for the majority of users who don't catalogue against SBN or manage digitised copies.

Each is now a collapsible accordion:

  • Collapsed by default on a fresh create (no data).
  • Auto-opens when the book already carries data — REICAT: sbn_bid or subjects; MAG: existing digital assets — so editing a catalogued/digitised record still shows it expanded.
  • Header is a clickable toggle (type="button", chevron rotates, aria-expanded).
  • Opens on demand, and stays open when an SBN import / asset-add lands.

For anyone who wants REICAT/SBN gone entirely rather than just collapsed, the whole section can still be removed by deactivating the z39-server plugin (Admin → Plugins) — this PR just makes it unobtrusive while keeping the plugin active.

The collapsed body stays in the DOM, so all fields still submit — I verified a save with the section collapsed persists the book and preserves sbn_bid. No new user-facing strings (headers reuse existing __() keys).

Verified live on create + edit for both sections: default state, toggle open/close, auto-open on pre-existing data, save with section collapsed; zero console errors. PHPStan level 5 clean.

Summary by CodeRabbit

  • Nuove funzionalità

    • Le sezioni “Copie Digitalizzate (MAG/ICCU)” e “Catalogazione REICAT / SBN” sono ora organizzate in pannelli a fisarmonica.
    • I pannelli si aprono automaticamente quando contengono dati esistenti o appena aggiunti/importati.
    • È possibile espandere e richiudere le sezioni tramite intestazioni interattive e indicatori visivi.
  • Accessibilità

    • Aggiunti stati ARIA e controlli aggiornati per comunicare correttamente l’apertura e la chiusura dei pannelli.

@coderabbitai

coderabbitai Bot commented Jul 21, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@fabiodalez-dev, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 31 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: 3f483fb8-ca1e-4384-b7c7-0bc961502c85

📥 Commits

Reviewing files that changed from the base of the PR and between 8bab473 and 991bdd4.

📒 Files selected for processing (2)
  • storage/plugins/oai-pmh-server/views/book-digital-assets.php
  • storage/plugins/z39-server/views/reicat/book-fields.php
📝 Walkthrough

Walkthrough

Le sezioni REICAT/SBN e Copie Digitalizzate diventano accordion accessibili, inizializzate in base alla presenza di dati e aperte automaticamente dopo importazioni o aggiunte riuscite.

Changes

Sezioni catalografiche accordion

Layer / File(s) Summary
Accordion REICAT/SBN
storage/plugins/z39-server/views/reicat/book-fields.php
La sezione usa un pulsante con stato ARIA, un corpo richiudibile e apertura iniziale basata sui dati presenti; l’import SBN riuscito apre automaticamente l’accordion.
Accordion copie digitalizzate
storage/plugins/oai-pmh-server/views/book-digital-assets.php
La sezione usa un corpo richiudibile con stato iniziale basato sugli asset; l’aggiunta riuscita di una copia apre automaticamente l’accordion.

Estimated code review effort: 2 (Simple) | ~10 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed Il titolo riassume correttamente le due sezioni rese comprimibili nel form libro.
Linked Issues check ✅ Passed La sezione REICAT/SBN viene nascosta di default per i nuovi libri e si riapre quando esistono dati, soddisfacendo #274.
Out of Scope Changes check ✅ Passed Le modifiche restano allineate agli obiettivi del PR e non introducono cambiamenti chiaramente estranei.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/274-collapsible-plugin-book-sections

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

…ions

Both plugin-injected sections (z39-server's REICAT/SBN cataloguing panel and
oai-pmh-server's MAG digital-copies panel) rendered fully expanded on the book
form, crowding it for the majority of users who don't catalogue against SBN or
manage digitised copies (#274).

Each is now a collapsible accordion:
- Collapsed by default on a fresh create (no data).
- Auto-opens when the book already carries data (REICAT: sbn_bid or subjects;
  MAG: existing digital assets) — so editing a catalogued/digitised record
  still shows it expanded.
- Header is a clickable toggle (type="button", chevron rotates, aria-expanded).
- Opens on demand, and stays open when an SBN import / asset-add lands.

Note: the whole REICAT/SBN section can also be removed entirely by deactivating
the z39-server plugin (Admin → Plugins); this just makes it unobtrusive while
keeping the plugin active.

The collapsed body stays in the DOM, so all fields still submit — verified a
save with the section collapsed persists the book and preserves sbn_bid. No new
user-facing strings (headers reuse existing __() keys). Verified live on
create + edit for both sections: default state, toggle, auto-open, save; no
console errors. PHPStan level 5 clean.
@fabiodalez-dev
fabiodalez-dev force-pushed the feat/274-collapsible-plugin-book-sections branch from 8bab473 to 991bdd4 Compare July 21, 2026 11:27
@fabiodalez-dev
fabiodalez-dev merged commit ca4e3b7 into main Jul 21, 2026
5 of 6 checks passed
@fabiodalez-dev
fabiodalez-dev deleted the feat/274-collapsible-plugin-book-sections branch July 21, 2026 11:29
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.

REICAT / SBN Cataloguing

1 participant