Skip to content

content: what Self-service and Base users can see (shelf.nu#2824, #2792) - #232

Merged
carlosvirreira merged 2 commits into
mainfrom
content-update/pr-2824-2792-view-only-visibility
Aug 10, 2026
Merged

content: what Self-service and Base users can see (shelf.nu#2824, #2792)#232
carlosvirreira merged 2 commits into
mainfrom
content-update/pr-2824-2792-view-only-visibility

Conversation

@carlosvirreira

@carlosvirreira carlosvirreira commented Aug 10, 2026

Copy link
Copy Markdown
Contributor

Triggered by

  • shelf.nu PR #2824: fix(assets): restore custom fields on the asset overview for BASE and SELF_SERVICEView PR
  • shelf.nu PR #2792: fix(booking): use the standard visibility rule in the booking pickersView PR

Product change summary

#2824 — Since 2026-05-07, Self-service and Base users saw no custom fields at all on an asset's overview page, even where every field was filled in. A perf optimization skipped the custom-field-definitions query for users who can't update the asset, and the page built its entire list from that array. Customer-reported. The list is now seeded from the asset's own stored values, so view-only roles see every field that holds a value, read-only. "Not set" placeholder rows stay hidden from them. Nothing changes for Owners and Admins.

The same PR fixed a second gap that affected every role including owners: a value written while an asset belonged to a category-scoped custom field stopped rendering anywhere once the asset moved category. Those values are now shown read-only (the action rejects writes to out-of-scope definitions with a 400, so offering an editor would dead-end).

#2792 — The workspace booking-visibility toggle (selfServiceCanSeeBookings / baseUserCanSeeBookings) now governs the Add to booking picker on an asset or kit page. Previously that dialog gated on role alone, so a workspace could switch the setting on and its Self-service users would still see only their own bookings there while seeing everyone's on /bookings, in the command palette and in exports. Draft visibility is unchanged and independent: a Draft booking is only ever visible to its creator.

Content changes

Factual corrections

  • content/knowledge-base/editing-asset-fields-inline.mdx — stated the pre-fix behaviour as a rule in two places. "Fields that only exist in the old category are no longer shown" is now wrong (they render read-only), and the Permissions bullet said view-only roles "see only fields with values; they cannot enter edit mode" when in practice they saw nothing. Both rewritten to the shipped behaviour.

Content enhancements

  • content/knowledge-base/linking-custom-fields-to-categories.mdx — the Data Preservation section promised values "remain securely stored" but was silent on visibility, which was the part that was broken. Now says they stay on screen, read-only, and how to make one editable again.
  • content/knowledge-base/user-roles-and-their-permissions.mdx — added that Base and Self-service users read custom field values, and disambiguated it from the existing Manage custom fields matrix row (which is about creating definitions in Settings, not reading an asset). New matrix row: Read the custom field values recorded on an asset — true for all four roles.
  • content/knowledge-base/configure-what-self-service-and-base-users-can-see.mdx — the Special Cases bullet named only "the calendar and booking lists". Now names all five surfaces the toggle governs, and adds the Draft exception, which the page never mentioned.
  • content/knowledge-base/adding-assets-and-kits-to-a-booking.mdx — the section on adding items to an active booking mentions the Add to booking option but never said which bookings it offers. Added that, with a link to the permissions article.

New content

  • content/updates/custom-fields-visible-to-view-only-roles.mdx — changelog entry covering both fixes.

Review notes

On the changelog threshold. Both are bug fixes, which usually stay below the bar. This one is above it on the data test: for three months Self-service and Base users were shown an asset page with its custom fields silently missing, and no admin had any way to know. Users who noticed and reported it deserve to see it acknowledged; users who assumed the data was never entered need telling that it was. The out-of-category half of the fix hits every role including owners. The booking-picker fix rides along in the same entry rather than getting its own, since it is the same story from the same angle.

No alternatives / solutions / industries sweep. Neither PR adds a capability. Custom fields visible to view-only roles is the documented behaviour being restored, not a new differentiator, and no comparison page could honestly claim an advantage from it. Same for the booking-picker fix. This is the scope-judgment complement to a major-feature rollout.

No pricing data changes. Neither PR touches plan gating. Both roles already held asset: read; nothing about plan availability moved.

No new screenshots. Every page edited is copy-only on a page that already carries its images, so no TODO markers were introduced. The two views that would illustrate this (an asset page as a Self-service user, and a read-only out-of-category field) can't be captured with the current media-pipeline credentials, which are an admin account on the demo workspace. Forcing the second one would mean re-categorizing a real demo asset, which the pipeline is not allowed to do.

Claims traced to source, not to PR bodies:

  • List composition and sort order: buildAssetOverviewCustomFields in apps/webapp/app/utils/custom-fields.ts — seeded from stored values, topped up with editable definitions, deduped by definition id, sorted by name.
  • "Not set" rows hidden from view-only roles: if (!hasValue && !canEditField) return null; in assets.$assetId.overview.tsx.
  • Read-only out-of-scope rows: canEditField = canEditAsset && isEditable, with isEditable false when the definition is absent from the editable set.
  • The five booking surfaces and the Draft exception: resolveCanSeeAllBookings in utils/roles.server.ts, applied in requirePermission, api+/model-filters.ts and loadBookingsData; bookingDraftVisibilityClause(userId) is AND-ed unconditionally on every booking read path.

Checks run locally: verify-search-coverage (43 routes wrapped) and check-product-claims (539 files, no stale claims) both pass. The rendered Cloudflare preview is behind Cloudflare Access and can't be read from a scheduled run, so no visual check was performed.

Also seen this run, not acted on

  • shelf.nu#2822 (advanced-filter lock exhaustion → retryable 503) — internal resilience. It turns a crash screen into a "server temporarily overloaded, try again" message; no page documents either state.
  • shelf.nu#2734 (companion book-by-model fulfil follow-ups) — targets companion 1.2.1; the live build on both stores is 1.2.0 (released 2026-07-23), so the merge is not in it. Nothing currently on the site becomes wrong: the documented Scan to assign & check out entry point and the 2/4 assigned counter are untouched. Deferred until 1.2.1 ships.

Impact scope

  • End users affected: Self-service and Base users on every workspace that uses custom fields, plus every role on assets whose category changed. Admins configuring booking visibility.
  • Prospects affected: evaluators comparing role models, especially universities and multi-department teams reading the permissions matrix.
  • Pages modified: 5
  • Pages created: 1
  • Pages flagged for review: 0

Generated by Shelf Content Intelligence — PR→Website Sync

Summary by CodeRabbit

  • Documentation
    • Clarified booking visibility rules across the Add to booking picker and related booking surfaces.
    • Documented that draft bookings remain visible only to their creator.
    • Explained read-only access to populated custom-field values for Base and Self-service users.
    • Clarified custom-field behavior when assets change categories, including when values become editable again.
    • Added an update covering restored view-only custom-field visibility and related access rules.

Triggered by:
- Shelf-nu/shelf.nu#2824
- Shelf-nu/shelf.nu#2792

#2824 restored custom fields on the asset overview for BASE and SELF_SERVICE
(hidden since 2026-05-07) and made out-of-category stored values render
read-only instead of nowhere. The inline-editing KB stated the pre-fix
behaviour as a rule.

#2792 made the workspace booking-visibility setting govern the "Add to
booking" picker, which had been locked to a user's own bookings regardless
of the setting.
@github-actions

github-actions Bot commented Aug 10, 2026

Copy link
Copy Markdown

Preview deployment

https://d98ecf1d.shelf-nu.pages.dev

@coderabbitai

coderabbitai Bot commented Aug 10, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@carlosvirreira, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 54 minutes

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 90fadccc-94b5-4e3b-a8eb-a4a1f3a49558

📥 Commits

Reviewing files that changed from the base of the PR and between 38f22ce and d740b15.

📒 Files selected for processing (1)
  • content/knowledge-base/adding-assets-and-kits-to-a-booking.mdx

Walkthrough

The documentation updates describe booking visibility across five surfaces and read-only custom-field visibility for restricted roles. They also document category-change behavior, permissions, draft booking restrictions, and the related product update.

Changes

Visibility documentation

Layer / File(s) Summary
Booking visibility surfaces
content/knowledge-base/configure-what-self-service-and-base-users-can-see.mdx, content/knowledge-base/adding-assets-and-kits-to-a-booking.mdx
The documentation covers booking visibility across five surfaces, including the Add to booking picker. Draft bookings remain visible only to their creator.
Custom-field visibility and roles
content/knowledge-base/user-roles-and-their-permissions.mdx, content/knowledge-base/editing-asset-fields-inline.mdx, content/knowledge-base/linking-custom-fields-to-categories.mdx
The documentation describes read-only access to populated custom fields, retained values after category changes, restored edit access after reassignment, and restricted activity visibility.
Release update
content/updates/custom-fields-visible-to-view-only-roles.mdx
The update summarizes custom-field visibility, category-change behavior, booking-picker visibility, draft restrictions, and the absence of required configuration.

Estimated code review effort: 2 (Simple) | ~10 minutes

Possibly related PRs

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately identifies the documentation changes about what Self-service and Base users can see, although it does not mention booking visibility.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch content-update/pr-2824-2792-view-only-visibility

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@content/knowledge-base/adding-assets-and-kits-to-a-booking.mdx`:
- Around line 64-65: Update the booking-visibility guidance near the “Add to
booking” picker description to state that Draft bookings remain visible only to
their creators, even when the workspace setting is enabled. Preserve the
existing rule for non-Draft bookings and the references to the picker, Bookings
index, and command palette.

In `@content/updates/custom-fields-visible-to-view-only-roles.mdx`:
- Around line 1-18: Run npm run lint and resolve all reported failures,
including React effect setState violations and the Next.js redirect warning.
Update the affected implementation without changing the documented behavior of
the custom-field visibility or booking-visibility changes, and verify the lint
command exits successfully.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: d3a49d43-f2b5-4d8a-bf76-7c58790c5958

📥 Commits

Reviewing files that changed from the base of the PR and between b8ad53a and 38f22ce.

📒 Files selected for processing (6)
  • content/knowledge-base/adding-assets-and-kits-to-a-booking.mdx
  • content/knowledge-base/configure-what-self-service-and-base-users-can-see.mdx
  • content/knowledge-base/editing-asset-fields-inline.mdx
  • content/knowledge-base/linking-custom-fields-to-categories.mdx
  • content/knowledge-base/user-roles-and-their-permissions.mdx
  • content/updates/custom-fields-visible-to-view-only-roles.mdx

Comment thread content/knowledge-base/adding-assets-and-kits-to-a-booking.mdx Outdated
Comment on lines +1 to +18
---
title: "Self-service and Base Users Can See Custom Fields Again"
description: "Custom field values now appear on the asset page for Self-service and Base users, read-only. A value left behind by a category change is visible again too, and the booking-visibility setting now reaches the Add to booking picker."
date: "2026-08-10"
image: "/images/updates/enhanced-user-permissions.jpg"
readMoreUrl: "/knowledge-base/user-roles-and-their-permissions"
layout: "update"
---

Custom fields are back on the asset page for **Self-service** and **Base** users. Since early May, those two roles saw no custom fields at all on an asset's overview, even on assets where every field was filled in. Serial numbers, warranty dates, condition ratings, cost centres: all recorded, none of it visible to the people most likely to be standing in front of the equipment. Owners and Administrators saw the full list throughout, which is why the gap went unreported for so long.

Now every custom field that holds a value is shown to these roles, read-only. Fields still sitting at **Not set** stay hidden from them, since there is nothing to read and nothing they are allowed to fill in. Nothing changes for Owners and Administrators: every field that had a pencil icon still has one.

A second gap closed with it, and this one affected every role including owners. A custom field can be linked to specific categories. If an asset moved to a different category, or out of a category entirely, any value written under the old one stopped appearing anywhere on the page. The data was never deleted, but you had to export the workspace to see it. Those values are now shown in the custom fields list, marked read-only. Put the asset back in the matching category and the field becomes editable again.

Booking visibility got the same treatment. The workspace setting that lets Self-service and Base users see everyone's bookings now also governs the **Add to booking** picker on an asset or kit page, which had stayed locked to a user's own bookings no matter how the setting was configured. The **Bookings** index, the calendar, the command palette, a workspace export, and that picker now all answer the same question the same way. Draft bookings are unaffected: a booking still in **Draft** remains visible only to the person who created it.

Nothing to configure. The changes apply to your existing assets and bookings the next time you open them.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail
npm run lint

Repository: Shelf-nu/website-v2

Length of output: 8275


Run npm run lint and fix the current lint failures before merge.

The repository lint command exits non-zero with React effect setState errors and a Next.js redirect warning.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@content/updates/custom-fields-visible-to-view-only-roles.mdx` around lines 1
- 18, Run npm run lint and resolve all reported failures, including React effect
setState violations and the Next.js redirect warning. Update the affected
implementation without changing the documented behavior of the custom-field
visibility or booking-visibility changes, and verify the lint command exits
successfully.

Source: Coding guidelines

@carlosvirreira

carlosvirreira commented Aug 10, 2026

Copy link
Copy Markdown
Contributor Author

Both CodeRabbit findings triaged.

Draft-booking exception on the picker rule — valid, fixed in d740b15 on content/knowledge-base/adding-assets-and-kits-to-a-booking.mdx. The sentence now reads "every booking in the workspace except other people's Drafts" and states the rule outright. bookingDraftVisibilityClause(userId) is AND-ed unconditionally on every booking read path, so it is not a role or setting question at all.

Swept the rest of the PR for the same overclaim rather than fixing only the flagged line:

  • content/updates/custom-fields-visible-to-view-only-roles.mdx — already carried it ("Draft bookings are unaffected: a booking still in Draft remains visible only to the person who created it"). No change.
  • content/knowledge-base/configure-what-self-service-and-base-users-can-see.mdx — already carried it as its own bullet directly under the five-surface list. No change.
  • content/knowledge-base/user-roles-and-their-permissions.mdx:15 — left as is. That line is a three-bullet summary box that links to the full walkthrough for the detail; the toggle description there is about custody and bookings in general, not about which rows a picker returns.

npm run lint failures — skipped, not caused by this PR. The errors CodeRabbit reported are React effect setState violations and a Next.js redirect warning, all in src/. This branch changes six .mdx files and nothing under src/, so the failures predate it. I have not run the linter against main from here to confirm how long they have been there. Worth fixing, but in a code PR rather than a content one.

Locally green before both pushes: verify-search-coverage (43 routes wrapped) and check-product-claims (539 files, no stale claims).

@carlosvirreira
carlosvirreira merged commit 8c2ed02 into main Aug 10, 2026
3 checks passed
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.

1 participant