Skip to content

finding(plugin-gantt): three more declared-and-never-read residues sit in GanttView.tsx beside the tombstone #7421 removed #7512

Description

@os-project-manager

Found while implementing objectui#7421 (deleting the taskListWidth_LEGACY_REMOVED tombstone, PR objectui#7511). Filed unassigned, deliberately not fixed in that PR — same file, same defect class, but a separate unit of work and a separate reverse verification.

What is there

Measured on origin/main a27d153c2, all in packages/plugin-gantt/src/GanttView.tsx. Three bindings, none read anywhere in the repo:

const HEADER_HEIGHT = 50;                 // line 43
const COLUMN_WIDTH = 100; // Time column width   // line 44
const [currentDate, setCurrentDate] = React.useState(() => tzShift.now());   // line 873

Per-symbol readings, taken with a declaration-form probe and a read-site probe run separately, never a bare word count:

symbol declaration read sites, repo-wide
HEADER_HEIGHT 1, line 43 0git grep -l returns exactly one file, its own
COLUMN_WIDTH (the module const) 1, line 44 0 in GanttView.tsx; the 3 other files that spell the name each declare their own local const COLUMN_WIDTH = 110 for a test and import nothing
currentDate 1, line 873 0
setCurrentDate 1, line 873 0

Controls that fired in the same runs: taskListWidth → 20 read sites, rowHeight → 360. So the zeros above are readings, not a broken grep.

Neither module const is exported (grep -E 'export .*(HEADER_HEIGHT|COLUMN_WIDTH)' returns nothing), so there is no consumer outside the file either. ESLint already sees all four — @typescript-eslint/no-unused-vars, four of the 16 warnings this file carries — but unused vars are at warning severity here, so nothing fails.

Why it is worth a card rather than a silent tidy

Each one is a false signal of the same shape objectui#7421 recorded, and the two module consts are the more expensive kind because they carry plausible values:

  • COLUMN_WIDTH = 100 sits two lines from where a reader looks for the column width, and the value the gantt actually renders is 110, from columnWidthForContainer (see objectui#7228). A reader who trusts the constant reads the wrong number, and it is a different wrong number from the live one — the most costly kind of stale.
  • HEADER_HEIGHT = 50 reads as the header geometry contract; the real header height comes from elsewhere.
  • The currentDate useState pair is not merely inert like the finding(plugin-gantt): taskListWidth_LEGACY_REMOVED is a declared-and-never-read const null left behind by a finished refactor #7421 tombstone: the call still allocates state and still runs its tzShift.now() initializer on every mount. Nothing reads the value and nothing calls the setter, so the state exists purely to be allocated.

Reproduction

git grep -n 'HEADER_HEIGHT'          # one hit, the declaration
git grep -n 'COLUMN_WIDTH'           # GanttView.tsx has one hit; the 3 test files each declare their own
git grep -n 'setCurrentDate'         # one hit, the useState destructure

Suggested directions — none proposed as decided

  • A. Delete all four. Nothing reads them; the two module consts state values that are wrong as well as unread.
  • B. Delete the two module consts; keep the useState pair only if some in-flight work intends to wire a "current date" cursor (nothing in the tree suggests it does).
  • C. Leave them and lift @typescript-eslint/no-unused-vars to error for src/ so the class cannot regrow — a bigger change than this card, and it would need the existing warning backlog cleared first.

Related: objectui#7421 (the tombstone, same file, same class), objectui#7228 (columnWidthForContainer's three identical arms — the live 110 that makes COLUMN_WIDTH = 100 misleading), objectui#7332 (the change that put unused imports at error and left vars at warning).

Generated by Claude Code

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

domain:uiobjectui ui stream: fix lands on the published library or apps — objectui execution seatfindingpm:dispatchedpriority:p3

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions