feat: browse the files of a multi-file resource - #9
Merged
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Foundation for moving Home's Git repository viewer into Explore: an app can enumerate a multi-file resource through
GET_QDN_RESOURCE_METADATAand fetch each file withFETCH_QDN_RESOURCE+path, so no new Home bridge action is required.What changed
#/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.resourceFiles()rejects absolute paths,..traversal, backslashes, control characters, over-long paths, and caps the list, because those strings become nodefilepathqueries and routes.response.text(), so raw bytes were being re-wrapped as base64 — every thumbnail and image preview was broken. Binary reads now requestencoding=base64from Core, and the fallback forwards that parameter (only the literalbase64)..row.resourcerenders 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.APP/Explore/Explorelists all 8 published files, with the select-a-file prompt.qortium-app.jsonandindex.htmlrender as text/JSON with the correct row highlighted.data:image/png;base64,iVBOR…and paints; before this change the same route emitted raw\x89PNGbytes behind a;base64,prefix.IMAGElisting 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
encodingpassthrough has been in Home's bridge since the original read-only app bridge).