Repository navigation
refactor(app-shell): move ObjectView's renderListView into a sibling hook (slice 11a) - #26492
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>
…and header chrome into sibling hooks Move-only split of ObjectViewInner: the view tab items, ViewTabBar and its own-row face go to objectViewTabBar.tsx; the merged views and the plugin ObjectViewSchema go to objectViewPluginSchema.ts; the create button, folded header actions menu and refused-view face go to objectViewHeaderChrome.tsx. Each hook is called where its block stood. Claude-Session: https://claude.ai/code/session_01QciHBvFJXnhZqXmdqpDtpz Co-authored-by: Claude <noreply@anthropic.com>
… into sibling sub-components Move-only split of ObjectViewInner's JSX: the PageHeader block goes to ObjectViewPageHeader in objectViewPageHeader.tsx, and the non-split NavigationOverlay with its RecordDetailView goes to ObjectViewRecordOverlay in objectViewRecordOverlay.tsx. Every value is passed in as a prop; the rendered DOM is unchanged. Claude-Session: https://claude.ai/code/session_01QciHBvFJXnhZqXmdqpDtpz Co-authored-by: Claude <noreply@anthropic.com>
…hook Move-only split of ObjectViewInner: renderListView, the column-declaration flags and the held list identity refs only it reads, and the lazy ObjectChart it mounts go to useObjectViewListRenderer in objectViewListRenderer.tsx, called where renderListView stood. Six source-scan tests read the new file (path or file-list changes only). 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 11a of the move-only split; slices 1 to 10 landed as #26152, #26233, #26310, #26336, #26353, #26374, #26396, #26412 and #26434). Slice 11 is split in two, as the seat agreed: this PR moves
renderListView, and slice 11b (the view-config and view-tab CRUD handlers) closes the card.Clause-②: no
Metadata-protocol: none
What moved
Base
8cac64f2(slice 10 merged).ui/packages/app-shell/src/views/ObjectView.tsxis 2263 lines there. Three blocks ofObjectViewInnermove verbatim into one custom hook,useObjectViewListRenderer, in the new sibling moduleobjectViewListRenderer.tsx. Every input is passed as an argument, typed from its source (noany), and the component destructuresrenderListViewunder its original name. No identifier is renamed and no context is added.renderListView(lines 1145–1910). TheuseCallbackthe pluginObjectViewcalls to draw a view. It covers thetype: 'chart'face throughObjectChart, theListViewface with the relay of the view's keys ontofullSchema, the toolbar doors that write the user's own list state throughlistPrefs.patchView, the heldoptionsandfilteridentities, and the dependency list, all kept verbatim.activeTabDeclaresColumns,draftColumnsEdited,activeViewDeclaresColumnsandactiveViewIsSaved, with their docblocks. OnlyrenderListViewreads them.heldListOptionsandheldListFilter, the twouseRefs with their docblocks (objectui#10046, fix(showcase): atype: 'modal'target names a page —showcase_new_taskbecomes a form action (#6739) #7237). OnlyrenderListViewreads them.The hook is called where
renderListViewstood, after the view tab bar hook. The block it returns is unchanged.Hook order. The two
useRefcalls of M used to run beforeuseObjectViewTabBar(whoseuseViewTabsFitanduseDisplayLocalerun in between). They now run after it, inside the new hook. Both are independent refs initialised toundefined; nothing between their old and new positions reads them. The seat's ruling allows this shift when stated. G-columns are plain values, not hooks.The module also takes the lazy
ObjectChartdeclaration (lazy(() => import('@object-ui/plugin-charts')…)), verbatim. Its only mount is the chart face ofrenderListView, so the chart chunk stays lazy and is split exactly as before. TheImportWizardlazy declaration stays inObjectView.tsx.Imports
Each import moves with its only readers:
DENSITY_MODE_TO_ROW_HEIGHT,normalizeListViewSchema,buildListFilterKey,writeListFilterState,ListViewPreference,ListView,ListViewSchema,TreeViewConfig,useRef,ReactNode,resolveManagedByEmptyState,warnSuppressedListNav,substituteFilterTokens,keepInlineEditModeForTheSession, and the view-options family entries (timelineViewOptions,calendarViewOptions,ganttViewOptions,galleryViewOptions,kanbanViewOptions,storedLegacyOptions,isSameOptionsValue). The view-options names are still re-exported fromObjectView.tsx, lines unchanged. Names the component still reads elsewhere (useCallback,Suspense,lazy,isSavedViewId,FilterTokenScope) are imported by the module as well. Nothing new is exported fromObjectView.tsx, and the package entry is untouched.ObjectView.tsxgoes from 2263 to 1480 lines.Move-only proof: the multiset of non-blank lines of the base
ObjectView.tsxis contained in newObjectView.tsxplus the module. The only base lines missing are six import lines or entries that lost a moved name: thereact,@object-ui/core,../context/ListPreferencesProvider.js,@object-ui/typesand./objectViewChrome.jsimports, and thesubstituteFilterTokensentry of the helpers list. Each import is replaced by its trimmed form. Removed outright are the./listFilterStorage.js,@object-ui/plugin-list,../utils/managedByEmptyState.jsand../utils/warnSuppressedListNav.jsimports, theObjectChartlazy declaration, and the view-options entries of the./objectViewOptions.jsimport list. Their lines reappear verbatim in the module. The added lines are the trimmed imports and the new import, the module header and imports, the hook signature and parameter types, thereturn, and inObjectView.tsxthe call with its destructuring and two-line comment.Test edits
Six source-scan readers move to the file that now holds what they read. Each edit is a path or file-list change, and no assertion changed:
ObjectView.relayRungCensus-7559.test.ts:RELAY_SOURCEreadsobjectViewListRenderer.tsx(both candidate paths), the parse name follows, and so does the path in the anchor's error message. The census anchors onconst fullSchema = { … }inrenderListView.packages/types/src/__tests__/tree-view-config-readers-8253.test.ts:CONSOLE_COMPOSITION→packages/app-shell/src/views/objectViewListRenderer.tsx. It reads theviewDeftreelabelFieldrung.packages/types/src/__tests__/object-view-unmirrored-keys-7779.test.ts:APP_SHELL_OBJECT_VIEW→packages/app-shell/src/views/objectViewListRenderer.tsx. Its three reads are the app-shell relay (rowHeightthrough the fold,rowColor, and the absentallowExport/prefixField/densityModereads).ObjectView.titleFieldConvergence.test.tsx: the joinedSOURCElist['ObjectView.tsx', 'objectViewOptions.ts']gains'objectViewListRenderer.tsx'. The seams it counts span all three.ObjectView.overlayPatchOnly.test.ts:objectViewCodereadsObjectView.tsxandobjectViewListRenderer.tsxjoined. The retired-family absence covers both,handleViewConfigSavestays inObjectView.tsx, and the objectui#12474 doors (onDensityChange,persistHiddenFields) are in the module.view-filter-fold.ratchet.test.ts:objectViewSrcreadsObjectView.tsxandobjectViewListRenderer.tsxjoined. TheonFilterChangehandlers are in the module, andhandleViewConfigSavestays inObjectView.tsx.Slice 11b will add its module to the joined lists in 5 and 6, and re-point the
writeRefusalCensus-11583rows andcheck-i18n-call-site-keys.Seam table rows this PR changes (measured on
8cac64f2)The full table (regions A to Q) is in #26336.
8cac64f2viewDraft), F (baseView,derivedColumnViewIds,savedViews)renderListViewhandleViewConfigSave,handleViewCreate(andhandleViewUpdate, 829–836)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/(the calendar, gallery, gantt, timeline, kanban and chart bindings, relays, density, column and filter tests among them), theAppContent*tests, every other test that readsObjectView.tsxas source, including the six re-pointed ones, eslint on the touched files, the derived dispatch gates, and a Console build.Acceptance notes
no-explicit-any. The two files report 108 warnings against 107 for the baseObjectView.tsxalone. The one added warning isreact-refresh/only-export-componentsonobjectViewListRenderer.tsx: the module declares the lazyObjectChartcomponent and exports a hook. The declaration is kept verbatim with its only mount rather than reshaped. The twoexhaustive-depswarnings onhandleViewChangeonly moved lines. The six test edits add no warning.Changeset:
.changeset/25992-objectview-list-renderer-split.md(patch,@object-ui/app-shell).🤖 Generated with Claude Code
https://claude.ai/code/session_01QciHBvFJXnhZqXmdqpDtpz