Skip to content

feat: action to add part-level view displays (#641) - #659

Merged
tkuhn merged 1 commit into
masterfrom
feat/641-part-level-view-display-action
Aug 28, 2026
Merged

feat: action to add part-level view displays (#641)#659
tkuhn merged 1 commit into
masterfrom
feat/641-part-level-view-display-action

Conversation

@tkuhn

@tkuhn tkuhn commented Aug 28, 2026

Copy link
Copy Markdown
Contributor

Closes #641.

The problem

Part-level view displays — a display whose gen:isDisplayFor is the owning resource but which targets its parts via gen:appliesToInstancesOf / gen:appliesToNamespace — could not realistically be created through the UI. All four "⬜ View displays" views carried a single ➕ add view display action, and every one of the four action templates marked the three targeting statements nt: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.

what nanopub supersedes
Template "Displaying a view for the parts of a resource" RAIrUZ9T… RAZg-r7o…
View displays view (space) RAgPVBTG… RA88liU8…
View displays view (maintained resource) RAi9VNHB… RAMDRfoO…
View displays view (user) RAWzinlU… RAoENn6U…
Part view displays view RAems5Es… RAcjRGVV…

The new template supersedes RAZg-r7o…, which was already named "part-level" but was functionally identical to the others. Against it: gen:appliesTo and its placeholder are dropped (that predicate is exactly the top-level pin, contradictory here), gen:appliesToInstancesOf / gen:appliesToNamespace lose nt:AdvancedStatement, a dct:description explains 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:hasViewQuery repointing was needed. No code constants changed either: the About*Panel classes hold chain anchors and View.get follows supersedes.

Code

The About-tab tables render both actions on their own — ViewActionMappings.addResultActions already loops. But PageTitleMenu returned 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.

AddViewDisplayButton is 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 compile passes. The published nanopubs were verified retrievable and indexed: get-latest-version-of-np on 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

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>
@tkuhn
tkuhn merged commit f3b04ff into master Aug 28, 2026
8 checks passed
@tkuhn
tkuhn deleted the feat/641-part-level-view-display-action branch August 28, 2026 08:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Action to add part-level view displays

1 participant