Skip to content

Feat/humanreadable2 - #828

Merged
SharonStrats merged 24 commits into
stagingfrom
feat/humanreadable2
Nov 26, 2026
Merged

SharonStrats merged 24 commits into
stagingfrom
feat/humanreadable2

Conversation

@SharonStrats

@SharonStrats SharonStrats commented Nov 21, 2026 •

Copy link
Copy Markdown
Contributor

All human readable content types

  • json & jsonld
  • html & xhtml
  • plain text
  • Dokieli
  • PDF redesign (web component)
  • mobile and desktop
  • accessibility
  • iframe webcomponent
  • quickfix - slideshow put it back to 1 image

Things to review:

  1. Markdown is using a different package that has more capabilities so you can see formatted code for instance, and tables look a bit nicer.
  2. Dokieli and HTML were not working for private files before, they are working now.
  3. Plain text I changed the font from monospace to our font. I did some research and it suggested this was good, but I can always change it back if you don't like it.
  4. I added syntax highlighting to json and jsonld.
  5. PDF is the new design. There are things we won't have though because of it like printing and downloading. Note: I did the basic implementation.

Here are some things we could add later, if you want I can create a separate ticket for after grant work.
PDF page
└── canvas layer Existing: visual page rendering
├── text layer Selectable/searchable text
├── annotation layer Links, forms, highlights, comments
├── search layer Search-result highlights
└── interaction layer Drawing, selection, zoom tools, etc.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Active findings identify DOCX script-execution risks, unbounded PDF canvas memory use, and missing required lockfile peers, creating critical security, reliability, and installation concerns.

6 open issues
What changed in this PR

This PR consolidates document and media previews into the Human Readable pane, with dedicated PDF and iframe components and expanded format support.

Changes:

  • Adds DOCX and PDF rendering, enhanced Markdown, highlighted JSON, and shared image/video previews.
  • Refactors preview lifecycle, error handling, responsive styling, and accessibility tests.
  • Adds deep-link initialization and enables slideshows for single-image containers.
File Description
typings/​pdf-worker-url.d.ts Declares the PDF worker URL import.
test/​unit/​slideshowPane.test.ts Tests single-image slideshow availability.
test/​unit/​mediaPreview.test.ts Tests media rendering, errors, and cleanup.
test/​unit/​markdownPreview.test.ts Tests Markdown rendering and fetch failures.
test/​unit/​mainPage/​index.test.ts Tests deep-link initialization.
test/​unit/​imagePane.test.ts Removes standalone image-pane tests.
test/​unit/​humanReadablePane.test.ts Expands format and preview lifecycle coverage.
test/​unit/​humanReadable.accessibility.test.ts Adds automated preview accessibility checks.
test/​unit/​docxPreview.test.ts Tests DOCX detection and rendering.
test/​unit/​creationPromises.test.ts Adds Pad linked-list initialization assertions.
src/​video/​videoPane.js Removes the standalone video pane.
src/​slideshow/​slideshowPane.js Allows single-image slideshows.
src/​registerPanes.js Registers consolidated preview handling.
src/​mainPage/​index.ts Resolves deep links and updates the preview-frame guard.
src/​imagePane.ts Removes the standalone image pane.
src/​imagePane.css Removes standalone image styling.
src/​humanReadablePane.ts Removes the monolithic preview implementation.
src/​humanReadablePane.css Removes the previous stylesheet location.
src/​humanReadable/​textPreview.ts Extracts plain-text rendering.
src/​humanReadable/​previewHelpers.ts Shares preview constants and title helpers.
src/​humanReadable/​previewFrame.ts Shares preview container construction.
src/​humanReadable/​previewError.ts Centralizes dismissible preview errors.
src/​humanReadable/​previewBridge.ts Extracts the sandboxed Dokieli bridge script.
src/​humanReadable/​mediaPreview.ts Adds shared image/video rendering and cleanup.
src/​humanReadable/​markdownPreview.ts Adds lazy Markdown rendering and sanitization.
src/​humanReadable/​markdownIt.ts Provides the lazy Markdown parser entry point.
src/​humanReadable/​jsonPreview.ts Adds precision-preserving JSON highlighting.
src/​humanReadable/​index.ts Routes formats and coordinates previews.
src/​humanReadable/​humanReadablePane.css Styles consolidated document and media previews.
src/​humanReadable/​docxPreview.ts Adds lazy DOCX rendering.
src/​dokieli/​dokieliPane.ts Simplifies imports and uses shared logging.
src/​components/​pdf-viewer/​PdfViewier.styles.css Styles PDF pages and thumbnails.
src/​components/​pdf-viewer/​PdfViewer.ts Adds canvas-based PDF viewing and navigation.
src/​components/​pdf-viewer/​pdfJs.ts Provides the lazy PDF.js entry point.
src/​components/​pdf-viewer/​index.ts Exports the PDF viewer component.
src/​components/​iframe-preview/​index.ts Exports the iframe preview component.
src/​components/​iframe-preview/​IframePreview.ts Encapsulates authenticated iframe previews and cleanup.
src/​components/​iframe-preview/​IframePreview.styles.css Styles the iframe preview component.
package.json Updates rendering and accessibility-test dependencies.
package-lock.json Updates the locked dependency graph.

Review effort: Balanced

Comment thread src/components/pdf-viewer/PdfViewer.ts Resolved
Comment thread src/humanReadable/docxPreview.ts Resolved
Comment thread src/components/pdf-viewer/PdfViewer.ts Resolved
Comment thread src/humanReadable/index.ts Resolved
Comment thread src/mainPage/index.ts Resolved

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

The lockfile omits required peer dependencies needed for CI installation, and unsynchronized PDF rendering can cause canvas conflicts and load errors for valid documents.

2 open issues
3 previously missed issues

In code that hasn't changed since last review

Medium severity Desktop PDF canvases accumulate page buffers

src/​components/​pdf-viewer/​PdfViewer.ts:108

Desktop previews never release full-resolution page buffers: this guard makes the desktop cleanup call in renderMainCanvases a no-op, and thumbnail selections leave previously visited canvases populated. Hiding those canvases with display: none does not free their pixel buffers, so browsing a large PDF accumulates several megabytes per visited page. Track selected-page renders and release non-current desktop canvases, or use a bounded cache.

Medium severity PDF text and links are inaccessible to screen readers

src/​components/​pdf-viewer/​PdfViewer.ts:327

This replaces the browser PDF viewer with canvases whose accessible names contain only page numbers. Consequently, screen-reader users cannot read any of a PDF's text or follow its links; the warning above does not provide equivalent access. Please render PDF.js text and annotation layers, or provide an accessible alternative that can open the authenticated document in a full PDF viewer.

Medium severity Derive pod context from the resolved document URL

src/​mainPage/​index.ts:59

Cross-origin ?uri= links resolve the document, but the heading and navbar still derive their pod context from window.location.href in src/mainPage/profileHeading.ts:251 and src/mainPage/navbar.ts:97. They therefore show the application host's profile and storage menus, or no menus when that host has no pod metadata. Use the resolved resource URL consistently when deriving the shell's pod context.

6 resolved since last review

Review effort: Balanced

Comment thread src/components/pdf-viewer/PdfViewer.ts Resolved
Comment thread src/humanReadable/docxPreview.ts Resolved
@SharonStrats
SharonStrats force-pushed the feat/humanreadable2 branch 2 times, most recently from 03a216d to 78433a8 Compare November 24, 2026 23:45
SharonStrats and others added 8 commits November 25, 2026 10:46
Prompt: tokenize JSON to display nicely

Co-authored-by: GPT-5.6 Luna <gpt-5.6-luna@openai.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Co-authored-by: GPT-5.6 Luna <gpt-5.6-luna@openai.com>
@SharonStrats
SharonStrats force-pushed the feat/humanreadable2 branch 2 times, most recently from ace3ea6 to 73dfc24 Compare November 25, 2026 07:49
@SharonStrats
SharonStrats requested review from timea-solid and removed request for timea-solid November 25, 2026 08:01
SharonStrats and others added 11 commits November 26, 2026 10:40
Prompt: Help addressing PR feedback a few prompts

Co-authored-by: GPT-5.6 Luna <gpt-5.6-luna@openai.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…@5.1.1-0 pane-registry@5.1.2-0 activitystreams-pane@2.1.1-0 chat-pane@4.1.1-0 contacts-pane@4.1.1-0 folder-pane@4.1.5-0 issue-pane@4.1.1-0 meeting-pane@4.1.1-0 profile-pane@4.1.1-0 source-pane@4.1.1-0) (latest: rdflib@2.4.1)
…@5.1.1-0 pane-registry@5.1.2-0 activitystreams-pane@2.1.1-0 chat-pane@4.1.1-0 contacts-pane@4.1.1-0 folder-pane@4.1.5-0 issue-pane@4.1.1-0 meeting-pane@4.1.1-0 profile-pane@4.1.1-0 source-pane@4.1.1-0) (latest: rdflib@2.4.1)
…@5.1.1-0 pane-registry@5.1.2-0 activitystreams-pane@2.1.1-0 chat-pane@4.1.1-0 contacts-pane@4.1.1-0 folder-pane@4.1.5-0 issue-pane@4.1.1-0 meeting-pane@4.1.1-0 profile-pane@4.1.1-0 source-pane@4.1.1-0) (latest: rdflib@2.4.1)
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@SharonStrats
SharonStrats force-pushed the feat/humanreadable2 branch 2 times, most recently from f7bbec6 to f2a46eb Compare November 26, 2026 00:18
…@5.1.1-0 pane-registry@5.1.2-0 activitystreams-pane@2.1.1-0 chat-pane@4.1.1-0 contacts-pane@4.1.1-0 folder-pane@4.1.5-0 issue-pane@4.1.1-0 meeting-pane@4.1.1-0 profile-pane@4.1.1-0 source-pane@4.1.1-0) (latest: rdflib@2.4.1)
@SharonStrats
SharonStrats merged commit 43f0568 into staging Nov 26, 2026
8 checks passed
@github-project-automation github-project-automation Bot moved this from In review to Done in SolidOS NLNet UI Nov 26, 2026
@SharonStrats
SharonStrats deleted the feat/humanreadable2 branch November 26, 2026 00:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: Done

2 participants