Replace "^" for view displays with dropdown menu#369
Merged
Conversation
Adds a ViewDisplayMenu component that replaces the SourceNanopub "^" link in the header of all QueryResult panels (list, table, nanopub set, plain paragraph). The menu offers three options: "show query" (links to QueryPage), "update" (opens PublishPage with supersede), and "see view display declaration" (links to ExplorePage, the former "^" behaviour). Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…ic, admin visibility - Rename "update" menu item to "adjust" - Use supersede= URL param when the session pubkey matches the view display nanopub's signer pubkey; derive= otherwise - Hide the "adjust" item unless the user is on their own profile page (IndividualAgent.isCurrentUser()) or is a space admin (Space.isAdminPubkey()) for Space / MaintainedResource pages - Thread AbstractResourceWithProfile pageResource through all four QueryResult builder classes and ViewList so ViewDisplayMenu can perform the admin check without page-level knowledge - Move np button initialisation from each QueryResult subclass constructor into QueryResult.onBeforeRender() so pageResource is always available at render time; QueryResultNanopubSet keeps its own handling inside viewSelector Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
ec10f68 to
0b7362a
Compare
…raph builders setPageResource() was missing from all ApiResultComponent (cache-miss) paths in QueryResultListBuilder and one path in QueryResultPlainParagraphBuilder. On first page load queries are uncached, so the async path is always taken, causing pageResource to remain null and ViewDisplayMenu to hide "adjust". On second load the responses are cached so the sync path ran correctly. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…ntent
.view-selector span (specificity 0,1,1) was overriding
.actionmenu-content { display: none } (specificity 0,1,0), causing the
ViewDisplayMenu dropdown to be permanently visible inside QueryResultNanopubSet.
Narrow the selector to .view-selector .list and .view-selector .grid,
which are the only spans that need those icon-button styles.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…-selector Three issues: 1. Menu entry text right-aligned in NanopubSet: .view-selector inherits text-align:right; fix by adding text-align:left to .actionmenu-content. 2. NanopubSet icon spacing: remove excess padding-right (was 20px) from .view-selector.with-source, and restore margin-left:10px on .buttons (lost when .view-selector span was narrowed to .list/.grid only). 3. Other view types icon too high: old a.source had margin-top:20px to sit near the bottom of the title row; add same positioning to .paneltitlerow span.buttons .actionmenu. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Without an explicit top value, position:absolute falls back to the static position — which lands after the <h4> at roughly the bottom border of the paneltitlerow, causing the menu icon to overlap it. Add top:0 to .view-selector.with-source so it is anchored to the top of the header row. Also make .buttons display:inline-block (consistent with the icon spans) to avoid line-box height side-effects from vertical-align. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…selector
Two problems:
1. .paneltitlerow span.buttons .actionmenu { margin-top: 14px } matched the
NanopubSet span.buttons (descendant of paneltitlerow via view-selector),
pushing the icon down into the border. Fix: use > child combinator so it
only matches the direct-child span.buttons in list/table/paragraph headers.
2. The inline style="margin: 0;" on the NanopubSet buttons span was
overriding .view-selector.with-source .buttons { margin-left } (inline
styles win over all CSS). Remove the now-redundant inline style (it was
only there to counter the old .view-selector span margin-left rule).
Also increase the left margin to 16px for comfortable spacing.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Pass queryparam_<name>=<value> for each entry in queryRef.getParams() so the QueryPage form is pre-populated with the same values the view display uses. The user can then press Run to see the exact same results. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
… avoid multiple values in textarea after refresh
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…margin-top for panel title row
…ixels/nanodash into feature/364-view-display-menu
ashleycaselli
approved these changes
Mar 4, 2026
|
🎉 This PR is included in version 4.15.0 🎉 The release is available on:
Your semantic-release bot 📦🚀 |
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 #364
Summary
ViewDisplayMenucomponent that replaces theSourceNanopub("^") link in the title row of allQueryResultpanels (list, table, nanopub set, plain paragraph)NanopubItem's action menu (sameactionmenuCSS classes)QueryPage, update →PublishPagewithsupersede, see view display declaration →ExplorePageTest plan
🤖 Generated with Claude Code