Skip to content

feat(task-board): draw the columns the board says it has - #6716

Merged
viktormarinho merged 1 commit into
mainfrom
feat/board-renders-server-columns
Aug 28, 2026
Merged

feat(task-board): draw the columns the board says it has#6716
viktormarinho merged 1 commit into
mainfrom
feat/board-renders-server-columns

Conversation

@viktormarinho

@viktormarinho viktormarinho commented Aug 28, 2026

Copy link
Copy Markdown
Contributor

What is this contribution about?

#6710 taught the client to tolerate a column key it does not know. This teaches it to stop assuming it knows the set.

laneVisibility now takes the columns the board read returned, instead of starting from the hardcoded STATUSES:

const known = columns.map((c) => c.key).filter()

So an org that owns its board gets its own columns, in its own order, under its own names. useTaskBoardItems carries them through from TASK_BOARD_ITEM_LIST, and the board threads them into the lane renderer.

A board with no columns draws none. Falling back to Studio's lanes would file an org's cards under names nobody there chose — the exact failure this whole direction exists to remove — so the empty case is asserted first.

The delivery-lane and hidden-lane rules survive and still apply only to lanes Studio defined: isDeliveryLane is false for a key we did not invent, so those rules fall away on an org board with no special case for it.

A stale artifact this uncovered

packages/shared/src/tools/tool-io.ts was out of date on main. It still carried the closed status union that #6710 removed, and was missing the org_board_columns flag added in #6698.

Typecheck passed anyway, which is the interesting part: the API compiles against Zod, and a stale narrower union is a subset, so nothing on the server noticed. The client was the only thing being lied to — and the client is exactly where the contract matters. Regenerated here.

That also explains a bug it was hiding: TaskTab in home-tasks was Extract<TaskBoardItemStatus, "in_progress" | "in_review" | "done">. With status open, Extract from a bare string collapses to never and the strip silently reduced to a single "All" tab. Named outright now — those three are Studio's own lanes, which is what that strip is about.

How did you verify your code works?

Two new cases in config.test.ts, both about the thing that is new rather than the thing that already worked:

  • the org's own columns are drawn, in the server's order, using names that are not ours (BACKLOG, Fazendo, Code Review) — and with deliveryEnabled: false, asserting hidden and hideable are empty, i.e. Studio's lane rules do not leak onto a set it did not define;
  • a board with no columns draws none{ lanes: [], hidden: [], hideable: [] }, not the nine lanes.

The existing laneVisibility cases keep passing with an explicit CANONICAL column set, which is the honest way to say "these describe the board Studio ships".

apps/web/src + apps/api/src/tools/task-board: 3545 pass / 114 fail, against a baseline of 3543 / 114 measured by stashing and re-running — same failures, two more tests. bun run check 0 errors, bun run lint at baseline, knip clean, fmt:check clean.

Not verified, flagging honestly:

  • No live browser check. The lane renderer, the drag targets and the "Hidden columns" drawer all now read a server-provided list, and I have asserted the list-building function, not the rendering. With the flag off the list is byte-identical to before, which is what makes that acceptable — but I would look at a real board before enabling it anywhere.
  • title is still not used. Columns carry the tracker's own name and the client still renders laneLabel(key, t), which translates a canonical key and otherwise shows the raw key. For a Jira board that means "Code Review" renders as Code Review (the key happens to be the name) but a renamed column would show the old key. Wiring title through is small and belongs with the sync that first produces titles worth showing.
  • Archived cards on an org board have nowhere to go. archived is a Studio lane; an org board has no such column, so a card archived there would sit in no column. The FK does not catch it (board_column_org is null for those) and nothing renders it. Real, and it needs an answer before any org turns the flag on.

Screenshots/Demonstration

Not captured. With org_board_columns off — every org today — the board is unchanged.

How to Test

  1. With the flag off, the board is exactly as before: nine lanes, delivery lanes gated, Archived hidden behind the drawer.
  2. Set org_board_columns: true on a test org with no columns — the board should draw nothing, not Studio's lanes.
  3. Insert a few columns for that org and confirm they appear in position order, with their own names.

Migration Notes

None. No schema change. tool-io.ts is regenerated; the diff widens status to string and adds org_board_columns to the flags, both of which the server already accepted.

Review Checklist

  • PR title is clear and descriptive
  • Changes are tested and working
  • Documentation is updated (if needed)
  • No breaking changes

Summary by cubic

Makes the task board render the columns the board read returns instead of starting from the hardcoded Studio STATUSES. An org that owns its board now sees its own columns, in the server's order, and a board with no columns draws none rather than falling back to Studio's nine lanes.

New Features

  • Delivery-lane and hidden-lane rules still apply, but only to lanes Studio defined; isDeliveryLane is false for a key the client did not invent.
  • Org boards need the org_board_columns flag enabled; with it off, the board is unchanged.

Bug Fixes

  • tool-io.ts was stale on main — regenerated; status is now string and the missing org_board_columns flag is added, both of which the server already accepted.
  • TaskTab in home-tasks collapsed to never when Extracted from the open string status, silently leaving a single "All" tab; the three Studio lanes are now named outright.

Not verified: no live browser check, and column title is not yet rendered — a renamed column would show its raw key. A card moved to archived on an org board has nowhere to go, since that lane is Studio's.

Written for commit a892fb9. Summary will update on new commits.

Review in cubic

The client stopped assuming it knows every column in #6710; now it stops
assuming it knows the SET. `laneVisibility` takes the columns the board read
returned instead of starting from the hardcoded `STATUSES`, so an org that owns
its board gets its own columns, in its own order, under its own names.

A board with no columns draws none. Falling back to Studio's lanes would file
an org's cards under names nobody there chose, which is the failure this whole
direction exists to remove.

The delivery-lane and hidden-lane rules still apply, and still only to lanes
Studio defined — `isDeliveryLane` is false for a key we did not invent, so they
fall away on an org board without a special case.

Also regenerates the tool contracts, which were stale on main: `tool-io.ts`
still carried the closed status union #6710 removed and was missing the
`org_board_columns` flag. Typecheck passed anyway because the API compiles
against Zod and the stale union is a subset — the client was the only thing
being lied to, which is exactly where it matters.

`TaskTab` in home-tasks is named outright rather than `Extract`ed from a card's
status: extracting three literals from an open `string` collapses to `never`,
which silently reduced the strip to one tab.
@viktormarinho
viktormarinho merged commit 98eb4a3 into main Aug 28, 2026
34 checks passed
@viktormarinho
viktormarinho deleted the feat/board-renders-server-columns branch August 28, 2026 19:35
decocms Bot pushed a commit that referenced this pull request Aug 28, 2026
PR: #6716 feat(task-board): draw the columns the board says it has
Bump type: minor

- decocms (apps/api/package.json): 4.298.2 -> 4.299.0
- @decocms/native (apps/native/package.json): 4.298.2 -> 4.299.0
- @decocms/shared (packages/shared/package.json): 0.71.2 -> 0.72.0

Deploy-Scope: web
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant