Skip to content

feat(web): add tags support to task columns and localization - #667

Merged
pikann merged 5 commits into
masterfrom
feature/add-tags-support-for-views
Oct 30, 2026
Merged

pikann merged 5 commits into
masterfrom
feature/add-tags-support-for-views

Conversation

@pikann

@pikann pikann commented Oct 30, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Part of #641. Tags can now be used under Column by in Table and Board views, and — because fixing that exposed the same flaw for other groupings — the columns of every "Column by" option now come from the API, with each column loading its own tasks with pagination.

Why

Only Status, Sprint and Type had per-column API queries. Every other grouping (Assignee, Reporter, Importance, Tags, custom fields) fetched a single small page (5 tasks in Table) and built its groups client-side from those tasks. In a project where the first tasks have no tags, grouping by Tags showed only a "None" column; counts and "load more" were also wrong for the other groupings. A task with several assignees was only listed under its first assignee, and tasks with an unset checkbox field appeared in no column.

API (services/api)

  • GET /projects/{id}/tasks accepts group_by + group_key and returns only the tasks in that column. Supported: status, sprint, assignee, reporter, type, importance (bucket 0–4), tags and custom fields. __none / __backlog / __unassigned select the tasks without a value. The group is ANDed with all other filters, and the total count follows it. A custom field's type is resolved server-side.
  • New GET /projects/{id}/tasks/columns?column_by=… lists the columns that come from the data: tags, assignees, reporters and distinct values of free-valued custom fields (number sorted numerically). It takes the same filters as the task list, respects the caller's task read scope, and returns at most 100 columns. Fixed-column dimensions (status, sprint, type, importance) are rejected with 400.
  • An unset checkbox field counts as "No".

Web (apps/web)

  • Adds Tags to "Column by" (label added to all 9 locales). A task with several tags appears in each tag's column; untagged tasks go to "None". Tags is not a default visible field.
  • The layout fetches the view's columns from the API, then each column's tasks (paginated) via group_by/group_key, for every "Column by" option in Table and Board.
  • A task with several assignees now appears under each assignee; an unset checkbox appears under "No".
  • Roadmap (not paginated per column) falls back to grouping the loaded tasks by value, via a shared buildDynamicGroupDefs, so grouping by Tags no longer renders an empty Roadmap.

Not included

Testing

  • Go: new Postgres-backed tests for every group dimension (incl. unset values, composition with other filters, malformed keys) and for the columns query (view filters narrow columns, the listing's own group doesn't); handler tests for the new params/route. Ran the full internal/... suite, including the Postgres package.
  • Web: unit tests for the API params, API-listed columns, multi-assignee and checkbox grouping; tsc -b and the interaction/i18n tests pass.
  • Not yet checked in the browser against a real project.

Type of Change

  • Other (API + web: view grouping)

Checklist

  • The change is focused and scoped.
  • Related documentation is updated.
  • New structure or direction is explained clearly.
  • I avoided unnecessary detail or premature abstraction.

🤖 Generated with Claude Code

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ℹ️ No critical issues — one scoping note on where "Tags" is offered.

Reviewed changes

  • getTaskColumnKeys gains a tags branch: a task returns one key per non-empty tag, so it appears in each tag group; tagless tasks fall back to ["__none"] — apps/web/src/components/projects/interactions/view-utils.ts:257.
  • BUILTIN_COLUMN_BY gains the tags entry, surfacing Tags in the "Column by" dropdown — view-utils.ts:323.
  • All 9 locale files add the viewUtils.columnBy.tags label.

The Table and Board paths work as described: getColumnGroupDefs returns [] for tags (same as number/text custom fields), and both views build columns at render time from loaded task values, so multi-tag tasks land in every tag group and untagged tasks in "None".

ℹ️ "Tags" is offered for layouts that can't group by it

The "Column by" control is rendered for every layout (view-settings-panel.tsx:1471), but RoadmapView maps groupDefs straight into its group list with no dynamic fallback (roadmap-view.tsx:631). Since getColumnGroupDefs("tags") is [], a Roadmap view whose column_by is tags renders an empty task area while tasks still exist. This gap is pre-existing for number/text custom fields, but the new tags option makes it reachable for a built-in value — worth either hiding tags for the Roadmap layout or giving RoadmapView the same render-time fallback Table and Board use.

Technical details
# Roadmap groups empty when grouped by a dynamic ([]) column_by

## Affected sites
- `apps/web/src/components/projects/interactions/interaction-layout.tsx:2202` — passes the view's `columnBy` into `RoadmapView`.
- `apps/web/src/components/projects/interactions/roadmap-view.tsx:207` — `groupDefs = getColumnGroupDefs(columnBy, ...)` with no dynamic fallback.
- `apps/web/src/components/projects/interactions/roadmap-view.tsx:631` — `.map` over `groupDefs`; empty list renders no groups.
- `apps/web/src/components/projects/interactions/view-utils.ts:86` — `getColumnGroupDefs` has no `tags` branch (nor any for number/text), so returns `[]`.
- Compare `list-view.tsx:178` and `board-view.tsx:553`, which detect empty defs and synthesize columns from `getTaskColumnKeys`.

## Required outcome
A Roadmap view set to group by `tags` should either not offer `tags` (or other dynamic dimensions) in "Column by", or render the same per-value groups Table/Board produce.

## Suggested approach (optional)
- Simplest: filter `columnByOpts` by layout so dynamic-only values aren't offered on Roadmap.
- More complete: lift the Table/Board dynamic-group builder into `view-utils.ts` and reuse it in `RoadmapView`.
- Adding a small unit test for the new `getTaskColumnKeys(..., "tags", ...)` branch (multi-tag → all keys, no tags → `["__none"]`) in `view-utils.test.ts` would lock in the core new behavior.

Pullfrog  | Fix it ➔ | View workflow run | Using deepseek-v4.1-flash (free via Pullfrog for OSS) | 𝕏

…up columns

- Introduced `groupBy` and `groupKey` options in the ListTasks API to filter tasks by specific groups.
- Implemented `listTaskColumns` function to retrieve columns for a specified group-by dimension.
- Updated the TaskRepository interface and its implementation to support fetching group columns based on filters.
- Enhanced the TaskService to delegate group column retrieval to the repository.
- Added new tests for group filtering and column listing in both unit and integration test suites.
- Updated HTTP handlers to parse and handle new query parameters for grouping tasks and listing columns.

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Important

The new per-column grouping path hides tasks in two view configurations: Roadmap grouped by Tags (the buildDynamicGroupDefs fallback is unreachable) and any Board/List with Assignee swimlanes while Column by is Tags/Reporter/a free-valued custom field. Both are described inline.

Reviewed changes

  • API grouping: GET /projects/{id}/tasks gains group_by/group_key (status, sprint, assignee, reporter, type, importance, tags, custom fields, plus __none/__backlog/__unassigned sentinels), threaded through domain (TaskGroup), repo (applyTaskGroup), service and handler.
  • Columns endpoint: new GET /projects/{id}/tasks/columns?column_by=… lists data-derived columns (tags, assignees, reporters, free-valued custom fields), narrowed by the view's filters and read scope, and rejects fixed-column dimensions.
  • Web per-column pagination: Table/Board now fetch each column's tasks through group_by/group_key for every "Column by" value; API-listed dynamicColumns drive getColumnGroupDefs.
  • Roadmap grouping: adds buildDynamicGroupDefs so Roadmap can group the tasks it has loaded by value.
  • Multi-assignee / unset checkbox: a task now appears under every assignee; an unset checkbox counts as "No".
  • Tests: Postgres + handler tests for every group dimension and the columns query; web unit tests for the API params, API-listed columns and multi-assignee grouping.

Pullfrog  | Fix all ➔ | Fix 👍s ➔ | View workflow run | Using deepseek-v4.1-flash (free via Pullfrog for OSS) | 𝕏

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ No new issues found.

Reviewed changes

  • Cleared apiColumnsPending when the columns request errors, so the view falls back to grouping the tasks it can load instead of hanging on its skeleton.
  • Returned no tag columns from getColumnGroupDefs until the API lists them, which makes Roadmap's buildDynamicGroupDefs fallback reachable again for tagged tasks.
  • Stripped dynamicColumns inside getSwimlaneDefs, so Assignee swimlanes no longer inherit the column_by key space.
  • Made IsGroupKeyNone dimension-aware (sprint __backlog, assignee __unassigned, __none elsewhere, none for importance) and documented the sentinel contract.
  • Added Postgres group-key cases (importance has no sentinel, cross-dimension sentinel is an ordinary key, sprint sentinel) and web unit tests for empty tag columns and swimlane isolation.

All four issues from the previous review are addressed and their threads resolved.

Pullfrog  | View workflow run | Using deepseek-v4.1-flash (free via Pullfrog for OSS) | 𝕏

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ℹ️ No critical issues — two robustness notes inline on the new numeric grouping.

Reviewed changes

  • Added a truncated signal to the columns endpoint: MaxGroupColumns is shared from the domain, ListGroupColumns returns up to one extra row, and ListTaskColumns trims to the cap and reports truncated; the web view renders a banner when it is set.
  • Grouped number custom fields numerically — trim_scale(n)::text for the column key and ::numeric for the group filter — so 1 and 1.0 collapse into one column, with a guard for malformed keys.
  • Returned apierr.New(CodeBadRequest, …) instead of fmt.Errorf for the fixed-column dimensions.
  • Corrected buildColumnFilter to always return options (the | null and its dead caller guards are gone) and added the columnsTruncated string to all nine locales.

Pullfrog  | Fix all ➔ | Fix 👍s ➔ | View workflow run | Using deepseek-v4.1-flash (free via Pullfrog for OSS) | 𝕏

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ No new issues found.

Reviewed changes

This run re-reviewed the delta since the prior pullfrog review (f38f203 → 7866d47).

  • Replaced the strconv.ParseFloat malformed-key guard with decimalKeyRe, a Go mirror of customFieldNumericExpr's decimal grammar, so a hex-float group_key now selects nothing instead of reaching ::numeric and 500ing.
  • Routed the number custom-field group filter and the number columns listing through customFieldNumericExpr, removing the bare ::numeric cast whose safety depended on jsonb_typeof/predicate evaluation order.
  • Added a Postgres test case covering a hex-float number group key.

Pullfrog  | View workflow run | Using deepseek-v4.1-flash (free via Pullfrog for OSS) | 𝕏

@pikann
pikann merged commit 625db97 into master Oct 30, 2026
7 checks passed
@pikann
pikann deleted the feature/add-tags-support-for-views branch October 30, 2026 06:20
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.

[Feature suggestion]: Make tags and structured task metadata easier to use in Product Backlog views and MCP

1 participant