Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions .changeset/7421-gantt-tasklistwidth-tombstone.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
---
---

Removes the `taskListWidth_LEGACY_REMOVED` tombstone from `GanttView`, and records the fact
it was carrying at the site that owns it.

The line was one `const` bound to the literal `null` inside the component body, left behind
by the finished task-list-width refactor. Measured on `origin/main` `a27d153c2`, the
identifier appeared exactly once in the whole repo — its own declaration — and zero times in
a read position; the same probe run returned 20 read sites for the live `taskListWidth` and
360 for `rowHeight`, so the zero is a reading and not a broken grep. Nothing in the platform
repo declared it either. It carried no state, no side effect and no contract surface.

What it did carry was a false signal. A name spelling `_LEGACY_REMOVED`, sitting inside the
component a few hundred lines below the real width derivation, reads as a seam deliberately
retained for a reason recorded elsewhere, so the next reader goes looking for that reason.

Its trailing comment held one fact worth keeping — that the width now comes from the
container `useResizeObserver` — and that fact was stated nowhere at the observer call site.
It moves there rather than dying with the line: the observed container width is named as the
source the auto-sized row height, base column width and task-list pane width all derive
from. No behaviour changes, and nothing published moves.
4 changes: 2 additions & 2 deletions packages/plugin-gantt/src/GanttView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -872,6 +872,8 @@ export function GanttView({
const dateLocale = language || undefined;
const [currentDate, setCurrentDate] = React.useState(() => tzShift.now());
const containerRef = React.useRef<HTMLDivElement>(null);
// Observed container width — the source every auto-sized dimension below
// derives from: row height, base column width, and the task-list pane width.
const { width: containerWidth } = useResizeObserver(containerRef);
const effectiveWidth = containerWidth || (typeof window !== 'undefined' ? window.innerWidth : 1024);
const isNarrow = effectiveWidth < 640;
Expand Down Expand Up @@ -2320,8 +2322,6 @@ export function GanttView({
.filter((m) => m.valid);
}, [markers, timelineRange, dateToX]);

const taskListWidth_LEGACY_REMOVED = null; // taskListWidth now derived from useResizeObserver above

const headerRef = React.useRef<HTMLDivElement>(null);
const listRef = React.useRef<HTMLDivElement>(null);
const timelineRef = React.useRef<HTMLDivElement>(null);
Expand Down
Loading