Skip to content

feat(toast): port upstream close buttons (#2023)#67

Merged
tyulyukov merged 1 commit intomainfrom
marcode/port-toast-close-buttons
Apr 24, 2026
Merged

feat(toast): port upstream close buttons (#2023)#67
tyulyukov merged 1 commit intomainfrom
marcode/port-toast-close-buttons

Conversation

@tyulyukov
Copy link
Copy Markdown
Owner

Summary

Ports upstream #2023 toast refactor — adds visible X close buttons, ToastBodyContent extraction, and expandable body fields (expandableContent, expandableLabels, expandableDescriptionTrigger).

Conflicts resolved

  • apps/web/src/components/ui/toast.tsx: Took upstream's version wholesale (492 → 719 lines). Upstream already re-integrated our CopyErrorButton (line 93) on error toasts, so nothing to hand-merge there.
  • apps/web/src/components/Sidebar.tsx: Preserved MarCode's richer "Delete anyway" warning toast in SidebarProjectItem — action button, deferred close, api.dialogs.confirm(...) with thread-count messaging, removeProject(..., { force: true }), and inline error toast on failure. Migrated the outer toast calls to the new stackedThreadToast(...) helper for layout consistency with the rest of the file and the error-toast path that upstream already migrated.

Why this is isolated

Dedicated branch on top of origin/main — intentionally not mixed into PR #66 because:

  1. toast.tsx is a large refactor (+227 net lines) and deserves its own review window.
  2. The Sidebar "Delete anyway" preservation is a MarCode-specific behavior the reviewer should confirm on its own.

Test plan

  • Local: bun run typecheck clean
  • Local: apps/web full test suite — 1088/1088 passing (incl. toast.logic.test.ts 10/10)
  • Local: oxlint — 0 errors (67 pre-existing warnings)
  • Manual smoke:
    • Info / success / warning / error toast all render with an X close button
    • Clicking X dismisses the toast
    • Long error messages still show the Copy button + expandable body
    • Right-click → Delete project:
      • Empty project → confirms + removes
      • Non-empty project → shows "Delete anyway" warning; clicking it opens confirm dialog with thread count; Cancel aborts; OK deletes threads and project
      • Delete failure → stacked error toast
  • FEATURES.md checklist — no MarCode exclusive feature regresses

Co-authored-by: Julius Marminge <julius0216@outlook.com>
(cherry picked from commit 542dda095a958c2f5ff856af7584233ee460bf4e)
@tyulyukov tyulyukov merged commit 9f6411d into main Apr 24, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants