Skip to content

feat(documents): add document catalog and PDF viewer - #220

Open
BIA3IA wants to merge 6 commits into
mainfrom
feat/documents-page
Open

BIA3IA wants to merge 6 commits into
mainfrom
feat/documents-page

Conversation

@BIA3IA

@BIA3IA BIA3IA commented Nov 5, 2026 •

Copy link
Copy Markdown
Contributor

Adds /documents, where visitors browse official association documents, view PDFs and download them. The catalog reads categories and the latest dated PDF version from the backend; official public PDFs fill in documents that have not been uploaded yet.

Requires backend #132 and its published npm types. Keep this PR in draft until @polinetwork/backend has been updated to that release. No local package paths or declaration patches are included.

  • Removes demonstration documents and uses the shared page layout and navigation.
  • Serves catalog PDFs through the same origin with a timeout and no-store on the upstream fetch and all responses, so replacements and deletions take effect on subsequent requests.
  • Preserves fallback documents during partial uploads and distinguishes backend outages from missing documents.
  • Keeps page navigation and zoom usable after a page render failure, limits canvas dimensions, and preserves keyboard focus at page/zoom limits.
  • Uses separate category and heading IDs, UTC date formatting and wrapping for long admin content.

Validation: Biome, typecheck against the final local backend package, all 9 Node tests, and production build pass. Tests cover fallback merging, temporary outages, PDF caching/errors, ID collisions and canvas dimensions.

Admin dashboard: admin #162.

Design: https://www.figma.com/design/oSBlivb9Gm7H3ZkSdAtUHx/PoliNetwork-Website?node-id=6516-8013&m=dev

Review follow-up

  • Depends on @polinetwork/backend ^9.3.0 (backend Navbar on Mobile #132 is merged and published).
  • The PDF proxy's timeout now covers only the wait for upstream headers, so large PDFs on slow connections aren't truncated, and a client that disconnects cancels the upstream request.
  • During a backend outage the viewer shows an Italian "Documento temporaneamente non disponibile" message (noindex) with retry and back links, instead of Next's built-in error page.
  • The document cards fit 320px phones, and titles break at word boundaries.
  • Viewer: long titles are clamped on phones, the zoom reset button announces the current zoom, a failed page shows a single alert, and links inside PDFs work.
  • Fallback documents merge into an admin category that has the same title.

Validation: Biome, typecheck, production build and 12/12 Node tests pass. A local end-to-end run (admin → backend → site, with uploads served from local disk) covered: create, upload, reorder, version deletion, document and category deletion, and the backend being down.

🤖 Generated with Claude Code

@coderabbitai

coderabbitai Bot commented Nov 5, 2026 •

Copy link
Copy Markdown
Contributor

Important

  • Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 6e5aac9e-fb88-4e0e-8b46-35ab2d925921
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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

@BIA3IA BIA3IA changed the title feat(documents): add document page with mock PDFs feat(documents): add document catalog and PDF viewer Nov 5, 2026
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@BIA3IA
BIA3IA marked this pull request as draft November 13, 2026 19:41
BIA3IA and others added 3 commits November 13, 2026 20:59
Brings in the web.documents router the documents page reads from.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Bound the upstream timeout to the response headers so slow downloads
  are no longer truncated, and cancel the upstream when the client leaves
- Show an Italian, noindexed outage message on the viewer instead of
  Next's built-in error page
- Give document titles room on 320px phones and wrap at word boundaries
- Clamp long titles in the viewer, name the zoom level in the reset
  button, show a single alert when a page fails, enable PDF links
- Merge fallback documents into an admin category with the same title

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@BIA3IA
BIA3IA marked this pull request as ready for review November 13, 2026 22:50
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