Skip to content

Conversation

@uinstinct
Copy link
Contributor

@uinstinct uinstinct commented Nov 19, 2025

Description

Show a dialog when adding a new rule so that it can be renamed. When left empty, the previous "new-rule.md" is applied.

closes #8663

AI Code Review

  • Team members only: AI review runs automatically when PR is opened or marked ready for review
  • Team members can also trigger a review by commenting @continue-review

Checklist

  • [] I've read the contributing guide
  • [] The relevant docs, if any, have been updated or created
  • [] The relevant tests, if any, have been updated or created

Screen recording or screenshot

feat.mp4

Tests

[ What tests were added or updated to ensure the changes work as expected? ]


Summary by cubic

Let users name a rule file before creation via a new dialog. Works for both workspace and global rules, with sanitized filenames and updated core handling.

  • New Features
    • Added AddRuleDialog with input, validation, and create/cancel actions.
    • RulesSection now opens the dialog; the dialog posts baseFilename to core for workspace or global rule creation.
    • Extended core protocol to accept baseFilename for "config/addLocalWorkspaceBlock" and "config/addGlobalRule".
    • Updated file creation to support a base filename override, strip extensions, sanitize rule names, and ensure a unique file path; falls back to default names if the sanitized result is empty.

Written for commit b6a8be5. Summary will update automatically on new commits.

@uinstinct uinstinct requested a review from a team as a code owner November 19, 2025 11:07
@uinstinct uinstinct requested review from sestinj and removed request for a team November 19, 2025 11:07
@dosubot dosubot bot added the size:L This PR changes 100-499 lines, ignoring generated files. label Nov 19, 2025
Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

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

2 issues found across 5 files

Prompt for AI agents (all 2 issues)

Understand the root cause of the following 2 issues and fix them.


<file name="gui/src/components/dialogs/AddRuleDialog.tsx">

<violation number="1" location="gui/src/components/dialogs/AddRuleDialog.tsx:32">
Leaving the dialog empty is supposed to fall back to the previous `new-rule.md`, but the submit handler rejects empty inputs so the fallback can never trigger. Default the trimmed value to `&quot;new-rule.md&quot;` instead of treating it as an error.</violation>

<violation number="2" location="gui/src/components/dialogs/AddRuleDialog.tsx:81">
The Create button is permanently disabled when the input is blank, so users can’t exercise the documented “leave empty to use new-rule.md” behavior. Allow submission when empty and only gate on `isSubmitting`.</violation>
</file>

Reply to cubic to teach it or ask questions. Re-run a review with @cubic-dev-ai review this PR

uinstinct and others added 2 commits November 19, 2025 16:51
Co-authored-by: cubic-dev-ai[bot] <191113872+cubic-dev-ai[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:L This PR changes 100-499 lines, ignoring generated files.

Projects

Status: Todo

Development

Successfully merging this pull request may close these issues.

[VS Code] Creating a new rule hard codes the file name as new-rule.md

1 participant