Repository navigation
refactor(app-shell): move ObjectView's header toolbar and list URL state into sibling hooks (slice 8) - #26396
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>
Claude-Session: https://claude.ai/code/session_01QciHBvFJXnhZqXmdqpDtpz Co-authored-by: Claude <noreply@anthropic.com>
…ate into sibling hooks Slice 8 of the move-only ObjectView split. - The header's list_toolbar actions (less the record-scoped ones the selection bar carries), the nav runAction deep link and the action:bar node move verbatim into useObjectViewHeaderToolbar in views/objectViewHeaderToolbar.ts. - The list's uf_ URL state (seed, write-back, Reset view) moves into useObjectViewListUrlState, and the filter[...] equality filters with the restored user-filter selections into useObjectViewUrlFilters, both in views/objectViewListUrlState.ts. Hook parameters are typed from their sources. One test edit, path only: ObjectView.urlFilterSuffix-9196 reads objectViewListUrlState.ts, where the scanned block now lives. 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 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 8 of the move-only split; slices 1 to 7 landed as #26152, #26233, #26310, #26336, #26353 and #26374, and the card stays open for the slices listed below).
Clause-②: no
Metadata-protocol: none
What moved
Base
fa5d72e1(slice 7 merged).ui/packages/app-shell/src/views/ObjectView.tsxis 2796 lines there. Three concerns ofObjectViewInnermove verbatim into custom hooks in two new sibling modules. In each, every input is passed as an argument, typed from its source (noany), the component destructures the returned values under their original names, no identifier is renamed and no context is added.G: the header toolbar →
objectViewHeaderToolbar.tsLines 798–874 move into
useObjectViewHeaderToolbar({ activeView, localizedToolbarActions, isEnvironmentList }):bulkWiredNamesKey,headerToolbarActions(thelist_toolbaractions less the record-scoped ones the selection bar carries, objectui#12462), the navrunActiondeep link (useOfferedNavRunAction,toolbarActionsWithDeepLink) and thetoolbarBaraction:barnode. It returnsheaderToolbarActions,toolbarActionsWithDeepLinkandtoolbarBar.The column-declaration flags right after it (lines 875–899:
activeTabDeclaresColumns,draftColumnsEdited,activeViewDeclaresColumns,activeViewIsSaved) stay. OnlyrenderListViewreads them, so they go with it in slice 11.H: the list's toolbar state in the URL →
objectViewListUrlState.tsLines 900–1015 move into
useObjectViewListUrlState({ objectName, objectDef, activeView, listPrefs, perms, user, searchParams, setSearchParams }). That covers the objectui#11860 docblock,listResetGeneration,listIdentityKey, the seed refs and the render-time seed, the write-back effect,writeListUrlState,activeViewHasPreferenceandhandleResetView. It returnslistIdentityKey,listSeedRef,ownListParamsRef,writeListUrlState,activeViewHasPreferenceandhandleResetView.handleViewUpdate, which follows, stays: it writes the config panel's draft.L-filter: URL equality filters and user-filter selections →
objectViewListUrlState.tsLines 1289–1359 move into
useObjectViewUrlFilters({ searchParams, setSearchParams, listIdentityKey, ownListParamsRef }), in the same module:filterParams,filterParamsKey,urlFilters(throughparseUrlEqualityFilterTriples),ufSelectionsRef,initialUfSelectionsandhandleUserFilterSelectionsChange. It returnsurlFilters,initialUfSelectionsandhandleUserFilterSelectionsChange. It takeslistIdentityKeyandownListParamsReffrom the list URL state hook, which is the same coupling the block had with H inside the component.Each hook is called where its block stood, so the order of React hooks in the component is unchanged.
Imports
Each import moves with its only readers.
isRecordScopedAction,actionRendersAt,useOfferedNavRunActionandbulkWiredActionNamesKeygo to the header module. The whole./userFilterUrlState.jsimport,readListFilterState,parseUrlEqualityFilterTriplesandselectFilterParamsgo to the list URL module.selectFilterParamsis still re-exported fromObjectView.tsx, line unchanged. Nothing new is exported fromObjectView.tsx, and the package entry is untouched.ObjectView.tsxgoes from 2796 to 2554 lines.Move-only proof: the multiset of non-blank lines of the base
ObjectView.tsxis contained in newObjectView.tsxplus the two modules. The only base lines missing are five import lines or import-list entries that lost a moved name: the@object-ui/core,./listFilterStorage.jsand@object-ui/types(actionRendersAt) imports, and theselectFilterParamsandbulkWiredActionNamesKeyentries. The@object-ui/coreand./listFilterStorage.jslines are replaced by their trimmed forms. The added lines are the trimmed imports and the two new imports, the module headers and imports, the hook signatures and parameter types, thereturnobjects, and inObjectView.tsxthe three calls with their destructuring and two-line comments.Test edits
One, path only, as the seat allowed:
ObjectView.urlFilterSuffix-9196.test.ts, describe "objectui#9196 —ObjectViewno longer keeps a private reader of this family":readFileSync(path.join(here, 'ObjectView.tsx'), 'utf8')→readFileSync(path.join(here, 'objectViewListUrlState.ts'), 'utf8'). The block it scans (const urlFilters,parseUrlEqualityFilterTriples, the./drillUrlFilters.jsimport, nofilter\[regex literal) now lives there. No assertion changed.No other source reader of
ObjectView.tsxnames a moved line.Seam table rows this PR changes (measured on
fa5d72e1)The full table (regions A to Q) is in #26336.
fa5d72e1runActiondeep link,action:barnodelocalizedToolbarActions,isEnvironmentList), F (activeView)viewDraft), FobjectDef,perms,user), F (activeView,listPrefs)filter[...]equality filters,uf_*user-filter selectionslistIdentityKey,ownListParamsRef)Remaining slices (the last closes the card)
PageHeader, import wizard andNavigationOverlayblocks into sub-components with explicit props.renderListViewand the column flags only it reads. ThewriteRefusalCensus-11583rows and therelayRungCensus-7559read are re-pointed (path and file-key changes only).check-i18n-call-site-keys.test.tsalso readsObjectView.tsxfor thedeleteViewConfirmcall site inhandleDeleteView, and is re-pointed the same way.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 the list URL state, list filter storage, list preferences,drillUrlFiltersor the navrunAction, eslint on the 4 touched files, the derived dispatch gates, and a Console build.Acceptance notes
no-explicit-any. The hook boundary adds three warnings that the same code did not raise inside one component, with dependency arrays kept verbatim because the slice is move-only:react-hooks/exhaustive-depsonhandleUserFilterSelectionsChange:ownListParamsRefnow arrives as a parameter, and the rule only treats auseRefas stable inside the hook that declares it. It is the same ref object, so leaving it out of the deps changes nothing.react-hooks/refstwice, on thereturnofuseObjectViewUrlFilters(aturlFiltersandinitialUfSelections).initialUfSelectionsis read fromufSelectionsRefduring render, as it was in the component, and the rule flags the values a hook returns from a render that reads a ref.The four files report 132 warnings, against 129 for the base
ObjectView.tsxalone.Changeset:
.changeset/25992-objectview-header-list-url-split.md(patch,@object-ui/app-shell).🤖 Generated with Claude Code
https://claude.ai/code/session_01QciHBvFJXnhZqXmdqpDtpz