Skip to content

fix(ui): faithfully complete two approximated ListView filters (ADR-0017) - #28

Merged
os-zhuang merged 1 commit into
mainfrom
fix/faithful-listview-filters-adr0017
Jun 11, 2026
Merged

os-zhuang merged 1 commit into
mainfrom
fix/faithful-listview-filters-adr0017

Conversation

@os-zhuang

Copy link
Copy Markdown
Contributor

Background

PR #27 migrated the dashboard record-listing tables to object-bound ListViews (ADR-0017). Two of those migrations shipped with approximate filters because the precise semantics were awkward to express. This PR closes both out faithfully.

Does ListView filter support OR / disjunction? — No.

Investigated @objectstack/spec 9.0.0:

  • json-schema/ui/ViewFilterRule.json — a rule is { field, operator, value } with additionalProperties: false. No nested and/or group, no condition tree.
  • view.zod (view.zod-*.d.ts) — filter is typed everywhere as z.ZodOptional<z.ZodArray<{ field, operator, value }>>. Doc comment: "declarative array-of-objects format: [{ field, operator, value }]". The array is AND-combined.
  • No or-style operator exists in the spec, and there is zero OR usage anywhere in the repo's views.

Conclusion: disjunction (A OR B) cannot be expressed in a ListView filter. Pure-AND conditions are fully expressible.

Changes

(1) content — my_pieces ("My Pieces" tab)

Restores the former my_pieces_table widget.

  • Intended: (assignee == me OR assignee IS NULL) AND status IN (backlog, drafting, in_review, approved, scheduled)
  • Limitation: the OR assignee IS NULL (unclaimed-pickup) branch is unrepresentable — see above.
  • Faithful degradation: assignee == me AND status IN (...). Drops only the unassigned branch; the status set is reproduced exactly. Matches the existing my_drafts convention (assignee == current user). The limitation is documented inline in the view file.
  • columns ['title','status','format','publish_at'], sort publish_at asc.

(2) hr — my_pending_approvals ("Awaiting My Approval" tab)

Restores the former pending_time_off_table widget.

  • Filter: status == 'submitted' AND approver == current user — pure AND, reproduced exactly.
  • Distinct from the existing Pending tab, which shows all submitted requests.
  • columns ['employee','leave_type','start_date','end_date','days','submitted_at'], sort start_date asc.

Verification

All pass:

  • pnpm -r --filter='!@objectlab/all' run build
  • pnpm --filter @objectlab/all run clean && pnpm --filter @objectlab/all run compile
  • pnpm -r run typecheck

Both new tabs' view: references resolve to real listView names (my_pieces, my_pending_approvals).

🤖 Generated with Claude Code

…017)

PR #27 migrated the dashboard record-listing tables to object-bound
ListViews, leaving two filters as approximations. This closes them out.

content: add `my_pieces` listView + "My Pieces" tab restoring the former
`my_pieces_table` widget — status IN (backlog, drafting, in_review,
approved, scheduled). The original intent was (assignee == me OR assignee
IS NULL); the OR branch is unrepresentable because ListView `filter` is a
flat AND-only array of {field,operator,value} rules (ViewFilterRule is
additionalProperties:false, no and/or group, no disjunction operator in
@objectstack/spec 9.0.0). Faithfully degraded to assignee == me — matching
the existing `my_drafts` convention — with the limitation documented inline.

hr: add `my_pending_approvals` listView + "Awaiting My Approval" tab
restoring `pending_time_off_table` — status == 'submitted' AND approver ==
current user. Pure AND, so reproduced exactly; distinct from the existing
"Pending" tab which shows all submitted requests.

Verified: pnpm -r build (excl. @objectlab/all), @objectlab/all clean+compile,
and pnpm -r typecheck all pass.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@os-zhuang
os-zhuang merged commit 81f9663 into main Jun 11, 2026
3 checks passed
@os-zhuang
os-zhuang deleted the fix/faithful-listview-filters-adr0017 branch June 11, 2026 09:50
os-zhuang added a commit that referenced this pull request Jun 11, 2026
)

docs/platform-issue-table-widget-warning.md was an untracked working-tree
file that got swept into #28 by `git add -A`; it was never part of that
PR's intended scope (faithful ADR-0017 ListView filters). Removing it from
the templates repo. The two view changes from #28 are unaffected.

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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