fix(views): offer "deactivate view display" for preset-supplied views - #715
Merged
Merged
Conversation
Views that reach a resource page through a preset assignment have no view-display nanopub of their own, so ViewDisplay.getViewIri() is null for them and ViewDisplayMenu hid both "edit" and "deactivate" alongside the built-in About-tab meta-views. Deactivation works for such views regardless: a DeactivatedViewDisplay nanopub for the view's kind wins over the preset in the per-kind latest-wins filtering. ViewDisplay now records whether it was derived from a preset, and the menu shows "deactivate view display" for those as well. "edit view display" stays hidden, as there is no display nanopub to supersede. Co-Authored-By: Claude Fable 5.1 <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.
Problem
On a space page such as https://w3id.org/spaces/semantics/2026-eu/nanopub-tutorial, admins saw "deactivate view display" on most views but not on views supplied by a preset assignment (e.g. the Presentations view from the "Scientific conference preset").
Preset-supplied views are built via
ViewDisplay.forPresetView, which never setsviewIri.ViewDisplayMenuusedgetViewIri() != nullto decide whether a display is "real", so preset views were treated like the built-in About-tab meta-views and both "edit" and "deactivate" were hidden.Fix
ViewDisplayrecords whether it was derived from a preset (isPresetDerived()).ViewDisplayMenushows "deactivate view display" for standalone displays and preset-derived ones. The link already falls back to the resolved view id as the view parameter, and the resultingDeactivatedViewDisplaynanopub wins over the preset in the per-kind latest-wins filtering (this is how the program-committee view of the same preset was already deactivated on that space).Verification
mvn compileclean; view-display related tests pass.🤖 Generated with Claude Code