Skip to content

finding(plugin-gantt): columnWidthForContainer branches on container width and returns 110 from all three arms — the breakpoints it documents do nothing #7228

Description

@os-warren

Filed unassigned while working objectui#7203 (toolbar period label). Not in that PR's scope — different defect class, and it is an observation rather than a user-visible failure. Recording it so it is not lost.

What is there

packages/plugin-gantt/src/GanttView.tsx, measured on origin/main f626808d4:

function columnWidthForContainer(width: number) {
  // Day/week/month columns stay readable at a 110px floor — even in narrow
  // embeds (user-specified minimum). A short project still fills a roomy
  // timeline via the fit-stretch below; manual zoom can override either way.
  if (width < 640) return 110;
  if (width < 1024) return 110;
  return 110;
}

All three arms return the same value, so the function is () =&gt; 110 with two
branches that can never change the result. Its parameter is read only to be
compared against thresholds nothing acts on.

Why it is worth a card rather than a silent tidy

The comment above it explains a design (a readability floor that a fit-stretch
and manual zoom can move) and is accurate about the current behaviour, so
nothing here is broken today. What is misleading is the shape: a reader — human
or agent — sees a container-width breakpoint table and reasonably concludes the
gantt narrows its columns in small embeds. It does not. The sibling
taskListWidthForContainer and rowHeightForContainer directly beneath it use
the same breakpoints and DO vary, which makes this one read as an oversight in
a table of live values rather than as a deliberate flattening.

Two dispositions look reasonable and it is not my call which:

  1. Collapse it to a constant (or inline the 110) and keep the comment's
    explanation, so the code says what it does.
  2. Restore a real curve if the readability floor was meant to be
    width-dependent and got flattened by a later change — in which case the
    history is the evidence, not the current text.

Route 1 is mechanical. Route 2 needs someone who knows whether the flattening
was intentional, which is why this is a finding and not a queued fix.

Not in scope of, and not blocking, anything

Independent of the task-list width and date-sublabel decisions on the two open
cards for this file, and independent of the toolbar work — the toolbar period
label reads colOffsets, which is downstream of whatever this returns, and is
unaffected by which disposition wins.

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

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

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions