refactor: remove five more dead prop chains - #7046
Conversation
… reads Same shape as the `isWorkflowRunning` removal: declared, required, threaded through every layer, and never read at the end of the chain. `SocialLoginButtons` declares `isProduction: boolean` as a REQUIRED prop and never reads it, so every caller had to produce and forward a value that was discarded. Neither `login-form` nor `signup-form` reads it either — each only declares it, destructures it, and passes it down. `signup-form` forwards it twice, through its own inner `SignupFormContent` hop. With the chain gone, `getOAuthProviderStatus` has no consumer for the `isProduction: isProd` it returned: the pages destructured it only to forward it, and `/api/auth/providers` already takes just the three availability flags. So the return value and its `isProd` import go too. `isProduction` stays alive where it is genuinely used — `verify-content.tsx` branches on it and hands it to `useVerification`, and imports `isProd` directly rather than through this helper. That path is untouched. Found by the rule enabled in #7037: it was the only `.tsx` unused-parameter warning in `apps/sim`. (cherry picked from commit 331c2ed)
Same shape as the two already in this PR, found by sweeping the rest of the
unused-parameter list for params callers actively compute and pass.
`FieldItem.level` is the worse of the two. It is a required `level: number` that
the component never reads, and `FieldTreeNodes` exists to thread it: declared,
destructured, handed to `FieldItem`, and incremented on every recursion
(`level={level + 1}`) from a `level={0}` seed. So a depth counter was carried
through an arbitrarily deep tree to feed a component that ignores it. Indentation
comes from the nested wrapper divs (`ml-1.5 pl-2.5`, `ml-3 pl-2.5`), not from the
counter — removing it changes no rendering.
`useMentionMenu`'s `onContextSelect` is a required prop carrying the TSDoc
"Callback when a context is selected". The hook never invokes it, so that
contract is unimplemented and a future caller would reasonably rely on it.
Only the dead hand-off goes there. `addContextNotified` stays: the caller invokes
it directly at five sites, and the ref sinks behind it keep its identity stable
for those. Context selection has always worked because the caller does the work
itself, not because the hook calls back.
(cherry picked from commit 110ba76)
`GroupedCheckboxList` declares `title` (required) and `maxHeight` and reads neither. It renders its own hardcoded copy instead — `Select PII Types to Detect` for the header and `PII types` for the field label — so a block author who sets `title` on a `grouped-checkbox-list` subBlock gets silence, and the `maxHeight = 400` default implies a scroll ceiling that is never applied. Both props go, along with the two values `sub-block.tsx` was passing. `flatTagList` was threaded through the recursive tag renderers to a dead end: declared on `NestedTagRendererProps`, inherited by `FolderContentsProps`, destructured in both, forwarded once more, and read by neither. Its real consumer is `flatTagIndexMap`, built from it at the top level and documented "Map from tag string to index for O(1) lookups" — so the array was being carried alongside its own index through arbitrary nesting depth. The top-level memo and its length checks stay; only the descent goes. Note the component's copy is PII-specific while its name and props present as generic. Renaming it is a separate call, not made here. Both removals were caught mid-flight by `tsc`: my line patterns also matched a live `flatTagList` on `KeyboardNavigationHandler` and a live `title` on `Switch`, which is exactly why the type-check runs before the commit and not after. (cherry picked from commit 5db44f3)
…ver use `usePublishCustomBlock`, `useUpdateCustomBlock` and `useDeleteCustomBlock` each take `workspaceId?: string` and never read it. `custom-block-detail.tsx` passes it to all three. The parameter looks like it was meant to narrow the invalidation to `customBlockKeys.list(workspaceId)`, but `lists()` is the level CLAUDE.md's targeted-invalidation rule actually prescribes, and it is a correct superset. So the invalidation is right as written and the parameter is simply vestigial — removing it is the honest fix, and narrowing the key would be a separate call with its own risk of under-invalidating. Worth recording that these three were reported to me as having zero callers and therefore being dead exports. They are not: the search that produced that claim omitted `apps/sim/ee`, where all three are used. (cherry picked from commit 2d0854a)
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
PR SummaryLow Risk Overview Auth: Drops the unused Copilot / prompt editor: Removes Workflow editor UI: Stops passing Custom blocks: Reviewed by Cursor Bugbot for commit e12c716. Configure here. |
Greptile SummaryThe PR removes several unused React prop chains, one unused hook callback contract, an unused OAuth status field, and vestigial custom-block mutation-hook parameters without changing the underlying behavior.
Confidence Score: 5/5The PR appears safe to merge because the removed values were unused and the active rendering, notification, navigation, and cache-invalidation paths remain intact. The changes consistently remove dead declarations and pass-through values without altering reachable component behavior or mutation cache coverage.
|
| Filename | Overview |
|---|---|
| apps/sim/app/(auth)/components/oauth-provider-checker.tsx | Removes the unused isProduction field from the provider-status result after its consumer chain was removed. |
| apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/copilot/components/user-input/hooks/use-mention-menu.ts | Removes a required callback that the hook never invoked, leaving its active message-editing behavior unchanged. |
| apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/editor/components/connection-blocks/connection-blocks.tsx | Removes the unused recursive depth prop while preserving wrapper-based tree indentation. |
| apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/editor/components/sub-block/components/grouped-checkbox-list/grouped-checkbox-list.tsx | Removes unused title and maximum-height props that did not affect the component's hardcoded presentation. |
| apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/editor/components/sub-block/components/tag-dropdown/tag-dropdown.tsx | Stops threading flatTagList through nested renderers while retaining it on the keyboard-navigation component that consumes it. |
| apps/sim/hooks/queries/custom-blocks.ts | Removes unused workspace parameters from mutation hooks while preserving invalidation of the complete custom-block list-key family. |
Reviews (1): Last reviewed commit: "refactor(custom-blocks): drop the worksp..." | Re-trigger Greptile
Found by sweeping the unused-parameter list the rule in #7037 exposed, then verifying each by hand — which mattered, because a third of the candidates did not survive.
FieldItem.leveluseMentionMenu({ onContextSelect })SocialLoginButtons.isProductionGroupedCheckboxList.title/.maxHeightflatTagListuseCustomBlock*(workspaceId)The two that are more than tidying
useMentionMenu({ onContextSelect })is a required prop carrying the TSDoc "Callback when a context is selected". The hook never invokes it, so that contract is unimplemented — and a future caller would reasonably rely on it. Context selection works only because the caller invokesaddContextNotifieditself at five sites.Only the dead hand-off goes.
addContextNotifiedand the ref sinks behind it stay: they serve those five live calls.FieldItem.levelis a requiredlevel: numberthe component never reads, andFieldTreeNodesexists largely to thread it — declared, destructured, passed down, incrementedlevel={level + 1}on every recursion from alevel={0}seed. Indentation comes from the nested wrapper divs (ml-1.5 pl-2.5), so nothing renders differently.Notes on the rest
isProductionwas a required prop onSocialLoginButtons, forwarded by both auth forms without either reading it. With the chain gone,getOAuthProviderStatus'sisProductionreturn had no consumer either —/api/auth/providersalready takes just the three availability flags — so the return value and itsisProdimport went too.verify-content.tsxgenuinely branches on it and is untouched.GroupedCheckboxListrenders hardcodedSelect PII Types to DetectandPII typeswhile accepting atitleit ignores, so a block author settingtitlegets silence, andmaxHeight = 400implies a scroll ceiling never applied. Separately worth knowing: the component's copy is PII-specific while its name and props present as generic. Renaming is a design call, not made here.useCustomBlock*(workspaceId)looks like it was meant to narrow invalidation tolist(workspaceId), butlists()is the level CLAUDE.md's targeted-invalidation rule prescribes and is a correct superset. So the invalidation is right and the parameter is vestigial; narrowing the key would be a separate call with its own under-invalidation risk.Two claims that did not survive verification
useCustomBlock*hooks were reported as having zero callers (dead exports). They have callers — the search behind that claim omittedapps/sim/ee.flatTagListonKeyboardNavigationHandlerand a livetitleonSwitch.tsccaught both before commit; both are restored and verified in the diff.Verification
bun run lint:checkexits 0app/workspace/home+/w, 446 in/w, 210 acrosshooks/queries+ee/custom-blocksNet −59 lines.