Skip to content

feat: artifact delete button with confirm + error banner - #142

Merged
NoviUIKI merged 1 commit into
devfrom
feat/artifacts-delete
Aug 19, 2026
Merged

NoviUIKI merged 1 commit into
devfrom
feat/artifacts-delete

Conversation

@BerryUIKI

@BerryUIKI BerryUIKI commented Aug 19, 2026 •

Copy link
Copy Markdown
Owner

Summary

Implement the artifact delete button (task #5).

Changes

  • Per-item delete button (hover reveal, click propagation stopped)
  • window.confirm before deleting
  • Delete failures shown in a role=alert banner instead of console.error

Base is feat/error-surfacing (stacked PR); merge after #141.

@NoviUIKI NoviUIKI left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Review summary — PR #142

Verdict: ✅ Approve

Clean, well-contained feature (single file). Verified: typecheck passes, existing artifact tests pass, no whitespace errors.

Critical

  • None.

Important

  • None.

Suggestions (non-blocking)

  1. Rename _onDelete → onDelete (ArtifactsPage.tsx). The underscore prefix and the now-removed void _onDelete; marked it as "intentionally unused" — but this PR makes it the active delete handler. The name is now misleading.
  2. Error detail is discarded. The catch in handleDeleteArtifact shows the generic failedToDeleteArtifact banner and no longer logs the underlying error anywhere. For a desktop app that's hard to debug in the field; consider including error.message in the banner or writing it to a dev-only diagnostic channel.
  3. Minor a11y: the row swap to <div role="button"> handles Enter and Space on keydown; the ARIA convention is to activate Space on keyup (so it doesn't fight page scroll). Also, the delete button is invisible until hover/focus — fine for this desktop app, but worth a permanent affordance if touch is ever a target.
  4. Minor UX: the deleteError banner has no dismiss — it persists until the next delete attempt or navigation.

Strengths

  • Correctly solves the nested-button problem: the outer <button> becomes <div role="button" tabIndex={0}> so the delete button can live inside without invalid HTML nesting, with a e.target !== e.currentTarget guard so its key events don't trigger row selection.
  • Delete button is keyboard-reachable (focus:opacity-100) with aria-label/title, and uses stopPropagation so clicking it doesn't select the row.
  • Confirms before deleting (window.confirm), consistent with OptionContractTable.
  • Failure is surfaced in a role="alert" banner instead of console.error — matches the error-surfacing direction of PR #141.
  • t is now properly typed as (key: MessageKey) => string.

Verification

  • tsc --noEmit (apps/desktop): passes.
  • ComparisonTableRenderer.test.tsx + ArtifactWindowPage.test.tsx: 9/9 pass.
  • git diff --check: clean.

Base automatically changed from feat/error-surfacing to dev August 19, 2026 05:17
- Add per-item delete button (stopPropagation, hover reveal)
- Confirm via window.confirm before deleting
- Surface delete failures in a role=alert banner instead of console.error
@NoviUIKI
NoviUIKI force-pushed the feat/artifacts-delete branch from 459b1f3 to 98c0c79 Compare August 19, 2026 05:17
@NoviUIKI
NoviUIKI merged commit 4ed6536 into dev Aug 19, 2026
4 checks passed
@BerryUIKI
BerryUIKI deleted the feat/artifacts-delete branch August 20, 2026 06:39
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.

2 participants