Skip to content

feat(action-center): edit, add and delete an action's tasks - #814

Merged
gkhngyk merged 1 commit into
mainfrom
feature/action-task-editing
Sep 15, 2026
Merged

gkhngyk merged 1 commit into
mainfrom
feature/action-task-editing

Conversation

@gkhngyk

@gkhngyk gkhngyk commented Sep 15, 2026

Copy link
Copy Markdown
Contributor

Summary

An action's task list was whatever the generator decided, permanently. This makes it editable: rename a task, add one of your own, delete one — and call a task off rather than declaring it stuck.

Where the text lives

A task's text lived only in code. task_key indexes the per-kind templates the generator writes, and the drawer renders t(actionCenter.actionTasks.<task_key>). There was nowhere to put a sentence a person typed.

title is that place:

  • a generated task keeps its key and no title;
  • adding or renaming writes a title, which wins at render time;
  • the key stays behind, so which template a task grew from is still answerable.

task_key becomes nullable, guarded by a check that a row always has one of the two to render from. unique (action_id, task_key) needs no change — Postgres treats nulls as distinct, so an action holds as many user-added tasks as someone types while still refusing a duplicate template.

Deleting closes the gap in position, because the drawer numbers the rows and a hole would show. Renaming happens in place rather than in a dialog: the text is one line, Escape abandons, Enter or blur commits, and an empty value is treated as abandonment rather than as a request to blank the task out.

Blocked becomes Canceled

Blocked meant "still to do, held up". Canceled means "not going to happen" — and it now leaves the progress denominator instead of holding an action below 100% forever while it waits for something that may never arrive. Both the list row's progress bar and the drawer's count read it the same way.

One row carried the old value, which is the cheapest this rename will ever be.

Permissions

action_tasks reopens to members for insert and delete, scoped to their own organization with the same predicate the select and update policies already use. #813 closed these outright after finding them open to every signed-in user; this is the narrow, intentional version of that permission, and it exists because the Tasks tab now writes. actions and action_events stay closed.

Every mutation logs an action_event (task_added, task_renamed, task_deleted), so the History tab keeps its full trail, and bumps the action's updated_at so the table's Updated column tracks real work. That stamp bump was inline in one place and is now a shared touchAction.

Related issue

None — requested directly.

Type of change

  • feat — New feature
  • fix — Bug fix
  • chore — Maintenance / dependencies
  • docs — Documentation only
  • refactor — Code change that neither fixes a bug nor adds a feature
  • test — Adding or updating tests

Database

00083_action_task_editing — already applied to the hosted database. Adds title, makes task_key nullable, renames the blocked status value, and scopes the two write policies. All 76 existing task rows are intact and render exactly as before.

How to test

Open an action, then the Tasks tab:

  1. Rename — click a task's text, type, press Enter. Press Escape instead and nothing changes. Clearing it and blurring abandons the edit rather than blanking the task.
  2. Add — "Add task", type, Enter or "Add". It appends after the last one and numbers itself.
  3. Delete — the trash icon. The remaining tasks renumber from 1 with no gap.
  4. Canceled — set a task to Canceled. It leaves the progress count: three tasks with one canceled and one done reads 1/2, and the list row's bar agrees.
  5. History — every one of the above appears in the History tab, and the Updated column on the list moves.
  6. Generated tasks you have not touched still read from their templates.

Run from web/:

yarn test        # 216 passing
yarn lint
yarn typecheck
yarn format:check
yarn build

Checklist

  • Branch follows the naming convention (feature/, fix/, chore/, docs/) — see CONTRIBUTING.md
  • Commits follow Conventional Commits
  • supabase/schema.sql regenerated with bash supabase/build-schema.sh
  • yarn lint passes (run from web/) — 0 errors
  • yarn typecheck passes (run from web/)
  • yarn format:check passes (run from web/)
  • Changes are focused — one concern per PR

🤖 Generated with Claude Code

https://claude.ai/code/session_01SQ2H6mSd9JDpmqonk2VWBj

A task's text lived only in code. `task_key` indexes the per-kind templates
the generator writes and the drawer renders through i18n, so there was
nowhere to put a sentence a person typed — the list was whatever the
generator decided, permanently.

`title` is that place. A generated task keeps its key and no title; adding or
renaming one writes a title, which wins at render time while the key stays
behind so which template a task grew from is still answerable. `task_key`
becomes nullable, guarded by a check that a row always has one of the two to
render from. `unique (action_id, task_key)` needs no change: Postgres treats
nulls as distinct, so an action holds as many user-added tasks as someone
types while still refusing a duplicate template.

Deleting closes the gap in `position`, because the drawer numbers the rows
and a hole would show. Renaming happens in place — the text is one line and a
dialog for one line is a detour — with Escape abandoning and Enter or blur
committing.

`blocked` becomes `canceled`. Blocked meant "still to do, held up"; canceled
means "not going to happen", and it now leaves the progress denominator
instead of holding an action below 100% forever while it waits for something
that may never arrive. One row carried the old value, which is the cheapest
this rename will ever be.

action_tasks reopens to members for insert and delete, scoped to their own
organization with the predicate the select and update policies already use.
00082 closed these outright after finding them open to every signed-in user;
this is the narrow, intentional version of that permission, and it exists
because the Tasks tab now writes. actions and action_events stay closed.

Applied to the hosted database.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01SQ2H6mSd9JDpmqonk2VWBj
@github-actions github-actions Bot added the needs-migration Adds or edits a migration — apply it to the hosted database label Sep 15, 2026
@gkhngyk
gkhngyk merged commit f8598f5 into main Sep 15, 2026
6 checks passed
@gkhngyk
gkhngyk deleted the feature/action-task-editing branch September 15, 2026 13:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs-migration Adds or edits a migration — apply it to the hosted database

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant