Uh oh!
There was an error while loading. Please reload this page.
refactor(plugin-gantt): drop three unread declarations from GanttView - #7522
Merged
Merged
Conversation
`GanttView.tsx` carried three declarations (four bindings) that nothing read: - `HEADER_HEIGHT` and `COLUMN_WIDTH` — module-level constants with zero readers repo-wide. Lazy bindings: removing them has no runtime effect. - `const [currentDate, setCurrentDate] = React.useState(() => tzShift.now())` — not the same class. This one allocated a state slot and ran the `tzShift.now()` initializer on every mount while neither binding was ever referenced, so removing it does have a (tiny) runtime effect — and no observable one, since nothing rendered from it and nothing could set it. None of the four were exported. `tzShift` keeps 27 other readers in the file, so its import stays live. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01EMrWaQw3XS5DxTHxp4yRyC
Contributor
✅ Console Performance Budget
The eager closure is every chunk the entry reaches through static imports — what the browser fetches and parses before the app renders. The entry chunk on its own is a small fraction of it. 📦 Bundle Size Report
Size Limits
|
os-project-manager
marked this pull request as ready for review
September 3, 2026 16:45
Uh oh!
There was an error while loading. Please reload this page.
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 freeto 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.
Fixes#7512
Deletes three declarations (four bindings) from
packages/plugin-gantt/src/GanttView.tsxthat nothing read. Option A of the three the card offered, on the maintainer's ruling. 4 deletions, 0 insertions in source.Two different classes, not one
The card and this PR keep them apart deliberately:
HEADER_HEIGHT/COLUMN_WIDTHare lazy module constants. An unread module binding costs nothing at runtime, so removing them changes no behaviour whatsoever. Their cost was purely as a false signal —COLUMN_WIDTH = 100sits beside code whose live column width is 110.const [currentDate, setCurrentDate] = React.useState(...)was live. Every mount allocated a state slot and executed thetzShift.now()initializer, while neither the value nor the setter was ever referenced. Removing it has a real (if tiny) runtime effect — and no observable one: nothing rendered from the value and nothing could call the setter, so no output, prop, or timing a consumer can see moves.Lumping these into one sentence of "all dead code" would misstate the second.
Readings, re-measured on this PR's base (
a27d153c2)Every zero below was taken with a declaration-form probe and a whole-word read-site probe run separately, each with a control that lit up in the same run.
HEADER_HEIGHTgit grep -lw RESIZE_EDGE_PXreturned 2 filesCOLUMN_WIDTHGanttView.tsx; 8 / 5 / 4 lines in three sibling test files, each of which declares its ownconst COLUMN_WIDTH = 110and imports nothing (verified: 0 import lines mentioning the name in all three)TASK_LIST_MIN_Wat 7 linescurrentDateplugin-calendarpluspackages/types— thatcurrentDateis the CalendarSchema authorable key (packages/types/src/complex.ts:261), a different binding entirelytzShiftlit at 27 lines in the same filesetCurrentDateplugin-calendar/src/ObjectCalendar.tsxPublished surface: none of the four moves.
grep -nE 'export.*(HEADER_HEIGHT|COLUMN_WIDTH|currentDate|setCurrentDate)'over the file returns 0, with two controls lit in the same run:export const MS_PER_DAYmatched, and theexport {block query matched 3 lines insrc/index.tsx. The file has no trailing re-export block at all (its last line is the component's closing brace), andindex.tsxre-exportsGanttViewby name, so noexport *chain could carry a non-exported binding out. Two are module-scope, two are function-scope insideGanttView. No published symbol, prop, type, zod schema or spec key changes.tzShiftkeeps 27 whole-word readers in the file after the deletion, so its import stays live — the error-severity unused-import rule is not in play here.Reverse verification — ESLint, with a control that stays put
There is no honest behaviour pin to add for the removal of four bindings with zero readers, so the red/green is ESLint. Package-level
eslint .inpackages/plugin-gantt, before and after,--format json, exit code captured before any pipe (both runs exited 0 — this package is warning-only):GanttView.tsxa27d153c2)d4b093cd2)Exactly four messages disappeared, and none appeared:
The control that stays in place — same rule, same file, deliberately untouched:
It survives and shifts by exactly 4 lines, matching the 4 deleted lines. That tombstone belongs to objectui#7421 / PR objectui#7511 and is not touched here; objectui#7421 stays open for it.
Baseline note
The card quotes 16 warnings for this file and 353 for the package; this PR's base
a27d153c2measures 17 and 354. The difference is exactly thetaskListWidth_LEGACY_REMOVEDwarning above — the card's figures were taken on a tree where PR objectui#7511 had already removed the tombstone, and that PR had not landed onmainwhen this branch was cut. Every other figure in the card reproduced exactly.Verification run, all at
d4b093cd2Heavy steps went through the shared verify lock.
pnpm exec eslint .inpackages/plugin-gantt— exit 0, 350 problems / 0 errors (table above)pnpm --filter @object-ui/plugin-gantt run type-check(tsc --noEmit && tsc -p tsconfig.test.json) — exit 0, afterpnpm --workspace-concurrency=2 --filter '@object-ui/plugin-gantt^...' build(the first attempt failed only withTS2307: Cannot find module '@object-ui/components'— unbuilt dependency closure in a fresh worktree, not a finding)pnpm exec vitest run packages/plugin-gantt/ --maxWorkers=2, from the repo root — Test Files 62 passed (62), Tests 485 passed (485)node scripts/check-changeset-presence.mjs— exit 0, accepts the empty-frontmatter declarationnode scripts/check-changeset-fixed.mjs,node scripts/check-changeset-no-major.mjs— exit 0node scripts/check-control-bytes.mjs— exit 0 (6195 tracked text files scanned), plus a targeted control-byte grep over the two changed files: cleanLint scope was narrowed to this package, and here is the proof the narrowing excludes nothing. (1) The universe came from ESLint's own config, not a guess:
eslint .resolved the package's file set itself. (2) The count is read from--format json— 92 entries, identical in both runs. (3) The config cannot carry a verdict across files:grep -nE 'projectService|parserOptions|project:' eslint.config.jsreturns 0 (control: the same grep shape returns 9 lines forfiles:|ignores:in that same file), so type-aware linting is not enabled and a deletion inside one.tsxcannot move any untouched file's result. The added.changeset/*.mdis outside ESLint'sfiles: ['**/*.{ts,tsx}']entirely.Not measured here:
node scripts/check-readme-exports.mjsexits 1 in this worktree, but all 312 messages readtype entry ./dist/index.d.ts is not on disk -- run pnpm build first— the gate needs a full workspace build that this worktree does not have. That is a missing prerequisite, not a red gate; CI builds first and measures it there. None of the four deleted bindings appears in any README, since none was exported.Changeset
Empty frontmatter (
.changeset/7512-ganttview-unread-residues.md), which this repo treats as the explicit "releases nothing" declaration rather than an omission. Justification:plugin-ganttsource changed, so the presence gate demands a declaration; but no published symbol, prop, type or rendered output moves, and the one binding with a runtime cost had no observable effect. Same shape as PR objectui#7511.Out of scope
columnWidthForContaineris untouched. Its three arms all return 110, which is what madeCOLUMN_WIDTH = 100misleading — but that is objectui#7228's subject, and objectui#7228 remains open. Lifting@typescript-eslint/no-unused-varsto error (the card's option C) was ruled out for this unit of work; the package still carries 350 warnings.🤖 Generated with Claude Code
https://claude.ai/code/session_01EMrWaQw3XS5DxTHxp4yRyC
Generated by Claude Code