Skip to content

feat(tui): remove toast notifications - #22

Merged
echobt merged 4 commits into
mainfrom
feat/remove-toast-notifications
Feb 4, 2026
Merged

feat(tui): remove toast notifications#22
echobt merged 4 commits into
mainfrom
feat/remove-toast-notifications

Conversation

@echobt

Copy link
Copy Markdown
Contributor

Summary

This PR disables all toast notifications in the TUI application.

Changes

  • Modified ToastManager methods (push, success, info, warning, error) to be no-ops (return 0 immediately)
  • Commented out toast rendering in rendering.rs
  • Updated toast tests to verify the new no-op behavior
  • Toast module files are preserved (not deleted) for potential future re-enablement

Files Modified

  • src/cortex-tui/src/widgets/toast.rs
  • src/cortex-tui/src/runner/event_loop/rendering.rs
  • src/cortex-tui-components/src/toast.rs

Testing

  • cargo check -p cortex-tui -p cortex-tui-components passes
  • ✅ Tests updated to verify no-op behavior

Note: Do NOT merge this PR - for review only.

- Modified ToastManager.push/success/info/warning/error methods to return 0 immediately (no-op)
- Commented out toast rendering block in rendering.rs
- Applied same changes to both cortex-tui and cortex-tui-components toast modules
@greptile-apps

Copy link
Copy Markdown

Greptile Overview

Greptile Summary

Disabled all toast notifications in the TUI by converting ToastManager methods to no-ops and commenting out rendering code.

Key Changes

  • Modified ToastManager::push(), success(), info(), warning(), and error() to immediately return 0 without storing toasts
  • Parameters are explicitly consumed with let _ = to avoid unused variable warnings
  • Commented out toast rendering code in rendering.rs:122-127
  • Updated all toast tests to verify the new no-op behavior (checking for empty manager and ID = 0)
  • Toast infrastructure preserved for potential future re-enablement

Impact

  • Toast calls throughout the codebase (in commands.rs, rendering.rs:372, modal.rs, etc.) now silently do nothing
  • No visual feedback for user actions that previously showed toasts (e.g., "Copied!" message)
  • Tests pass with new assertions confirming disabled behavior

Confidence Score: 5/5

  • Safe to merge - clean implementation of feature disable with no logical errors
  • Implementation is straightforward and safe: methods return immediately without side effects, rendering is commented out (not deleted), tests are properly updated to verify new behavior, and the pattern allows easy re-enablement
  • No files require special attention

Important Files Changed

FilenameOverview
src/cortex-tui-components/src/toast.rsMade ToastManager methods (push, success, info, warning, error) return 0 immediately without storing toasts; updated tests to verify no-op behavior
src/cortex-tui/src/widgets/toast.rsMade ToastManager methods (push, success, info, warning, error) return 0 immediately without storing toasts; updated tests to verify no-op behavior
src/cortex-tui/src/runner/event_loop/rendering.rsCommented out toast rendering code in the render method while keeping the logic intact

Sequence Diagram

sequenceDiagram
participant App as Application Code
participant TM as ToastManager
participant Render as Rendering Loop
participant UI as Terminal UI
Note over App,UI: Before Changes (Original Behavior)
App->>TM: success("Copied!")
TM->>TM: Assign unique ID
TM->>TM: Store toast in vector
TM-->>App: Return toast ID
Render->>TM: Check is_empty()
TM-->>Render: false (toasts exist)
Render->>UI: Render ToastWidget
UI->>UI: Display toast notification
Note over App,UI: After Changes (Disabled Behavior)
App->>TM: success("Copied!")
TM->>TM: Ignore message parameter
TM-->>App: Return 0 (no-op)
Render->>TM: Check is_empty()
TM-->>Render: true (no toasts stored)
Render->>Render: Skip toast rendering
Note over UI: No toast displayed
Loading

@greptile-appsgreptile-appsBot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

3 files reviewed, no comments

Edit Code Review Agent Settings | Greptile

The next_id field became dead code when toast notifications were disabled
and push() was changed to a no-op returning 0 immediately. This fixes the
Clippy dead_code warning in CI.
The error variable in the retry pattern was captured but not used,
triggering unused_variables warning with -D warnings. Changed 'Err(e)'
to 'Err(_)' for the retry case since the error is intentionally ignored.
@echobt
echobt merged commit feb26a8 into mainFeb 4, 2026
15 checks passed
Sign up for freeto 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.

1 participant

@echobt