Repository navigation
refactor(app-shell): move ObjectView's realtime refresh and record count into a sibling hook (slice 4) - #26336
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>
Contributor
Author
席位核对 · ACCEPT · seat
|
This was referenced Oct 26, 2026
refactor(app-shell): move ObjectView's list toolbar affordances into a sibling hook (slice 7)
#26374
Merged
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 4 of the move-only split, the first slice inside
ObjectViewInner; slices 1 to 3 landed as #26152, #26233 and #26310, and the card stays open for the slices listed below).Clause-②: no
Metadata-protocol: none
What moved
Base
e6381930(slice 3 merged).ui/packages/app-shell/src/views/ObjectView.tsxis 3171 lines there: imports, re-exports,ConsoleObjectViewProps, theObjectViewwrapper, andObjectViewInnerfrom line 222 to the end.This slice moves concern K of the seam table below, verbatim, into a custom hook
useObjectViewLiveDatain a new sibling moduleui/packages/app-shell/src/views/objectViewLiveData.ts:object:<name>that callsrefreshData()when the server reports a change,useConflictResolution, server-wins),dataSource.find(name, { $top: 0 })intosetRecordCount), with its whole comment block.ObjectViewInnercallsuseObjectViewLiveData({ dataSource, objectDef, refreshData, refreshKey, setRecordCount })at the exact place the moved lines stood, so the order of React hooks in the component does not change. TherecordCountstate stays in the component (line 413), because the JSX return reads it; the hook gets its setter and every other input as arguments. No identifier is renamed, no new context is added, and the hook declares no state. The@object-ui/collaborationimport moves with its only two readers. Nothing new is exported fromObjectView.tsx, and the package entry is untouched.ObjectView.tsxgoes from 3171 to 3123 lines.Move-only proof: the multiset of non-blank lines of the base
ObjectView.tsxequals newObjectView.tsxplusobjectViewLiveData.ts. Nothing is missing. The only added lines are the new module's header comment, its three imports, the hook's signature and parameter type (6 lines) and closing brace, and inObjectView.tsxthe new import plus the call with its two-line comment.Test edits
None. No test reads the moved lines as source (checked every
readFileSyncreader ofObjectView.tsx), and the tests thatvi.mock('@object-ui/collaboration')mock the module, so they cover the hook's import too.Seam table of
ObjectViewInner(measured one6381930)Lines are in the base file. "Reads" lists inputs from other regions (props
dataSource,objects,onEdit,externalRefreshKeyare left out). "Read by" lists the regions that use what a region declares.objectName,viewId,t,navigate,location,searchParams,servedViews,viewLabel,metadataClient,previewDraftshandleViewConfigSave,handleViewCreateviewDraft, panel/dialog open state, the two handlersobjectDef,setRefreshKey)objectDef, favourite, refresh key, action runtimerecordCount,objectDef,user,perms,isAdmin,refreshKey,refreshData,actionRuntimelistActions,createVisible/Disabled,importVisible/Disabled,objectCanCreate/Import,isEnvironmentList,localizedToolbarActionsactions)showImport,identityImportEnabled,identityDataSource,identityPasswordPolicy,managedUsers,managedUserMarkert), CsavedViews,listPrefs,viewOverrides,views,activeView,activeViewId,viewAccessviewDraft), CheaderToolbarActions,toolbarBar,toolbarActionsWithDeepLink,activeViewDeclaresColumns,activeViewIsSavedwriteListUrlState,listSeedRef,listIdentityKey,handleViewUpdate,handleResetViewsetViewDraft), C, FhandleViewChange,handleAddView,handleRenameView,handleDeleteView,handlePinView,handleSetDefaultView, …actions,filterScopeobjectDef,refreshData,refreshKey,setRecordCount)navOverlay,handleRowClick,handleDrawerClose,urlFilters,listRecordActionsheldListFilter,heldListOptionsviewTabBar,viewTabRow,viewTabItemsrenderListViewrenderListViewObjectViewschema, create button and FAB, folded menu and header actionsobjectViewSchema,createButton,foldedHeaderActions,listFabClearance,refusedViewFacePageHeader, FAB, import wizard, tabs, content,NavigationOverlay)Remaining slices (one PR each; the last closes the card)
PageHeader, import wizard andNavigationOverlayblocks into sub-components with explicit props.renderListView. They are pinned by file and symbol inwriteRefusalCensus-11583.test.ts(handleViewConfigSave,handleViewCreate,handleRenameView,handleDeleteView,handlePinView,handleSetDefaultView) and byObjectView.relayRungCensus-7559.test.ts(renderListView). Moving them needs those census rows re-keyed to the new file, which is more than the import-path edits the card allows; slice 2 had that allowance for one row. If the seat does not grant it, slice 10 closes the card and B, I and O stay inObjectView.tsxas the component's core.A, C, F and J stay in the component in every plan: they are the shared state most other concerns read. Each later slice re-measures the line spans and the source-scan pins at its claim, because the file moves daily.
Verification
See the os-dev-report comment on the card for the full readings: app-shell
type-check, everyObjectView.*test inviews/, theAppContent*tests, every other test that readsObjectView.tsxas source, eslint on the 2 touched files, the derived dispatch gates, and a Console build.Acceptance notes
react-hooks/exhaustive-depsin the moved record-count effect now namessetRecordCount, because the rule only treats auseStatesetter as stable inside the component that declares it. The dependency array is kept verbatim because the slice is move-only; the setter is still the component's stableuseStatesetter.Changeset:
.changeset/25992-objectview-live-data-split.md(patch,@object-ui/app-shell).🤖 Generated with Claude Code
https://claude.ai/code/session_01QciHBvFJXnhZqXmdqpDtpz