Skip to content

fix(landing): demo viewer renders documents like the real app - #14

Merged
Sbussiso merged 1 commit into
masterfrom
demo-viewer-rendering
Jul 6, 2026
Merged

fix(landing): demo viewer renders documents like the real app#14
Sbussiso merged 1 commit into
masterfrom
demo-viewer-rendering

Conversation

@Sbussiso

@Sbussiso Sbussiso commented Jul 4, 2026

Copy link
Copy Markdown
Contributor

The demo's document viewer previously showed every file type as the same monospace text dump. It now mirrors view.js's type-specific rendering:

  • PDFs — the paged viewer: controls bar (Previous / Next, zoom 50–200%, "Page: 1 / N"), loading flash, and a white typeset "paper" page (finance docs include real tables). Paging + zoom work.
  • Word docs — typeset white page with the zoom control.
  • Markdown — rich rendering (headings, lists, code) per the app's markdown styles.
  • ZIM/Wikipedia articles — wiki-style rendered pages with infoboxes (CSS-art thumbnails), matching the app's iframe view.
  • TXT/XLSX — unchanged extracted text, which is exactly what the real app shows for those types.

Styles mirror view.css (.pdf-viewer/.pdf-controls/.docx-* values). Verified in-browser: 15/15 functional checks (controls, paging bounds, zoom transform, tables, md/article/image/pre branches), zero console errors.

🤖 Generated with Claude Code

The demo's document viewer showed every file type as the same monospace
text dump. It now mirrors view.js's type-specific rendering:

- PDFs open in the paged viewer — controls bar (Previous / Next, zoom
  50-200%, "Page: 1 / N"), a brief loading flash, and a white "paper"
  page typeset with the document's content (finance docs get real
  tables), with working page navigation and zoom.
- Word docs render as a typeset white page with the zoom control.
- Markdown renders as rich text (headings, lists, code) matching the
  app's markdown-content styling.
- ZIM/Wikipedia articles render as actual wiki-style pages with an
  infobox (reusing the CSS-art thumbnails), matching how the app shows
  them via iframe.
- Plain text and spreadsheets keep the extracted-text view — which is
  exactly what the real app does for those types.

All styles mirror view.css (.pdf-viewer/.pdf-controls/.docx-* values);
page content generation is deterministic so paging never flickers.
@Sbussiso
Sbussiso merged commit 0d22a9c into master Jul 6, 2026
2 checks passed
@Sbussiso
Sbussiso deleted the demo-viewer-rendering branch July 6, 2026 06:30
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