Skip to content

feat: browse the files of a multi-file resource - #9

Merged
QuickMythril merged 1 commit into
mainfrom
feat/explore-multi-file-browsing
Jul 28, 2026
Merged

feat: browse the files of a multi-file resource#9
QuickMythril merged 1 commit into
mainfrom
feat/explore-multi-file-browsing

Conversation

@QuickMythril

Copy link
Copy Markdown
Member

Foundation for moving Home's Git repository viewer into Explore: an app can enumerate a multi-file resource through GET_QDN_RESOURCE_METADATA and fetch each file with FETCH_QDN_RESOURCE + path, so no new Home bridge action is required.

What changed

  • Multi-file browsing. The detail screen lists a resource's files and renders the selected one. Each file has its own deep-linkable route, #/detail/{service}/{name}/{identifier}/file/{path}; the identifier slot is always present in that form so a path can never be read as an identifier.
  • File list is treated as untrusted input. resourceFiles() rejects absolute paths, .. traversal, backslashes, control characters, over-long paths, and caps the list, because those strings become node filepath queries and routes.
  • Per-file classification. A selected file is typed by its own name; the resource-level service and mime type describe the whole publication and would mislabel, for example, a PNG inside an APP.
  • Binary fetch fix. Home's bridge and Explore's browser fallback both read the node response with response.text(), so raw bytes were being re-wrapped as base64 — every thumbnail and image preview was broken. Binary reads now request encoding=base64 from Core, and the fallback forwards that parameter (only the literal base64).
  • Listing grid fix. .row.resource renders five children but the grid declared four columns, so the updated timestamp wrapped to its own line. The thumbnail now has a column in both the header and the rows.

Verification

  • npm ci, tsc --noEmit, 41 tests (8 files), production build — all clean.
  • Rendered headlessly against the live Previewnet node, not just asserted in tests:
    • APP/Explore/Explore lists all 8 published files, with the select-a-file prompt.
    • qortium-app.json and index.html render as text/JSON with the correct row highlighted.
    • The PNG file route now emits data:image/png;base64,iVBOR… and paints; before this change the same route emitted raw \x89PNG bytes behind a ;base64, prefix.
    • An IMAGE listing renders real thumbnails on a single-line grid, and the narrow-viewport layout keeps thumbnail + identifier + status.

Version 1.4.4 → 1.4.5 (QAVS counter bump; minimum platform level is unchanged — the encoding passthrough has been in Home's bridge since the original read-only app bridge).

Explore could only ever show a resource as a single blob, so an APP, WEBSITE,
or FILES publication was reduced to whatever its default fetch returned. The
node already lists a resource's contents in its arbitrary metadata, so no new
Home bridge action is needed to open them one by one.

- Add a validated file list from `GET_QDN_RESOURCE_METADATA`, rejecting
  absolute paths, traversal, backslashes, control characters, and oversized
  or unbounded lists before they reach a node query or a route.
- Give each file its own deep-linkable route, keeping the identifier slot
  explicit so a path can never be mistaken for an identifier.
- Classify a selected file by its own name rather than the resource-level
  service and mime type, which describe the whole publication.

Binary reads were also corrupted: both Home's bridge and the browser fallback
read the node response as text, so raw bytes were re-wrapped as base64 and
every thumbnail and image preview rendered broken. Binary fetches now ask Core
for base64 explicitly, and the fallback forwards that parameter.

The listing grid counted four columns while each row rendered five children,
so the updated timestamp wrapped onto its own line. The thumbnail now has its
own column in both the header and the rows.
@QuickMythril
QuickMythril merged commit e581658 into main Jul 28, 2026
4 checks passed
@QuickMythril
QuickMythril deleted the feat/explore-multi-file-browsing branch July 28, 2026 04:34
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