Skip to content

Add confirmation dialog before resetting dashboard progress - #25

Merged
Rowrow620 merged 3 commits into
Rowrow620:devfrom
dyson-025:issue-13-reset-confirmation
Jul 31, 2026
Merged

Add confirmation dialog before resetting dashboard progress#25
Rowrow620 merged 3 commits into
Rowrow620:devfrom
dyson-025:issue-13-reset-confirmation

Conversation

@dyson-025

Copy link
Copy Markdown
Contributor

Description

This PR adds a confirmation dialog before resetting the NeetCode Dashboard progress.

Instead of immediately clearing all completed problem checkmarks, clicking Reset All Progress now opens a confirmation dialog. Users can either cancel the action or confirm the reset, helping prevent accidental loss of progress.

Related Issues

Closes #13

Type of Change

  • Bug fix (non-breaking change fixing an issue)
  • New problem visualizer audit / promotion (AuditStatus::Audited)
  • New feature (non-breaking change adding functionality)
  • Documentation update
  • Refactoring / performance optimization

Verification Checklist

  • Code compiles cleanly without errors
  • cargo test passes 100% of unit tests
  • cargo fmt --all -- --check complies with standard Rust formatting
  • cargo clippy --all-targets -- -D warnings produces zero warnings
  • Step visualizer tested locally in desktop mode (cargo run) and/or WebAssembly mode (trunk serve)

@Rowrow620

Copy link
Copy Markdown
Owner

Thanks for working on this!
Tested this out locally and made a few small adjustments. Let me know what you think about these changes!

  • Added .anchor(CENTER_CENTER, ...) so egui doesn't stick it in the top-left corner.
  • Styled the reset button red/bold so users don't mix it up with Cancel.
  • Fixed a double-render issue where render_reset_confirm_modal was being called twice per frame when the dashboard was active.
  • Swapped the outer if for an early return guard clause.

Code for src/app.rs:

fn render_reset_confirm_modal(&mut self, ctx: &egui::Context) {
    if !self.show_reset_confirm_modal {
        return;
    }

egui::Window::new("Confirm Reset")
      .collapsible(false)
      .resizable(false)
      .anchor(egui::Align2::CENTER_CENTER, [0.0, 0.0])
      .show(ctx, |ui| {
          ui.label("Are you sure you want to reset all completed problem checkmarks?");
          ui.add_space(8.0);
  
          ui.horizontal(|ui| {
              if ui.button("Cancel").clicked() {
                  self.show_reset_confirm_modal = false;
              }
  
              let dark_red = Color32::from_rgb(210, 40, 65);
              let confirm_btn = egui::Button::new(
                  RichText::new("Confirm Reset").color(Color32::WHITE).strong()
              )
              .fill(dark_red);
  
              if ui.add(confirm_btn).clicked() {
                  self.completed_problems.clear();
                  self.show_reset_confirm_modal = false;
              }
          });
      });

@Rowrow620 Rowrow620 assigned Rowrow620 and dyson-025 and unassigned Rowrow620 Jul 30, 2026
@Rowrow620

Copy link
Copy Markdown
Owner

Looks great! The centered window positioning and destructive red button styling look great, and the guard clause keeps the code super clean.

Approved and ready to merge!

@Rowrow620
Rowrow620 merged commit dbfeddb into Rowrow620:dev Jul 31, 2026
4 checks passed
Rowrow620 added a commit that referenced this pull request Jul 31, 2026
This update completes Phase 1 of the architecture refactor for v0.7.0.
- Extracted UI components into src/ui/ (theme_helpers, modals, dashboard, sidebar, header, inspector, canvas, playground).
- Decoupled algorithm execution into src/engine.rs as clean free functions.
- Added a small 'x' clear button next to the search input in the Roadmap sidebar. The button appears only when search query is non-empty and clears it on click (from #19).
- Added a confirmation dialog before resetting dashboard progress (from #25).

# Conflicts:
#	src/app.rs
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.

Add confirmation popup before resetting NeetCode Dashboard progress

2 participants