Skip to content

Conversation

@chhoumann
Copy link
Owner

@chhoumann chhoumann commented Feb 1, 2026

Summary

  • add Rename action to choice context menu and prompt-based rename flow
  • keep rename in choice view header with a pencil indicator
  • remove inline/double-click rename UI to preserve list styling

Testing

  • bun run build

Closes #683

Summary by CodeRabbit

  • New Features

    • Add "Rename" option to choice context menus so users can rename choices inline.
    • Rename capability available across single, multi, and filtered choice lists; rename events propagate to parent lists.
  • Style

    • Choice header refreshed with an icon and centered text for improved readability.

✏️ Tip: You can customize this high-level summary in your review settings.

@vercel
Copy link

vercel bot commented Feb 1, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
quickadd Ready Ready Preview Feb 1, 2026 9:43pm

@coderabbitai
Copy link

coderabbitai bot commented Feb 1, 2026

📝 Walkthrough

Walkthrough

Adds a discoverable rename flow: introduces a pencil icon in the Choice header, a "Rename" context-menu item, a prompt helper (promptRenameChoice), event propagation (renameChoice) through list and item components, and handlers in ChoiceView to apply, refresh, and persist renamed choices.

Changes

Cohort / File(s) Summary
Choice Builder UI
src/gui/ChoiceBuilder/choiceBuilder.ts, src/styles.css
Split header into separate text and icon elements; render pencil icon via setIcon; add flex layout and .choiceNameHeaderIcon styling.
Rename Prompt Helper
src/gui/choiceRename.ts
New promptRenameChoice(app, currentName) async helper that shows a GenericInputPrompt, trims/validates input, and returns `string
Context Menu
src/gui/choiceList/contextMenu.ts
Added onRename to MenuActions and a "Rename" menu item (pencil icon) that invokes the callback.
Choice List Items
src/gui/choiceList/ChoiceListItem.svelte, src/gui/choiceList/MultiChoiceListItem.svelte
Wire onRename into context menu; dispatch renameChoice events with payload { choice }; forward on:renameChoice from nested lists.
Choice List Container / View
src/gui/choiceList/ChoiceList.svelte, src/gui/choiceList/ChoiceView.svelte
Bind on:renameChoice on item components; ChoiceView implements handleRenameChoice to call prompt, validate, update choices via updateChoiceHelper, refresh command registry entries, and persist changes.

Sequence Diagram

sequenceDiagram
    participant User
    participant Item as ChoiceListItem
    participant List as ChoiceList
    participant View as ChoiceView
    participant Prompt as promptRenameChoice
    participant Backend as Update & Persist

    User->>Item: Open context menu & select "Rename"
    Item->>List: dispatch renameChoice(choice)
    List->>View: propagate renameChoice(choice)
    View->>Prompt: promptRenameChoice(app, currentName)
    Prompt->>User: show input prompt
    User->>Prompt: submit new name
    Prompt->>View: return newName | null
    View->>View: validate & trim newName
    alt newName changed
        View->>Backend: updateChoiceHelper(choice, newName)
        Backend->>Backend: refresh command registry
        Backend->>Backend: persist changes
    end
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Poem

🐰 I nudged a pencil on the name so bright,
A tiny hop, a prompt, and typed just right.
Menus whispered "rename", the choices took flight,
I thumped, I typed, the labels now delight —
New names snug as carrots in the night.

🚥 Pre-merge checks | ✅ 4 | ❌ 1
❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 33.33% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the main changes: adding a rename action and an edit indicator (pencil icon) for choices.
Linked Issues check ✅ Passed The PR implements the core requirements from issue #683: adds a Rename action to the context menu and includes a pencil icon next to choice names to indicate editability.
Out of Scope Changes check ✅ Passed All changes are directly related to implementing the rename functionality and edit indicator. No unrelated modifications were introduced.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch 683

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@cloudflare-workers-and-pages
Copy link

cloudflare-workers-and-pages bot commented Feb 1, 2026

Deploying quickadd with  Cloudflare Pages  Cloudflare Pages

Latest commit: 69f07aa
Status:⚡️  Build in progress...

View logs

Copy link
Contributor

@devin-ai-integration devin-ai-integration bot left a comment

Choose a reason for hiding this comment

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

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no potential bugs to report.

View in Devin Review to see 4 additional flags.

Open in Devin Review

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
src/gui/ChoiceBuilder/choiceBuilder.ts (1)

84-109: ⚠️ Potential issue | 🟡 Minor

Prevent empty/whitespace choice names in header rename.
This path allows blank names, while the ChoiceView rename trims/validates. Aligning behavior avoids empty labels and command naming issues.

🔧 Proposed fix (trim + validate)
-				const newName: string = await GenericInputPrompt.Prompt(
+				const newName: string = await GenericInputPrompt.Prompt(
 					this.app,
 					choice.name,
 					"Choice name",
 					choice.name,
 				);
-				if (newName !== choice.name) {
-					choice.name = newName;
-					textEl.setText(newName);
-				}
+				const trimmed = newName.trim();
+				if (!trimmed || trimmed === choice.name) return;
+				choice.name = trimmed;
+				textEl.setText(trimmed);

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Fix all issues with AI agents
In `@src/gui/choiceRename.ts`:
- Around line 9-14: The Prompt call passes arguments in the wrong order to
GenericInputPrompt.Prompt (signature: Prompt(app, header, placeholder?, value?,
description?)); change the call so the header is "Choice name" and currentName
is passed as the value (e.g. Prompt(app, "Choice name", /* placeholder? */
undefined, currentName)), updating the invocation that assigns newName to use
GenericInputPrompt.Prompt(app, "Choice name", undefined, currentName).

Copy link
Contributor

@devin-ai-integration devin-ai-integration bot left a comment

Choose a reason for hiding this comment

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

Devin Review found 1 new potential issue.

View issue and 8 additional flags in Devin Review.

Open in Devin Review

@chhoumann chhoumann merged commit bccc331 into master Feb 1, 2026
3 of 5 checks passed
@chhoumann chhoumann deleted the 683 branch February 2, 2026 15:58
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.

Make choice renaming more discoverable

2 participants