Repository navigation
refactor(app-shell): move ObjectView's list toolbar affordances into a sibling hook (slice 7) - #26374
Merged
Merged
Conversation
…tViewOptions.ts (slice 2) The timeline/calendar/gantt/gallery/kanban ViewOptions, storedLegacyOptions, isSameOptionsValue and dispatchViewPatches move verbatim out of views/ObjectView.tsx into views/objectViewOptions.ts. ObjectView.tsx imports them back and re-exports every name it exported before. Test edits forced by the move: the four source scans that read the ObjectView face (calendarBinding-7029, galleryBinding-7547, ganttBinding-7070, titleFieldConvergence) now read ObjectView.tsx plus objectViewOptions.ts, and the writeRefusalCensus-11583 LEDGER row for dispatchViewPatches is keyed by its new file. Claude-Session: https://claude.ai/code/session_01QciHBvFJXnhZqXmdqpDtpz Co-authored-by: Claude <noreply@anthropic.com>
…ome.tsx (slice 3) ObjectNotFoundState, the saved-view tab strip's viewport check (VIEW_TABS_MIN_WIDTH, viewTabsFitNow, useViewTabsFit) and keepInlineEditModeForTheSession move verbatim out of views/ObjectView.tsx into views/objectViewChrome.tsx. ObjectView.tsx imports them back and re-exports ObjectNotFoundState, the one name it exported. No test edits. Claude-Session: https://claude.ai/code/session_01QciHBvFJXnhZqXmdqpDtpz Co-authored-by: Claude <noreply@anthropic.com>
…unt into a sibling hook Slice 4 of the move-only ObjectView split. The realtime subscription, the reconnection conflict resolution and the footer record-count fetch move verbatim from ObjectViewInner into useObjectViewLiveData in views/objectViewLiveData.ts. The component calls the hook at the same position (hook order unchanged) and passes its inputs explicitly; the recordCount state stays in the component. No test edits. Claude-Session: https://claude.ai/code/session_01QciHBvFJXnhZqXmdqpDtpz Co-authored-by: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QciHBvFJXnhZqXmdqpDtpz Co-authored-by: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QciHBvFJXnhZqXmdqpDtpz Co-authored-by: Claude <noreply@anthropic.com>
…igation into sibling hooks Slices 5 and 6 of the move-only ObjectView split, paired in one PR. - The identity-import gate, its password-policy state and data source, and the managed-environment Users marker move verbatim into useObjectViewIdentity in views/objectViewIdentity.tsx. - The record navigation overlay (detail navigation config, drawer recordId URL state, row click, expand to page, list record links) moves verbatim into useObjectViewRecordNavigation in views/objectViewRecordNavigation.ts. The URL equality filters and the user-filter selections between its two blocks stay in the component. Inputs are passed explicitly; the component destructures the returned values under their original names. No test edits. Claude-Session: https://claude.ai/code/session_01QciHBvFJXnhZqXmdqpDtpz Co-authored-by: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QciHBvFJXnhZqXmdqpDtpz Co-authored-by: Claude <noreply@anthropic.com>
…m their sources activeView, objectDef and objects were written as `any` in the new hook's parameter type. They now name where the component gets each value: the element of buildViewTabs' result, and ConsoleObjectViewProps['objects'] and its element. No new no-explicit-any warning; the moved bodies are unchanged. Claude-Session: https://claude.ai/code/session_01QciHBvFJXnhZqXmdqpDtpz Co-authored-by: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QciHBvFJXnhZqXmdqpDtpz Co-authored-by: Claude <noreply@anthropic.com>
…a sibling hook Slice 7 of the move-only ObjectView split. The environment list's entitlements, the list actions and their localized toolbar copies, and the create and import buttons' toolbar-scope predicates move verbatim into useObjectViewToolbarAffordances in views/objectViewToolbarAffordances.ts. The resolveAffordance verdict memo stays in the component (the affordance grant census reads it there) and is passed in with the other inputs, typed from their sources. No test edits. Claude-Session: https://claude.ai/code/session_01QciHBvFJXnhZqXmdqpDtpz Co-authored-by: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QciHBvFJXnhZqXmdqpDtpz Co-authored-by: Claude <noreply@anthropic.com>
Contributor
Author
席位核对 · ACCEPT · seat
|
This was referenced Oct 27, 2026
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.
Requested by Steve · project thread
Part of #25992 (slice 7 of the move-only split; slices 1 to 6 landed as #26152, #26233, #26310, #26336 and #26353, and the card stays open for the slices listed below).
Clause-②: no
Metadata-protocol: none
What moved
Base
3db7bbfc(slices 5+6 merged).ui/packages/app-shell/src/views/ObjectView.tsxis 2926 lines there. Concern D of the seam table, the list toolbar's affordances, moves verbatim into the custom hookuseObjectViewToolbarAffordancesin a new sibling moduleui/packages/app-shell/src/views/objectViewToolbarAffordances.ts. It moves in two blocks:isEnvironmentList,useEnvironmentEntitlements), the read gate on the object's list actions (listActionsReadable,listActions), andlocalizedToolbarActions,objectCanCreate,createVisible,createDisabled),listAddRecordOpensCreate,pageOffersCreatewith the capability gate and predicate scope it reads, and the import predicates (objectCanImport,importVisible,importDisabled), with every docblock.The hook is called as
useObjectViewToolbarAffordances({ objectDef, dataSource, actionRuntime, refreshKey, perms, localizeActionTexts, newVerdict, importVerdict }). It returns the twelve names the rest of the component reads, and the component destructures them under their original names. No identifier is renamed and no context is added. The parameters are typed from their sources, with noany:ConsoleObjectViewProps['objects'][number],DataSource,Pick<ConsoleActionRuntime, 'authFetch'>,ReturnType<typeof usePermissions>,ReturnType<typeof useActionTextLocalizer>, andReturnType<typeof resolveAffordance>for both verdicts.What stays. The verdict memo between the two blocks (lines 536–557:
newVerdictandimportVerdictfromresolveAffordance('listNew' | 'listImport', …)) stays in the component and is passed in.affordanceGrantMap-12082.test.tsxkeys thelistImportrow's reader by file: the write siteImportWizard > legacyImport :: createnamesObjectView.tsxas a file that readslistImport, and every file it names must read one of its rows. Keeping theresolveAffordancecall here keeps that census green with no test edit. The three-line comment onrefreshKeyafter the memo stays too.Hook order. The hook is called right after the verdict memo, so the first block's hooks (
useEnvironmentEntitlements, thelocalizedToolbarActionsmemo) now run after that memo instead of before it. They share no value with it, the order is the same on every render, and no effect sits between them, so the effects' order is unchanged.Imports. Each import moves with its only readers:
useRowPredicate,useCapabilityGate,usePredicateScope,RowCrudPredicates,listToolbarDrawsAction,mayReadObjectanduseEnvironmentEntitlements. Nothing new is exported fromObjectView.tsx, and the package entry is untouched.ObjectView.tsxgoes from 2926 to 2797 lines.Move-only proof: the multiset of non-blank lines of the base
ObjectView.tsxis contained in newObjectView.tsxplusobjectViewToolbarAffordances.ts. The only base lines missing are the two import lines that lost a moved name (managedByEmptyState.js,@object-ui/react), each replaced by its trimmed form. The added lines are the trimmed imports and the new import, the module header and imports, the hook signature and parameter types, thereturnobject, and inObjectView.tsxthe call with its destructuring and two-line comment.Test edits
None.
affordanceGrantMap-12082is covered by keeping the verdict memo in place (above). No other source reader ofObjectView.tsxnames a moved line.Seam table rows this PR changes (measured on
3db7bbfc)The full table (regions A to Q) is in #26336.
3db7bbfclocalizeActionTexts), C (objectDef,perms,refreshKey,actionRuntime), D-verdicts, propdataSourceresolveAffordanceverdicts forlistNewandlistImportobjectDef,perms)Remaining slices (the last closes the card)
ObjectView.urlFilterSuffix-9196.test.tsto the new file as a path-only edit if L-filter moves.PageHeader, import wizard andNavigationOverlayblocks into sub-components with explicit props.renderListView, with thewriteRefusalCensus-11583rows and therelayRungCensus-7559read re-pointed (path and file-key changes only).Verification
See the os-dev-report comment on the card for the full readings: app-shell
type-checkafter rebuilding its dependency closure, everyObjectView.*test inviews/, theAppContent*tests, every other test that readsObjectView.tsxas source, the app-shell tests that touch environment entitlements, the managed-by empty state, the object read gate or the CRUD affordances, eslint on the 2 touched files, the derived dispatch gates, and a Console build.Acceptance notes
ObjectView.tsxalone; the two in the new module are casts moved verbatim ((import.meta as any).env, the(a: any)map callback).Changeset:
.changeset/25992-objectview-toolbar-affordances-split.md(patch,@object-ui/app-shell).🤖 Generated with Claude Code
https://claude.ai/code/session_01QciHBvFJXnhZqXmdqpDtpz