fix(detail): render approval-lock band from host signal on request-tracked backends (#2618)#2619
Merged
Merged
Conversation
…acked backends (#2618) The DetailView "Locked for approval" band keyed only off the record's own `approval_status` field, so it never showed on backends that track the lock via an open approval request and never materialize that field — even though the lock was real (server rejects writes with RECORD_LOCKED and the inline-edit session correctly locks). Surface the host's already-computed lock as a distinct `locked`/`lockedReason` signal on the record-level InlineEditContext (the same dual-source `approvalLocked` that RecordDetailView already folds into `canEdit`), and have the band read it — keeping DetailView DataSource-agnostic. The record-field check stays as a fallback for bare/legacy usage. Also backfill the approval-lock strings into the detail translation defaults so a provider-less DetailView shows the label instead of the raw i18n key. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AZLuEG1ZeMSMaTsoCgdks6
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
Contributor
✅ Console Performance Budget
📦 Bundle Size Report
Size Limits
|
os-zhuang
marked this pull request as ready for review
July 16, 2026 16:33
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.
Fixes #2618.
Problem
The
DetailView"Locked for approval" band keyed only off the record's ownapproval_statusfield:On backends that track the lock via an open approval request and never materialize an
approval_statusfield on the record, the band never rendered — even though the lock was real (server rejects writes withRECORD_LOCKED, pencils hidden, save barlocked). Users saw editing silently disabled with no explanation banner.RecordDetailViewalready computes the correct dual signal —approval_status ∈ {pending, in_approval}OR an open request fromuseRecordApprovals— and folds it into the inline-editcanEditgate. The band just wasn't consuming it.Fix (issue's option 1 — renderer-correct)
Thread the host's already-computed lock into the band via the record-level session, keeping
DetailViewDataSource-agnostic:@object-ui/react—InlineEditContextgains a distinctlocked/lockedReasonsignal (separate from!canEdit, which is true for many non-approval reasons).InlineEditProvideraccepts and surfaces them.@object-ui/app-shell—RecordDetailViewpasseslocked={approvalLocked}(the same dual-source value already gatingcanEdit) plus the localized reason.@object-ui/plugin-detail— the band readsinline?.lockedfirst and falls back to the record's own field for bare/legacy usage; tooltip prefersinline?.lockedReason. Also backfills the approval-lock strings intoDETAIL_DEFAULT_TRANSLATIONSso a provider-lessDetailViewshows the label instead of the raw i18n key.This is not a lenient renderer fallback (AGENTS.md #0.1): the approvals API is an official lock signal that
RecordDetailViewalready treats as authoritative, so the band is simply made consistent with the lock that has already engaged.Tests
InlineEditContext.test.tsx—locked/lockedReasondefault tofalse/undefinedand pass through from the provider.DetailView.approvalBand.test.tsx(new) — band shows from the hostlockedsignal with noapproval_statusfield; useslockedReasonas tooltip; still shows from the record field for field-tracked backends; hidden when neither signal indicates a lock.Full
@object-ui/plugin-detailsuite green (231 tests);@object-ui/react,@object-ui/plugin-detail,@object-ui/app-shelltype-check clean.🤖 Generated with Claude Code
https://claude.ai/code/session_01AZLuEG1ZeMSMaTsoCgdks6
Generated by Claude Code