Skip to content

feat: edit/archive/delete button#57

Merged
aki91-g merged 3 commits intomainfrom
mvp/issue56
Mar 15, 2026
Merged

feat: edit/archive/delete button#57
aki91-g merged 3 commits intomainfrom
mvp/issue56

Conversation

@aki91-g
Copy link
Copy Markdown
Owner

@aki91-g aki91-g commented Mar 15, 2026

close #56

Summary by CodeRabbit

  • Refactor
    • Consolidated item lifecycle into a new drawer component that now handles creating, viewing, editing, archiving, and soft-deleting with explicit loading states; main dashboard no longer manages creation.
  • Documentation
    • Updated architecture and component docs to include the new drawer and to describe configurable ScatterPlot behavior and its selection relay to the drawer.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Mar 15, 2026

Warning

Rate limit exceeded

@aki91-g has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 11 minutes and 15 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: d071134f-6580-40fb-8609-01feddc0ffd3

📥 Commits

Reviewing files that changed from the base of the PR and between ae452d8 and 4d68e2c.

📒 Files selected for processing (2)
  • apps/frontend/src/components/TaskList.vue
  • apps/frontend/src/views/LoginView.vue
📝 Walkthrough

Walkthrough

TaskDrawer.vue was introduced and now owns item lifecycle (create, view, edit, archive, soft-delete) via useItems(); MainDashboard no longer performs creation. ScatterPlot docs updated to relay item selection to TaskDrawer.

Changes

Cohort / File(s) Summary
Architecture Doc
apps/frontend/ARCHITECTURE.md
Added TaskDrawer.vue to frontend component list and updated docs to describe its public props (open, mode, selectedItem, items, syncMap, errorMap, isSyncing), emits (update:open, update:mode, select-item), and responsibilities (create/view/edit/archive/delete).
New CRUD Component
apps/frontend/src/components/TaskDrawer.vue
New self-contained CRUD drawer that uses useItems() directly (adds createItem, archiveItem, softDeleteItem, exposes repositoryItems), introduces async handlers (submitCreate(): Promise<void>, handleEditSubmit(), handleArchive(), handleDelete()), local loading refs (isCreating, isSavingEdit, isArchiving, isDeleting), removes create-item emit and parent-driven creation flow.
Dashboard View
apps/frontend/src/views/MainDashboard.vue
Removed creation orchestration: no longer destructures createItem from useItems(), removed isCreating state and @create-item binding on <TaskDrawer>. Dashboard delegates item lifecycle to TaskDrawer.
ScatterPlot docs / integration
.../docs and referenced components
Documentation updated: ScatterPlot exposes configurable Y-axis/color/radius fields and now relays select-item events to TaskDrawer rather than embedding creation UI.

Sequence Diagram(s)

sequenceDiagram
  participant User as User (UI)
  participant Dashboard as MainDashboard
  participant Drawer as TaskDrawer
  participant Items as useItems (repository)

  User->>Dashboard: open drawer / select item (from ScatterPlot)
  Dashboard->>Drawer: set `open`, `mode`, `selectedItem`
  User->>Drawer: submit create / save edit / archive / delete
  Drawer->>Items: call createItem / archiveItem / softDeleteItem
  Items-->>Drawer: operation result (created item / success)
  Drawer->>Dashboard: emit `select-item` or `update:open` / `update:mode`
  Dashboard-->>User: UI updates (drawer view closed/selected item shown)
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

  • Mvp/issue49 #50: Modifies frontend item creation and ScatterPlot integration; overlaps with TaskDrawer creation flow and ScatterPlot select-item relay.

Poem

🐇 I dug a drawer where tasks hop in,
I tidy their titles, tuck edits in,
Archive, delete — a soft little thump,
The dashboard sighs light as I finish my jump. ✨

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'feat: edit/archive/delete button' directly describes the main feature addition visible in the PR changes, matching the primary modifications across TaskDrawer, MainDashboard, and ARCHITECTURE documentation.
Linked Issues check ✅ Passed The PR successfully implements edit, archive, and delete functionality as required by issue #56, with TaskDrawer now handling these operations directly via useItems() composable methods.
Out of Scope Changes check ✅ Passed All changes are directly related to adding edit/archive/delete functionality. The refactoring of TaskDrawer to handle item mutations directly and removal of creation flow from MainDashboard are necessary supporting changes aligned with the PR objectives.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch mvp/issue56
📝 Coding Plan
  • Generate coding plan for human review comments

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🧹 Nitpick comments (2)
apps/frontend/src/components/TaskDrawer.vue (2)

404-461: Edit form inputs could disable during archive/delete for consistency.

The action buttons correctly disable during isArchiving or isDeleting, but the form inputs (title, description, due, duration, motivation) only disable for isSavingEdit. Users can still type in form fields while archive/delete is in progress, though edits have no effect.

For visual consistency, consider adding isArchiving || isDeleting to the input disabled bindings:

-:disabled="!selectedItem || isSavingEdit"
+:disabled="!selectedItem || isSavingEdit || isArchiving || isDeleting"
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@apps/frontend/src/components/TaskDrawer.vue` around lines 404 - 461, In the
edit form (the template block with key="edit") the input/textarea/select fields
bound to editTitle, editDescription, editDue, editDuration and editMotivation
only disable for isSavingEdit; update their :disabled bindings to include
isArchiving || isDeleting (e.g. :disabled="!selectedItem || isSavingEdit ||
isArchiving || isDeleting") so the fields are non-editable while an archive or
delete is in progress for consistency with the action buttons.

153-167: Consider a custom confirmation modal for better UX.

The native confirm() dialog works but has limited styling and accessibility. For an MVP, this is acceptable. A custom modal component could provide better UX and accessibility control in a future iteration.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@apps/frontend/src/components/TaskDrawer.vue` around lines 153 - 167, Replace
the native confirm() in handleDelete with your app's custom confirmation modal
flow: instead of calling confirm('...'), open the ConfirmModal component (or
emit an event to show it) and await the user's response; only proceed to set
isDeleting.value = true and call softDeleteItem(props.selectedItem.id) if the
modal returns a positive confirmation, and keep the existing try/catch/finally
logic and emits (emit('update:open', false) and emit('update:mode', 'view'))
unchanged so deletion behavior remains consistent with props.selectedItem and
error handling.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@apps/frontend/ARCHITECTURE.md`:
- Line 26: Update the summary sentence describing TaskDrawer.vue so it
accurately lists all CRUD operations: include "edit/update" along with create,
archive, and soft-delete; specifically mention that TaskDrawer.vue calls
useItems() directly for create, edit/update (via updateItem and
handleEditSubmit()), archive, and soft-delete operations to keep it consistent
with the later documentation referencing updateItem and handleEditSubmit().

In `@apps/frontend/src/components/TaskDrawer.vue`:
- Around line 126-130: The code assumes repositoryItems.value.find(...) returns
an item; if it returns null the drawer stays in create mode — update the block
around the created constant to handle the null case: after const created =
repositoryItems.value.find((item) => item.id === id) ?? null, add an explicit
branch for when created is falsy that logs a warning (console.warn or the
component logger) and emits an error/notification event (e.g. emit('show-error',
'Created item not found')) or sets an error state prop, otherwise proceed to
emit('select-item', created) and emit('update:mode', 'view'); reference
repositoryItems, created, emit('select-item') and emit('update:mode') so the
null-path is covered and the user gets feedback.

---

Nitpick comments:
In `@apps/frontend/src/components/TaskDrawer.vue`:
- Around line 404-461: In the edit form (the template block with key="edit") the
input/textarea/select fields bound to editTitle, editDescription, editDue,
editDuration and editMotivation only disable for isSavingEdit; update their
:disabled bindings to include isArchiving || isDeleting (e.g.
:disabled="!selectedItem || isSavingEdit || isArchiving || isDeleting") so the
fields are non-editable while an archive or delete is in progress for
consistency with the action buttons.
- Around line 153-167: Replace the native confirm() in handleDelete with your
app's custom confirmation modal flow: instead of calling confirm('...'), open
the ConfirmModal component (or emit an event to show it) and await the user's
response; only proceed to set isDeleting.value = true and call
softDeleteItem(props.selectedItem.id) if the modal returns a positive
confirmation, and keep the existing try/catch/finally logic and emits
(emit('update:open', false) and emit('update:mode', 'view')) unchanged so
deletion behavior remains consistent with props.selectedItem and error handling.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 05b03f93-dfe6-4a00-8b8e-26fcc232b506

📥 Commits

Reviewing files that changed from the base of the PR and between 2a8e1a1 and 19803b1.

📒 Files selected for processing (3)
  • apps/frontend/ARCHITECTURE.md
  • apps/frontend/src/components/TaskDrawer.vue
  • apps/frontend/src/views/MainDashboard.vue
💤 Files with no reviewable changes (1)
  • apps/frontend/src/views/MainDashboard.vue

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

🧹 Nitpick comments (1)
apps/frontend/src/components/TaskDrawer.vue (1)

140-169: Clear selection after archive/delete to prevent stale item state.

After success (Line 146–147 and Line 162–163), drawer/mode resets but selected item is not cleared. If the parent keeps selectedItem, reopening can show an archived/deleted task.

💡 Suggested change
 const emit = defineEmits<{
   (event: 'update:open', value: boolean): void;
   (event: 'update:mode', value: DrawerMode): void;
-  (event: 'select-item', item: Item): void;
+  (event: 'select-item', item: Item | null): void;
 }>();
 async function handleArchive(): Promise<void> {
   if (!props.selectedItem) return;

   isArchiving.value = true;
   try {
     await archiveItem(props.selectedItem.id);
+    emit('select-item', null);
     emit('update:open', false);
     emit('update:mode', 'view');
   } catch (error) {
 async function handleDelete(): Promise<void> {
   if (!props.selectedItem) return;
   if (!confirm('Are you sure you want to delete this task?')) return;

   isDeleting.value = true;
   try {
     await softDeleteItem(props.selectedItem.id);
+    emit('select-item', null);
     emit('update:open', false);
     emit('update:mode', 'view');
   } catch (error) {
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@apps/frontend/src/components/TaskDrawer.vue` around lines 140 - 169, After
successfully archiving or deleting in handleArchive and handleDelete, clear the
parent's selected item to avoid reopening a stale/removed task; after the
existing emits (emit('update:open', false) and emit('update:mode', 'view')) add
an emit to reset the selection (e.g., emit('update:selectedItem', null))
referencing props.selectedItem, handleArchive, and handleDelete so the parent
clears its selectedItem state.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In `@apps/frontend/src/components/TaskDrawer.vue`:
- Around line 140-169: After successfully archiving or deleting in handleArchive
and handleDelete, clear the parent's selected item to avoid reopening a
stale/removed task; after the existing emits (emit('update:open', false) and
emit('update:mode', 'view')) add an emit to reset the selection (e.g.,
emit('update:selectedItem', null)) referencing props.selectedItem,
handleArchive, and handleDelete so the parent clears its selectedItem state.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 450af891-df97-449e-b9e4-d7d7de980af0

📥 Commits

Reviewing files that changed from the base of the PR and between 19803b1 and ae452d8.

📒 Files selected for processing (1)
  • apps/frontend/src/components/TaskDrawer.vue

@aki91-g aki91-g merged commit f53adcf into main Mar 15, 2026
3 checks passed
@aki91-g aki91-g deleted the mvp/issue56 branch March 15, 2026 16:27
This was referenced Mar 16, 2026
This was referenced Mar 23, 2026
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.

edit/delete用のAPIを繋げる

1 participant