Skip to content

feat(cloud-agent-next): edit and reorder profile setup commands#4544

Open
eshurakov wants to merge 2 commits into
mainfrom
session/agent_042d41ec-3155-4422-b5a2-4ed67458c880
Open

feat(cloud-agent-next): edit and reorder profile setup commands#4544
eshurakov wants to merge 2 commits into
mainfrom
session/agent_042d41ec-3155-4422-b5a2-4ed67458c880

Conversation

@eshurakov

Copy link
Copy Markdown
Contributor

Summary

The profile editor's Setup Commands tab only supported add and delete — you could not edit an existing command in place or change its order. The neighboring Variables tab already supported inline editing, so this was an asymmetry in the same component.

This adds edit and reorder to the Setup Commands tab in ProfileEditPanel (apps/web/src/components/cloud-agent-next/ProfilesListDialog.tsx):

  • Edit: each command row gains an Edit button that swaps the row into an inline Input, mirroring the Variables tab edit pattern. Enter saves, Escape cancels, and a Save/Cancel button pair is shown.
  • Reorder: up/down chevron buttons move a command within the ordered sequence. The up arrow is disabled on the first item and the down arrow on the last.

Both reuse the existing full-replacement setCommands mutation (the service deletes-all-then-re-inserts with sequence = index), so no backend changes were required. A commandActionsDisabled flag locks all row actions while a save is in flight or a row is being edited, and the delete button gained an aria-label.

Verification

  • pnpm lint scoped to the changed file passes (0 warnings, 0 errors).
  • Typecheck was not run (excluded by request); the change is localized to one existing component and reuses its established setCommands mutation and Input/Button primitives.
  • Manual UI testing was not run in this sandbox environment.

Visual Changes

N/A — no screenshots available from the sandbox environment.

Behavioral change only: each Setup Commands row now renders up/down reorder buttons and an Edit button alongside the existing delete button; selecting Edit replaces the row content with an inline input and Save/Cancel actions.

Reviewer Notes

  • Reorder uses up/down buttons rather than drag-and-drop: the repo has no DnD library installed, and the existing in-repo reorderKiloCommands mutation has no DnD UI to mirror. Arrow buttons are keyboard-accessible and dependency-free.
  • The commandActionsDisabled guard (true while savingCommands or while a row is in edit mode) prevents concurrent mutations against the full-replacement setCommands endpoint.

… dialog

Implement functionality to edit existing commands and reorder them within
the ProfileEditPanel. This includes adding state management for editing
modes, handlers for saving updated commands, and handlers for moving
commands up or down in the sequence.

Co-authored-by: kiloconnect[bot] <240665456+kiloconnect[bot]@users.noreply.github.com>
Comment thread apps/web/src/components/cloud-agent-next/ProfilesListDialog.tsx
@kilo-code-bot

kilo-code-bot Bot commented Jul 14, 2026

Copy link
Copy Markdown
Contributor

Code Review Summary

Status: No Issues Found | Recommendation: Merge

Executive Summary

The incremental change (commit 0a25f16) fixes the previously flagged keyboard-guard issue by disabling the edit input and short-circuiting the Enter/Escape handlers while a save is pending; no new issues were found.

Files Reviewed (1 files)
  • apps/web/src/components/cloud-agent-next/ProfilesListDialog.tsx
Previous Review Summary (commit d759bbf)

Current summary above is authoritative. Previous snapshots are kept for context only.

Previous review (commit d759bbf)

Status: 1 Issues Found | Recommendation: Address before merge

Overview

Severity Count
CRITICAL 0
WARNING 1
SUGGESTION 0
Issue Details (click to expand)

WARNING

File Line Issue
apps/web/src/components/cloud-agent-next/ProfilesListDialog.tsx 1094 Keyboard actions remain active during command saves, allowing overlapping full-replacement mutations or cancellation while pending
Files Reviewed (1 files)
  • apps/web/src/components/cloud-agent-next/ProfilesListDialog.tsx - 1 issue

Fix these issues in Kilo Cloud


Reviewed by claude-sonnet-5 · Input: 22 · Output: 3.1K · Cached: 386.5K

Review guidance: REVIEW.md from base branch main

Disable the edit-mode command input and early-return its keydown handler
while a save is in flight, so Enter/Escape can't launch overlapping
full-replacement setCommands mutations or cancel mid-save. Also void the
async save call to satisfy no-floating-promises, and apply oxfmt.

Co-authored-by: kiloconnect[bot] <240665456+kiloconnect[bot]@users.noreply.github.com>
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.

1 participant