Skip to content

refactor: remove five more dead prop chains - #7046

Merged
waleedlatif1 merged 4 commits into
stagingfrom
deslop-dead-props
Aug 24, 2026
Merged

refactor: remove five more dead prop chains#7046
waleedlatif1 merged 4 commits into
stagingfrom
deslop-dead-props

Conversation

@waleedlatif1

Copy link
Copy Markdown
Collaborator

Continues #7040 (isWorkflowRunning), which merged before these were ready. Same shape throughout: a prop declared, threaded through every layer by real callers, and never read at the end.

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.

# Chain Why it's worth removing
1 FieldItem.level a depth counter recursed through an arbitrarily deep tree
2 useMentionMenu({ onContextSelect }) a documented callback the hook never fires
3 SocialLoginButtons.isProduction required prop, 4-file chain, plus a now-unused return value
4 GroupedCheckboxList.title / .maxHeight the component overrides both with hardcoded copy
5 flatTagList an array carried alongside its own index map to a dead end
6 3 × useCustomBlock*(workspaceId) vestigial parameter on three mutation hooks

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 invokes addContextNotified itself at five sites.

Only the dead hand-off goes. addContextNotified and the ref sinks behind it stay: they serve those five live calls.

FieldItem.level is a required level: number the component never reads, and FieldTreeNodes exists largely to thread it — declared, destructured, passed down, incremented level={level + 1} on every recursion from a level={0} seed. Indentation comes from the nested wrapper divs (ml-1.5 pl-2.5), so nothing renders differently.

Notes on the rest

isProduction was a required prop on SocialLoginButtons, forwarded by both auth forms without either reading it. With the chain gone, getOAuthProviderStatus's isProduction return had no consumer either — /api/auth/providers already takes just the three availability flags — so the return value and its isProd import went too. verify-content.tsx genuinely branches on it and is untouched.

GroupedCheckboxList renders hardcoded Select PII Types to Detect and PII types while accepting a title it ignores, so a block author setting title gets silence, and maxHeight = 400 implies 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 to list(workspaceId), but lists() 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

  • The three useCustomBlock* hooks were reported as having zero callers (dead exports). They have callers — the search behind that claim omitted apps/sim/ee.
  • My own line patterns matched a live flatTagList on KeyboardNavigationHandler and a live title on Switch. tsc caught both before commit; both are restored and verified in the diff.

Verification

  • All 26 workspaces type-check; bun run lint:check exits 0
  • 1087 tests across app/workspace/home + /w, 446 in /w, 210 across hooks/queries + ee/custom-blocks
  • Every removal confirmed by grepping the receiver for the identifier: 2 occurrences (declaration + destructure) and nothing else

Net −59 lines.

… 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)
@vercel

vercel Bot commented Aug 24, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated (UTC)
docs Skipped Skipped Aug 24, 2026 8:08pm

Request Review

@cursor

cursor Bot commented Aug 24, 2026

Copy link
Copy Markdown

PR Summary

Low Risk
Refactor-only removal of unused props and parameters across UI and hooks; no auth logic, data handling, or runtime behavior changes beyond eliminating misleading APIs.

Overview
This PR continues the dead-prop cleanup: it removes six props/parameters that were threaded through real call sites but never read at the destination, net −59 lines with no behavior change.

Auth: Drops the unused isProduction chain from login/signup (getOAuthProviderStatus → forms → SocialLoginButtons), including the unused isProd import and return field.

Copilot / prompt editor: Removes onContextSelect from useMentionMenu — it was documented as the context-selection callback but the hook never invoked it; callers still add context via addContextNotified at pick/drop sites.

Workflow editor UI: Stops passing level through FieldTreeNodes / FieldItem (indentation stays on wrapper divs). GroupedCheckboxList no longer accepts title or maxHeight from block config (the component uses hardcoded PII copy). flatTagList is no longer passed into nested tag renderers; KeyboardNavigationHandler still receives it for keyboard nav.

Custom blocks: usePublishCustomBlock, useUpdateCustomBlock, and useDeleteCustomBlock drop the unused workspaceId argument; invalidation remains lists().

Reviewed by Cursor Bugbot for commit e12c716. Configure here.

@greptile-apps

greptile-apps Bot commented Aug 24, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

The 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.

  • Simplifies login and signup OAuth-provider data flow by dropping the unused production flag.
  • Removes unused recursive editor and dropdown props while retaining active rendering and keyboard-navigation inputs.
  • Removes an unused mention-menu callback and preserves the direct context-notification paths.
  • Simplifies custom-block mutation hooks while retaining list-family cache invalidation.

Confidence Score: 5/5

The 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.

Important Files Changed

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

@waleedlatif1
waleedlatif1 merged commit aba6811 into staging Aug 24, 2026
30 checks passed
@waleedlatif1
waleedlatif1 deleted the deslop-dead-props branch August 24, 2026 20:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant