fix(detail): Attachments become a peer tab with a live count badge, and their copy is translated (objectstack#4358) - #3123
Merged
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
Contributor
✅ Console Performance Budget
📦 Bundle Size Report
Size Limits
|
…d, and its copy is finally translated (objectstack#4358) Two defects on enable.files record detail pages: 1. Buried placement — RecordDetailView appended RecordAttachmentsPanel AFTER the schema-rendered page tree, whose synthesized default embeds record:discussion as the last main component, so the panel always sat below an ever-growing feed timeline with no metadata knob to move it. buildDefaultPageSchema now emits a footer grid row placing a new record:attachments node to the LEFT of the feed (1/3–2/3 on lg+, stacked attachments-first below). The node is a new app-shell registration wrapping the existing panel via RecordContext; an `attachments` slot + `hideAttachments` option cover slotted pages, and the legacy bottom append survives only as the fallback for authored pages without the node (hasExplicitAttachments). 2. Untranslated copy — the panel's eleven detail.* keys existed only as inline-English defaultValues; no locale bundle carried them. All ten locales now define them. Verified in the browser against a showcase backend: zh console renders 「附件 / 上传 / 暂无附件…」 in the left column with the discussion feed to its right on lg+, and stacks the panel above the feed on mobile. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
… live count badge (objectstack#4358) Rework of the previous commit's side-by-side footer after design review: the narrow attachments card next to a tall feed read as a broken layout. - buildDefaultTabs emits an Attachments tab (record:attachments) between Related and Activity/History for enable.files objects; hideAttachments suppresses it. The footer grid, the attachments slot and toFooterCell are gone — the discussion footer is back to its original shape. - PageTabsRenderer derives the tab badge from a sys_attachment probe scoped to (parent_object, parent_id): the probe wrapper injects the two-key filter the RelatedCountStore shape can't express, while the synthetic relationshipField keeps the cache key unique and the store's existing sys_attachment invalidation (MutationEvent bridge) updates the badge on upload/delete. - Tab label rides the existing KNOWN_LABEL_DICT (→ 附件). Verified in the browser against a showcase backend (authored page assignment temporarily detached, since showcase's demo project page overrides the tabs slot): tab strip renders 详情 / 相关 1 / 附件 1, the panel fills the tab, and the badge reflects a created+deleted sys_attachment row. Co-Authored-By: Claude Fable 5 <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.
Fixes objectstack-ai/objectstack#4358.
Problem
On
enable.files: truerecord detail pages (console 17.0.0-rc.0):RecordDetailViewappended it AFTER the schema-rendered page tree, whose synthesized default embedsrecord:discussionas the last main component — so the panel always sat below an ever-growing feed timeline, undiscoverable without scrolling to the very bottom, with no metadata knob to move it.detail.*keys (attachments,uploadAttachment,loadingAttachments,noAttachments,downloadAttachment,deleteAttachment, plus the fiveattachment*Denied/Requiredfriendly errors) existed only as inline EnglishdefaultValues; no locale bundle carried them, so non-English consoles always showed English.Fix
Placement — a peer Attachments tab (per design review):
buildDefaultTabsemits an Attachments tab (newrecord:attachmentsnode) between Related and Activity/History forenable.filesobjects; ahideAttachmentssynthesizer option suppresses it.RecordAttachmentsPanelvia RecordContext (registered from the app-shell barrel so Studio's PagePreview resolves it too).PageTabsRendererderives the tab's count badge from asys_attachmentprobe scoped to(parent_object, parent_id)— the probe wrapper injects the two-key filter theRelatedCountStoreshape can't express, while a syntheticrelationshipFieldkeeps the cache key unique; the store's existingsys_attachmentinvalidation (MutationEvent bridge) updates the badge live on upload/delete.KNOWN_LABEL_DICT(→ 附件 etc.).RecordDetailViewkeeps its legacy bottom append only as the fallback for authored pages that don't place the node (hasExplicitAttachmentswalker in pageSchemaIntrospect).i18n: all ten locales now define the eleven
detail.*keys.Verification
pnpm build43/43.sys_attachmentrow updates the badge; small screens keep the tab.showcase_projectpage overrides thetabsslot (authored full replacement), which legitimately supersedes the synthesized tab — verified by temporarily detaching that assignment locally.🤖 Generated with Claude Code