Skip to content

fix(ui): disable routine save until name and exercises are set - #702

Merged
9thLevelSoftware merged 1 commit into
9thLevelSoftware:mainfrom
Jdub7575:cursor/fix-routine-editor-save-validation
Aug 16, 2026
Merged

fix(ui): disable routine save until name and exercises are set#702
9thLevelSoftware merged 1 commit into
9thLevelSoftware:mainfrom
Jdub7575:cursor/fix-routine-editor-save-validation

Conversation

@Jdub7575

Copy link
Copy Markdown
Contributor

Summary

Fixes audit finding 01-F-002: the Routine Editor Save button could persist empty routines or fall back to "Unnamed Routine".

  • Disable Save until the routine has at least one exercise and a non-blank name
  • Save the trimmed routine name directly instead of silently defaulting to "Unnamed Routine"

Test plan

  • Open Routine Editor with no exercises → Save is disabled
  • Add an exercise but clear the name → Save stays disabled
  • Enter a name and add an exercise → Save enables and saves correctly
  • Existing routines with content still save normally

Contributed from @Jdub7575.

Made with Cursor

Prevent saving empty or unnamed routines that previously fell back to
"Unnamed Routine" and produced unusable entries (audit 01-F-002).

Co-authored-by: Cursor <cursoragent@cursor.com>
@Jdub7575
Jdub7575 marked this pull request as draft August 16, 2026 18:24
@kilo-code-bot

kilo-code-bot Bot commented Aug 16, 2026

Copy link
Copy Markdown
Contributor

Code Review Roast 🔥

Verdict: No Issues Found | Recommendation: Merge

Oh wait, this PR is actually clean. I need to sit down. I had my flamethrower warmed up and everything.

Three lines added, two lines changed, surgical as a scalpel — and it actually closes the audit finding instead of opening six new ones. canSaveRoutine = state.exercises.isNotEmpty() && state.routineName.isNotBlank() is exactly the gate the spec asked for, and replacing ifBlank { "Unnamed Routine" } with trim() is the correct minimal move once Save is gated on isNotBlank(). No defensive duplicate validation, no speculative "what if the name is 10MB" branch, no brand-new helper class for a single boolean.

🏆 Best part: The two-line guard reuses the same state.exercises and state.routineName already driving isDirty — no new state plumbing. Refreshingly restrained.

💀 Worst part: Honestly nothing worth roasting. I checked twice.

📊 Overall: Like a proof that a 4-line audit fix doesn't have to come with 200 lines of ceremonial scaffolding. Ship it.

Files Reviewed (1 file)
  • shared/src/commonMain/kotlin/com/devil/phoenixproject/presentation/screen/RoutineEditorScreen.kt - 0 issues

Verdict

Approve — The fix is correct, minimal, and directly resolves audit 01-F-002.

Correctness / Safety Findings

No correctness or safety findings.

Ponytail Review

Ponytail: Lean already. Ship.

Ponytail net: 0 lines.

Suggested Minimal Patch

No patch needed.

Final Merge Guidance

Can merge as-is.


Mandatory per-PR checklist:

  • Did I review correctness/security first? ✅
  • Did I run a separate Ponytail pass? ✅
  • Did I look for code to delete? ✅
  • Did I look for stdlib/native replacements? ✅
  • Did I look for one-implementation interfaces/factories/adapters? ✅
  • Did I look for speculative config/extensibility? ✅
  • Did I avoid removing required validation/security/tests? ✅
  • Did I include either Ponytail findings or "Ponytail: Lean already. Ship."? ✅

Reviewed by minimax-m3 · Input: 25.8K · Output: 3.5K · Cached: 144.1K

Review guidance: REVIEW.md from base branch main

@9thLevelSoftware
9thLevelSoftware marked this pull request as ready for review August 16, 2026 18:46
Copilot AI lite review requested due to automatic review settings August 16, 2026 18:46
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, add credits to your account and enable them for code reviews in your settings.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@9thLevelSoftware
9thLevelSoftware merged commit 14fddb2 into 9thLevelSoftware:main Aug 16, 2026
8 checks passed
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.

3 participants