Skip to content

BoardTab and SettingsTab keep a 'fast path' prop nothing can ever supply — feed it or delete it #623

Closed

Description

@serge-ivo

What was found

GET /v1/instances/my/instances deliberately strips two capability fields before replying:

// workers/api/src/routes/instances.ts:315
const { boardColumns: _bc, settingsSchema: _ss, ...lightCaps } = fullCaps;

with a measured reason on the line above it — the full set cost ~83 KB for 28 instances, and the list only needs the routing fields. That is a considered decision and #617 did not touch it.

What #617 DID find is that my/instances is the only endpoint any consumer of the console's Instance type calls (pages/Dashboard.tsx:31, pages/Browse.tsx:39, pages/InstanceDetail.tsx:304, tabs/TeamworkSection.tsx:116). So InstanceDetail was passing two permanently-undefined props down:

boardColumns: instance?.capabilities?.boardColumns,      // always undefined
settingsSchema: instance?.capabilities?.settingsSchema,  // always undefined

SettingsTab.tsx:58-60 even documents the intent — "the schema prop is the fast path; the GET also returns fields so the form never depends on a stale instance-list cache" — for an optimisation that has never once fired.

Current state after #617

The two fields were removed from Instance.capabilities and the two pass-throughs deleted. Behaviour is unchanged, because both tabs already read the real values from their own fetch:

  • BoardTab.tsx:68 — serverCols?.length ? serverCols : (columns?.length ? columns : GENERIC_COLUMNS), with serverCols from /board.
  • SettingsTab.tsx:127 — if (d.fields?.length) setAgentFields(d.fields) from /settings.

But the props themselves (SurfaceCtx.boardColumns / .settingsSchema in lib/surfaces.tsx:56,58, threaded at :184, :200, :338) still exist and now have no supplier at all.

The decision this issue is for

Two coherent options; pick one rather than leaving a prop with no producer:

  1. Delete the chain. Remove boardColumns/settingsSchema from SurfaceCtx and from BoardTab/SettingsTab's props, so the second fetch is plainly the only path. Cheapest, and honest.
  2. Actually supply it. Fetch the full capabilities on the instance detail route (not the list), so the fast path exists for real. This is the only option that removes the first-paint flicker — the board briefly shows GENERIC_COLUMNS before /board answers, and the agent-settings block is briefly empty.

Option 2 is the only one with a user-visible benefit, and it is worth measuring first: both symptoms self-heal within one round trip, which is exactly why nobody has reported them.

Verified vs inferred

  • Verified: the strip at instances.ts:315 and its comment; that all four Instance consumers call only my/instances; both fallback lines; that no other code path assigns either prop.
  • Inferred: that the first-paint flicker is perceptible. Not measured — it may be invisible on a fast connection, which would settle this for option 1.

Files: store/console/src/lib/surfaces.tsx, store/console/src/tabs/BoardTab.tsx, store/console/src/tabs/SettingsTab.tsx, workers/api/src/routes/instances.ts

Activity

  1. added
    P2: correctnessReal defect, no live harm today — inert fields, miscounts, missing guards
    enhancementNew feature or request
    frontendFrontend / UI work
    on Aug 18, 2026
  2. serge-ivo commented on Aug 18, 2026

    @serge-ivo
    ContributorAuthor

    Audit — still LIVE, and the "no supplier" state is now documented in the code itself.

    Citation correction: the strip is at workers/api/src/routes/instances.ts:316, not :315 (line 315 is now const fullCaps = agentCapabilities({…})). Content unchanged:

    		const { boardColumns: _bc, settingsSchema: _ss, ...lightCaps } = fullCaps;

    The props still have no producer. store/console/src/lib/surfaces.tsx:56,58 still declare boardColumns?/settingsSchema? on SurfaceCtx, threaded at :184, :200 and :339; SettingsTab.tsx:56,60 still takes and seeds from settingsSchema. Nothing assigns either — InstanceDetail.tsx:1472 now carries the comment "No boardColumns/settingsSchema: my/instances strips both (#617, see lib/types)", which confirms the state deliberately rather than by absence.

    So the decision this issue exists for is unmade: option 1 (delete the chain) or option 2 (fetch full capabilities on the detail route). The issue's own note still applies — option 2 is the only one with a user-visible benefit, and it is worth measuring the first-paint flicker before choosing, because if it is imperceptible that settles it for option 1.

    Leaving open, labels unchanged.

  3. serge-ivo commented on Aug 29, 2026

    @serge-ivo
    ContributorAuthor

    Implemented as option 1 — delete the chain (commit 5586ba4).

    The decision: option 2 (feed the fast path) was only worth doing if the first-paint flicker was perceptible — and the issue itself noted that was unmeasured and possibly invisible on a fast connection. Deletion is honest and complete.

    What was removed:

    • boardColumns? and settingsSchema? from SurfaceContext (lib/surfaces.tsx)
    • columns prop from BoardTab (its column resolution simplifies to serverCols ?? GENERIC_COLUMNS)
    • settingsSchema prop and its useState seed from SettingsTab (the start value was always [] since no producer ever supplied it)
    • The stale "fast path" comment updated to record the resolution

    Both tabs still read the real values from /board and /settings. No behaviour change — only dead code removed.

    All gates green (10 150 unit tests pass; only the pre-existing pdf-lib failures).

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

    P2: correctnessReal defect, no live harm today — inert fields, miscounts, missing guardsenhancementNew feature or requestfrontendFrontend / UI work

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions