Skip to content

feat(console): quick-add a task from the workbench My tasks column - #39962

Draft
objectstack-fleet[bot] wants to merge 6 commits into
mainfrom
claude/issue-39873-task-quick-add
Draft

objectstack-fleet[bot] wants to merge 6 commits into
mainfrom
claude/issue-39873-task-quick-add

Conversation

@objectstack-fleet

@objectstack-fleet objectstack-fleet Bot commented Dec 6, 2026 •

Copy link
Copy Markdown
Contributor

Refs #39873

Clause-②: no
Metadata-protocol: none

维护者速读

  • 用户能看到什么变化:工作台首页「我的任务」一栏底部多了「添加任务」,填标题、可选截止时间和负责人(默认自己)即可新建任务,新任务立刻出现在列表里;列表为空时提示「在下方添加第一个吧」。
  • 为什么做:这是工作台三栏「我的任务」这张卡的第二部分(快速新建),列表部分已经上线。
  • 出错会怎样:新建失败时表单保留已输入内容并显示服务器给的原因;没有新建任务权限的人看不到这一行;可直接撤回本次改动。
  • 要你做什么:无。

What changes

  • New WorkbenchTaskQuickAdd (app-shell, console/workbench): an 「Add a task」 row under the 「My tasks」 list opens a small form — title, optional due time (the record form's date-time picker), assignee (the record form's person picker, defaulting to the signed-in person). Submit calls the console adapter's create('sys_task', …), the same write path the record form uses, so validation, the status default and sharing apply unchanged; then notifyDataChanged({ objectName: 'sys_task', recordId }), which the column's existing useDataInvalidation('sys_task') read already listens to — the list re-reads in place, no new route and no new refetch mechanism.
  • After a create the form clears and keeps focus for the next title. A task assigned to someone else says so (it does not belong in this person's list); a refused create keeps what was typed and shows the server's message (extractWriteErrorMessage).
  • WorkbenchTaskColumn: mounts the quick-add only for a caller who may read sys_task and for whom the new workbenchTaskQuickAdd row of the affordance-to-grant map reads open (resolveAffordance in @object-ui/core: the create grant on sys_task plus the object's create policy; before the grants load it reads open, the same convention the column's read check uses). For that caller the empty line becomes an invitation (workbench.tasks.emptyInvite); everyone else keeps the existing workbench.tasks.empty line.
  • @object-ui/core: AFFORDANCE_GRANTS gains workbenchTaskQuickAdd: { crud: 'create', grant: 'create' }. The census in affordanceGrantMap-12082.test.tsx gets the row's expectation and the WorkbenchTaskQuickAdd > submit :: create write site, mapped behind that row and read in WorkbenchTaskColumn.tsx.
  • Strings: workbench.tasks.emptyInvite and workbench.tasks.quickAdd.* in all eleven locale packs; zh-Hant regenerated from zh-Hans with gen:zh-hant.

Tests

  • WorkbenchTaskColumn.test.tsx, new top-level describe('WorkbenchTaskColumn quick-add'): empty list reads as the invitation and the form opens with the assignee preset to me; create sends { title (trimmed), assignee_id, due_at } to sys_task, the column re-reads and lists the new row; no due time → no due_at key; assigning to someone else says where it went; a refused create keeps the title and shows the server words; Cancel drops what was typed; a caller without create permission gets no add row and the plain empty line. Three existing assertions now expect the invitation copy (the harness grants create by default).
  • Ablation: with the notifyDataChanged call neutralised on disk, the create test goes red (the column never re-reads); restored from HEAD.

Acceptance notes

  • Card item 3 (the task count feeding the greeting's work summary) is not in this PR, so this PR refers to the card rather than closing it: the greeting sums approvals only, and the change lives in WorkbenchHomePage.tsx, which another claim holds this round. The zone dispatches item 3 separately.
  • No zh-Hans/en screenshots: no browser run in this container; the strings are pinned by key in the tests.

Verification

Readings

Rework round 1 (head 2b54095): pnpm --dir ui exec vitest run over all-locales-key-parity, en-zh-key-parity, zh-hant-generated, affordanceGrantMap-12082 and console/workbench/__tests__/ -> Test Files 7 passed (7), Tests 152 passed (152). @object-ui/core and @object-ui/app-shell type-check exit 0. See the os-dev report comment on the card for the full gate list and exit codes.

Read first (by risk): WorkbenchTaskQuickAdd.tsx (submit — the create and the invalidation), WorkbenchTaskColumn.tsx (the canQuickAdd gate and the empty copy), the new describe in the test file.

Two-minute check: open the workbench home with no tasks assigned → the column reads 「Nothing on your list yet. Add your first task below.」; click 「Add a task」, type a title, press Enter → the task appears in the list with the pill at 1.

🤖 Generated with Claude Code

https://claude.ai/code/session_01ADHkmPhvd5XT8WTQ6Lu6ic

@github-actions github-actions Bot added size/m documentation Improvements or additions to documentation tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface labels Dec 6, 2026
The nine other packs gain workbench.tasks.emptyInvite and
workbench.tasks.quickAdd.*; zh-Hant regenerated with gen:zh-hant.

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01ADHkmPhvd5XT8WTQ6Lu6ic
…-grant map

@object-ui/core gains the workbenchTaskQuickAdd row (create, asked of
sys_task); WorkbenchTaskColumn reads it through resolveAffordance instead
of its own can() read, and the census registers the create write site in
WorkbenchTaskQuickAdd behind that row.

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01ADHkmPhvd5XT8WTQ6Lu6ic
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack@os-steve · os-steve · session_01ADHkmRM92nyNXbcm2LJn1N

席位核对

ACCEPT · head 2b540956 · read 2026-12-06T19:04Z

L1 of PR #39962 (Refs #39873, the quick-add item), read on the full diff at 2b540956f9f97c0669d5904ff9e6c5a902c566c7.

This branch has not been deployed

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

Labels

documentation Improvements or additions to documentation size/l tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants