Collection pane: searchable bookmark feed (+ container-pane support)#74
Merged
Conversation
…port Browser (data-browser-panes.js): panes are now offered containers as well as single resources. render() may be async and may return null to decline, in which case the browser falls through to the folder table / JSON (no regression for ordinary folders). h gains isContainer, path, children, and an async fetchResource(url) helper so a pane can render a collection. Collection pane (examples/panes/bookmark-collection.js): canHandles the /public/bookmark/ container and renders its bookmark:Bookmark members as a searchable feed — compact cards (favicon, title, host, summary snippet, tags), a live search box (inline oninput, no script tag), card body -> the bookmark's .jsonld detail page, corner arrow -> the original link. Returns null when the folder holds no bookmarks. No version bump: the browser change lands on gh-pages but won't reach the cdn until a future publish; pods can use it via a --mashlib-module override. Refs #73
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.
Closes #73. Follow-up to #69/#71/#72.
Browser (
data-browser-panes.js)Panes are now offered containers as well as single resources:
rendermay be async and may returnnull/''to decline — the browser then falls through to the folder table / JSON, so ordinary folders are unaffected.hgainsisContainer,path,children(parsed members), andfetchResource(url)(async → a child's primary node).Resource panes (keyed on
@type) don't match containers; a container pane that doesn't recognise a folder returnsnull. Net: no regression for existing folders.Collection pane (
examples/panes/bookmark-collection.js)canHandles the conventional/public/bookmark/container and renders itsbookmark:Bookmarkmembers as a searchable feed:oninput— a<script>wouldn't run viainnerHTML).jsonlddetail page (full single-card summary); corner ↗ → the original linknullif the folder has no bookmarks (falls back to the folder table)No version bump
Deliberately not bumping.
data-browser-panes.jslands ongh-pagesbut won't reach the cdn until a future publish; running pods can pick it up via a--mashlib-moduleoverride until then.Testing
Verified against a live pod with three enriched bookmarks: collection renders all members + count, search filters correctly, declines empty/other folders, card→detail and corner→original links resolve.
node --checkpasses.