feat: action to add part-level view displays (#641) - #659
Merged
Conversation
The "⬜ View displays" views now declare a second result-level action,
"➕ add part-level view display", next to the plain one. Its template
("Displaying a view for the parts of a resource",
RAIrUZ9TQfAYeun74aM_BicxYF4uU6GkL6BthX4WdI9dA) drops the top-level
gen:appliesTo pin and un-hides the gen:appliesToInstancesOf /
gen:appliesToNamespace statements, which were nt:AdvancedStatement in
every earlier template — and therefore invisible unless the user found
the form's advanced-mode toggle. That was the reason part-level displays
were hard to add.
The About-tab tables pick both actions up on their own, but the space
title-menu shortcut returned on the first entitled action and so would
have silently shown only one of the two. Return all of them instead, in
the order the view nanopub lists them.
Also drops AddViewDisplayButton, which has had no callers for a while.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
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 #641.
The problem
Part-level view displays — a display whose
gen:isDisplayForis the owning resource but which targets its parts viagen:appliesToInstancesOf/gen:appliesToNamespace— could not realistically be created through the UI. All four "⬜ View displays" views carried a single➕ add view displayaction, and every one of the four action templates marked the three targeting statementsnt:AdvancedStatement. Since.advanced { display: none !important }hides those rows until the user finds the form's advanced-mode toggle, the form only ever produced a top-level display.Published nanopubs
A second result-level action,
➕ add part-level view display, was added to each view, pointing at a new template that makes targeting the primary, visible input.RAIrUZ9T…RAZg-r7o…RAgPVBTG…RA88liU8…RAi9VNHB…RAMDRfoO…RAWzinlU…RAoENn6U…RAems5Es…RAcjRGVV…The new template supersedes
RAZg-r7o…, which was already named "part-level" but was functionally identical to the others. Against it:gen:appliesToand its placeholder are dropped (that predicate is exactly the top-level pin, contradictory here),gen:appliesToInstancesOf/gen:appliesToNamespacelosent:AdvancedStatement, adct:descriptionexplains the distinction, and the label pattern becomes${resource} displays view for its parts: ${view}. The activated/deactivated statement stays advanced.On the part page the single existing action became the part-level one — that table already writes onto the owning resource, which is where part-level displays live.
Queries, kinds, titles, structural positions and widths are untouched, so no
gen:hasViewQueryrepointing was needed. No code constants changed either: theAbout*Panelclasses hold chain anchors andView.getfollows supersedes.Code
The About-tab tables render both actions on their own —
ViewActionMappings.addResultActionsalready loops. ButPageTitleMenureturned on the first entitled result action, so the space title-menu shortcut would have silently shown only one of the two, with which one depending on statement order. It now returns all of them, in the order the view nanopub lists them.AddViewDisplayButtonis deleted; it has had no callers for a while.Deployment
The two About-tab buttons appear on already-deployed instances without a redeploy, since that is entirely view-driven. Only the title-menu shortcut needs this change shipped.
Testing
mvn compilepasses. The published nanopubs were verified retrievable and indexed:get-latest-version-of-npon each of the five chain anchors held in the code constants resolves to the new head. The publish form itself has not been rendered in a browser yet — field order and the description block are as authored.🤖 Generated with Claude Code