Repository navigation
Deep-link lookup banner for #?s= fragments - #3
Conversation
Read a #?s=<txid|outpoint|address> reference from the URL fragment at load or on hash change, clear the fragment from the address bar, and show a global banner that adds the reference through the existing graph lookup path. On failure the error toast shows and the banner stays open; with no workspace unlocked the click explains that a workspace is needed. Implements the design agreed in remcoros#2.
d7fbb48 to
f4e6b32
Compare
|
Correction force-pushed to this branch; the first push carried one unintended change. What slipped: in src/App/useAppState.ts the workspace-tabs reveal line lost its guard and flipped direction ( What now guards it: the file's delta against main is gated mechanically before anything is committed or pushed (exactly 3 hunks, 17 additions, 0 deletions, no scroll lines in the delta). The file now differs from main only by the fragment parser import, the deepLinkRef state, the consume-and-clear effect, and the two returned fields. Also fixed while at it: the first e2e test unlocked a workspace and then used page.goto to set the fragment, which reloads and locks every workspace, so the click never exercised the intended path. The spec now seeds storage, lands on the fragment, unlocks, then clicks. Validation: npm run check green (211 files, 2110 tests) and Playwright 5 of 5 green (three deep-link legs plus both smoke tests). The /api/networks ECONNREFUSED lines in a local run are the backendless dev server; the pre-existing smoke tests log the same. Still owed as stated in the description: a browser look at banner placement next to the toast, and the user-guide sentence. |
|
Thanks for the contribution, @tetragrammalol! I added 0b2aa6e to make banner dismissal follow actual lookup completion, preserve newer links and retries, and show feedback for unavailable lookups. Successful lookups from Wallet or Analysis now open Graph with a return route. Also added regression coverage and updated the user guide. |
|
awesome and thanks! |
|
Great stuff, thanks for prompt response on this issue @remcoros |
Implements the design agreed in #2.
Behavior
#?s=<txid|outpoint|address>fragment is read once at load and again onhash change. In-app anchors such as
#main-workspaceare ignored becauseonly the
#?s=shape is matched.history.replaceState, before anyclick, so the reference never re-enters the address bar, history, or logs.
action, regardless of workspace state, as specified in Feature proposal: fragment-based deep links for lookups (e.g. #?tx=<txid>) #2.
graph.lookup.submit).On success the banner dismisses. On failure the global error toast shows
and the banner stays open so the user can switch workspaces and retry.
and the banner stays open.
submit()returns silently in that case today,so the banner handles it before calling through.
Census facts behind the design
useWorkspacealready publishesgraph.lookup.submit, so the banner needsno Core changes (src/App/Workspace/useWorkspace.tsx).
useWorkspaceOperation.run, which routeserrors to the global error toast (src/App/Workspace/useWorkspaceOperation.ts).
resolveLoaded, which thebanner reuses for offline adds and success detection
(src/App/Workspace/Workbenches/Graph/Navigation/useGraphLookupState.ts).
Files
following the per-feature CSS pattern.
path, and dismissal.
Validation
browser beyond the e2e assertions; happy to adjust position and styling.
Follow-up owed: a user-guide sentence once the interaction wording settles.