Skip to content

fix(sessions): confirm the rename dialog on Enter - #6011

Open
MFA-G wants to merge 6 commits into
Agenta-AI:mainfrom
MFA-G:fix/rename-session-enter-key
Open

fix(sessions): confirm the rename dialog on Enter#6011
MFA-G wants to merge 6 commits into
Agenta-AI:mainfrom
MFA-G:fix/rename-session-enter-key

Conversation

@MFA-G

@MFA-G MFA-G commented Aug 13, 2026

Copy link
Copy Markdown

Fixes #5951.

Summary

What changed: the "Rename session" dialog now confirms on Enter.

Why: it is a modal with a single text field, so Enter is the obvious way to confirm it — but nothing happened. The dialog stayed open and the name was unchanged, and the only way out was reaching for the mouse and clicking Rename.

Root cause: the <Input> inside modal.confirm in useSessionActions.rename had no onPressEnter, and antd's Modal.confirm does not submit on Enter by itself — there is no <form> wrapping the field, and the OK button is not the focused element.

The fix (web/oss/src/components/AgentChatSlice/hooks/useSessionActions.tsx):

  • The rename body is extracted into a submit closure, and onOk now is that closure — so the Enter path and the button path cannot drift.
  • onPressEnter on the Input destroys the dialog and runs submit(), which is exactly what a button click does (antd closes the modal itself on onOk).
  • A blank/whitespace-only name is ignored and the dialog stays open, matching what onOk already did.

No change to the cached-vs-remote branching, the error toast, or the revalidation.

Testing

Verified locally

Mounted the real hook in a browser against a stubbed setSessionHeader and drove it with a genuine Chrome key press (not a synthetic event), on the branch and on main:

dialog closes session name request
main ✗ no Untitled session (unchanged) none
this branch ✓ yes Pricing agent QA PATCH /sessions/session-1 → name: "Pricing agent QA"

Also ran:

pnpm exec vitest run src/components/AgentChatSlice   # 35 files, 374 passed, 1 skipped
pnpm exec eslint <both files>                        # clean
pnpm exec prettier --check <both files>              # unchanged

Added or updated tests

web/oss/src/components/AgentChatSlice/hooks/useSessionActions.test.tsx — two cases:

  • Enter with an edited name calls setSessionHeader with the trimmed name and closes the dialog.
  • Enter on a whitespace-only name calls nothing and leaves the dialog open.

Rendered with react-dom/client rather than a testing library (the repo has no @testing-library/react, per the note in ApprovedContentManifest.test.tsx); modal.confirm renders into document.body, so the assertions read the real DOM either way.

Verified the test actually catches the regression: reverting only the hook change makes the first case fail, and it passes with the fix in place.

QA follow-up

Worth a click-through of the rename entry point on both surfaces that use this hook — the sessions list and the playground's session bar — to confirm Enter and the Rename button behave identically, including on a session that is in the local tab cache (the atom path, which the harness above did not exercise; the unit test and the recording both take the remote path). Escape still cancels.

Demo

Same flow, same key press, main vs. this branch.

Before (main) — Enter does nothing, the dialog stays open:

Before: pressing Enter in the rename dialog does nothing

After (this branch) — Enter confirms, the dialog closes and the rename is sent:

After: pressing Enter confirms the rename and closes the dialog

Both clips render the real useSessionActions hook; only setSessionHeader is stubbed, and it prints the request it would send.

Checklist

  • I have included a video or screen recording for UI changes, or marked Demo as N/A
  • Relevant tests pass locally
  • Relevant linting and formatting pass locally
  • I have signed the CLA, or I will sign it when the bot prompts me

The Rename session modal has a single text field, but Enter did nothing:
the only way to confirm was clicking the Rename button.

Wire onPressEnter on the Input to the same submit path as onOk, closing
the dialog first so the flow matches a button click. A blank name is
ignored, exactly as onOk already did.

Fixes Agenta-AI#5951
Copilot AI lite review requested due to automatic review settings August 13, 2026 13:22
@dosubot dosubot Bot added the size:M This PR changes 30-99 lines, ignoring generated files. label Aug 13, 2026
@vercel

vercel Bot commented Aug 13, 2026

Copy link
Copy Markdown

@MFA-G is attempting to deploy a commit to the agenta projects Team on Vercel.

A member of the Team first needs to authorize it.

@github-actions

github-actions Bot commented Aug 13, 2026

Copy link
Copy Markdown
Contributor

✅ Thanks @MFA-G! This PR now meets the contribution requirements and has been reopened. A maintainer will review it soon.

@CLAassistant

Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

@github-actions github-actions Bot added the incomplete-pr PR is missing required template sections or a demo recording label Aug 13, 2026
@github-actions github-actions Bot closed this Aug 13, 2026

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.

Pull request overview

This PR fixes the session rename UX in the Agent Chat slice by making the “Rename session” confirm modal submit via the Enter key (in addition to the Rename button), and adds a focused DOM-level test to prevent regressions.

Changes:

  • Refactors the rename confirm modal to share a single submit handler between the OK button and keyboard submission.
  • Adds onPressEnter to the modal input so Enter triggers rename.
  • Introduces a new Vitest test covering Enter-to-confirm and blank-name behavior.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
web/oss/src/components/AgentChatSlice/hooks/useSessionActions.tsx Adds an Enter key handler to the rename modal input and refactors the submission logic into a shared closure.
web/oss/src/components/AgentChatSlice/hooks/useSessionActions.test.tsx Adds DOM-level tests validating the Enter key contract for the rename modal.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment on lines +118 to +126
onPressEnter={() => {
if (!next.trim()) return
dialog.current?.destroy()
void submit()
}}
/>
),
okText: "Rename",
onOk: async () => {
const title = next.trim()
if (!title) return
if (isCached(target) && target.appId) {
await store.set(renameSessionAtomFamily(target.appId), {
id: target.sessionId,
title,
})
} else {
const ok = await setSessionHeader({
sessionId: target.sessionId,
projectId,
name: title,
})
if (!ok) {
message.error("Couldn't rename this session")
return
}
}
revalidate()
},
onOk: submit,
Comment on lines +71 to +79
const host = document.createElement("div")
document.body.appendChild(host)
await act(async () => {
createRoot(host).render(
<App>
<Probe />
</App>,
)
})
@coderabbitai

coderabbitai Bot commented Aug 13, 2026

Copy link
Copy Markdown

Review Change Stack

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository YAML (base), Organization UI (inherited)

Review profile: CHILL

Plan: Pro Plus

Run ID: 926e424c-78e0-420b-a9dd-2a954dad80d5

📥 Commits

Reviewing files that changed from the base of the PR and between 0378eaf and f7aec58.

📒 Files selected for processing (2)
  • web/oss/src/components/AgentChatSlice/hooks/useSessionActions.test.tsx
  • web/oss/src/components/AgentChatSlice/hooks/useSessionActions.tsx
🚧 Files skipped from review as they are similar to previous changes (1)
  • web/oss/src/components/AgentChatSlice/hooks/useSessionActions.tsx

📝 Walkthrough

Summary by CodeRabbit

  • New Features

    • Session names can be submitted by pressing Enter in the rename dialog.
    • Names are trimmed before submission.
    • The dialog closes after a successful rename and preserves entered text when renaming fails.
  • Bug Fixes

    • Blank names cannot be submitted.
    • The Rename button is disabled when the name is blank.
    • Rename actions now show loading and cancellation states.
  • Tests

    • Added coverage for validation, keyboard submission, failure recovery, loading behavior, and button states.

Walkthrough

The session rename dialog now supports Enter-key confirmation. Shared submission logic validates names, manages loading and modal state, preserves failed edits, and updates the session. Tests cover successful, blank, pending, failed, and button-state behavior.

Changes

Session rename behavior

Layer / File(s) Summary
Shared rename submission and Enter handling
web/oss/src/components/AgentChatSlice/hooks/useSessionActions.tsx
The hook centralizes rename validation, asynchronous state, failure recovery, and modal handling. Enter and the Rename button submit trimmed, nonblank names through the shared handler.
Rename behavior validation
web/oss/src/components/AgentChatSlice/hooks/useSessionActions.test.tsx
Tests verify trimmed submission, blank-name rejection, loading behavior, success closure, failed submission recovery, portal cleanup, and Rename-button state changes.

Estimated code review effort: 3 (Moderate) | ~25 minutes

Merge Risk: 🔵 Low · up to f7aec

The rename dialog now confirms a trimmed nonblank name when Enter is pressed, while blank names keep the dialog open. The change is mergeable with owner awareness that the repository-required frontend lint-fix command should still be run before merge.

Sequence Diagram(s)

sequenceDiagram
  participant User
  participant RenameDialog
  participant useSessionActions
  participant RenameAction
  User->>RenameDialog: Press Enter or click Rename
  RenameDialog->>useSessionActions: Submit edited name
  useSessionActions->>RenameAction: Rename with trimmed name
  RenameAction-->>useSessionActions: Resolve or reject
  useSessionActions->>RenameDialog: Close on success or preserve edits on failure
Loading

Possibly related PRs

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly identifies the main change: confirming the session rename dialog when Enter is pressed.
Description check ✅ Passed The description explains the Enter-key fix, shared confirmation behavior, validation, tests, and verification results.
Linked Issues check ✅ Passed The changes satisfy issue #5951 by confirming the rename on Enter and closing the dialog after a successful rename.
Out of Scope Changes check ✅ Passed The validation, loading, error, duplicate-submission, and test changes support the rename confirmation objective and are not out of scope.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing Touches 💡 1
🛠️ Fix failing CI checks 💡
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

@github-actions github-actions Bot removed the incomplete-pr PR is missing required template sections or a demo recording label Aug 13, 2026
@github-actions github-actions Bot reopened this Aug 13, 2026
@mmabrouk

Copy link
Copy Markdown
Member

@MFA-G thank you for the PR, please sign the CLA for us to be able to merge it. Thanks! Also don't forget to address the comments

@mmabrouk mmabrouk left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Approved conditioned by the comment above

@dosubot dosubot Bot added the lgtm This PR has been approved by a maintainer label Aug 13, 2026
Address review: the Enter path guarded a blank name but onOk did not, so
the two confirmation paths could drift. The Rename button is now disabled
while the field is blank, which is the same condition Enter checks, and
the test unmounts its React root in afterEach like ProjectWatch.test.tsx.
Copilot AI review requested due to automatic review settings August 14, 2026 01:21
@MFA-G

MFA-G commented Aug 14, 2026

Copy link
Copy Markdown
Author

Thanks @mmabrouk and @copilot — both review comments addressed in 1e60d09.

1. Blank-name guard could drift between Enter and the Rename button. The Enter handler checked !next.trim() but onOk: submit did not, so the two confirmation paths were only accidentally consistent (submit bailed internally, but the button still closed the modal). Rather than duplicating the guard, the button is now disabled while the field is blank, driven by the same predicate Enter checks:

const isBlank = () => !next.trim()
...
onChange={(event) => {
    next = event.target.value
    dialog.current?.update({okButtonProps: {disabled: isBlank()}})
}}
onPressEnter={() => {
    if (isBlank()) return
    ...
}}
okButtonProps: {disabled: isBlank()},

That also makes the constraint visible to the user instead of a silent no-op on click.

2. Leaked React root in the test. mountRename now keeps the Root and container in module scope and afterEach unmounts + removes them, matching ProjectWatch.test.tsx.

Also added a third test asserting the button's disabled state tracks the field (enabled → blank disables → typing re-enables), so the two paths can't drift again.

npx vitest run src/components/AgentChatSlice/hooks/useSessionActions.test.tsx → 3 passed.

Re: the CLA — I'll get that signed.

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.

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated no new comments.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🧹 Nitpick comments (1)
web/oss/src/components/AgentChatSlice/hooks/useSessionActions.tsx (1)

105-109: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Shorten the new implementation comments.

  • web/oss/src/components/AgentChatSlice/hooks/useSessionActions.tsx#L105-L109: Remove the explanation or reduce it to one short line. The shared predicate makes the intent clear.
  • web/oss/src/components/AgentChatSlice/hooks/useSessionActions.test.tsx#L38-L44: Reduce the mock-path explanation to one short line.

As per coding guidelines: “Keep in-code comments to at most one short line; use longer comments only for genuinely surprising constraints such as bugs, races, or ordering requirements.”

Source: Coding guidelines


ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository YAML (base), Organization UI (inherited)

Review profile: CHILL

Plan: Pro Plus

Run ID: cc7baf54-8227-4049-b9d2-09da172d187d

📥 Commits

Reviewing files that changed from the base of the PR and between 728f39f and 1e60d09.

📒 Files selected for processing (2)
  • web/oss/src/components/AgentChatSlice/hooks/useSessionActions.test.tsx
  • web/oss/src/components/AgentChatSlice/hooks/useSessionActions.tsx

The blank-name cases deliberately leave the confirm dialog open, and root.unmount() does not close it: modal.confirm instances live in antd's global destroy registry, not the React root. Call Modal.destroyAll() before unmounting so no dialog leaks into the next test.
Copilot AI review requested due to automatic review settings August 14, 2026 07:45
@MFA-G

MFA-G commented Aug 14, 2026

Copy link
Copy Markdown
Author

Thanks @coderabbitai — good catch, fixed in 4e43bed.

You're right that root?.unmount() doesn't reach the confirm dialogs: modal.confirm instances register their close callback in antd's global destroy registry rather than being owned by the React root, so the two blank-name tests (which deliberately leave the dialog open) were leaving live instances behind. afterEach now calls Modal.destroyAll() inside the same act() before unmounting.

Suite still green: vitest run src/components/AgentChatSlice/hooks/useSessionActions.test.tsx → 3 passed.

@coderabbitai

coderabbitai Bot commented Aug 14, 2026

Copy link
Copy Markdown

Tip

For best results, initiate chat on the files or code changes.

@MFA-G Thanks for the fix and the detailed explanation. Calling Modal.destroyAll() inside act() cleans up the global Ant Design confirm dialogs that remain open in the blank-name tests.


If you found this review helpful, would you consider giving us a shout-out on X?

Thank you for using CodeRabbit!

You are interacting with an AI system.

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.

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated no new comments.

Suppressed comments (2)

web/oss/src/components/AgentChatSlice/hooks/useSessionActions.test.tsx:99

  • The test dispatches a KeyboardEvent using the deprecated keyCode field and an as never cast to satisfy typing. This is brittle and unnecessary here; key/code are sufficient for antd’s Enter handling and keep the test type-safe.
    await act(async () => {
        input.dispatchEvent(
            new KeyboardEvent("keydown", {key: "Enter", keyCode: 13, bubbles: true} as never),
        )
    })

web/oss/src/components/AgentChatSlice/hooks/useSessionActions.tsx:130

  • onPressEnter destroys the confirm immediately and then runs submit(). This bypasses Modal.confirm’s normal onOk promise lifecycle (e.g., keeping the modal open + showing the OK button loading state while the async rename runs), so Enter won’t behave the same as clicking Rename.
                        onPressEnter={() => {
                            if (isBlank()) return
                            dialog.current?.destroy()
                            void submit()
                        }}

Enter destroyed the dialog before submitting, so it skipped the loading state and error handling that clicking Rename gets from onOk. Both paths now share one confirm() that keeps the dialog open while the rename is in flight.
Copilot AI review requested due to automatic review settings August 14, 2026 13:17
@MFA-G

MFA-G commented Aug 14, 2026

Copy link
Copy Markdown
Author

Thanks @Copilot — both suppressed comments were fair, fixed in e872786.

1. onPressEnter bypassed the onOk lifecycle. You're right: destroying the dialog and then firing submit() meant Enter skipped everything Modal.confirm gives the button — the modal stayed up with the OK button in its loading state while the async rename runs, and stayed open if it rejected. Enter closed instantly and let the rename finish unobserved. Both paths now go through one confirm(), which is also what onOk returns:

const confirm = async () => {
    if (isBlank()) return
    dialog.current?.update({okButtonProps: {loading: true}, cancelButtonProps: {disabled: true}})
    try {
        await submit()
        dialog.current?.destroy()
    } catch {
        dialog.current?.update({
            okButtonProps: {loading: false, disabled: isBlank()},
            cancelButtonProps: {disabled: false},
        })
    }
}

Enter is now literally onPressEnter={() => void confirm()} and onOk: confirm, so the two can no longer diverge — the blank guard, the loading state, and the keep-open-on-failure behaviour all come from the same place. A fourth test pins the lifecycle: with a setSessionHeader that doesn't settle, pressing Enter leaves the input mounted and the Rename button in ant-btn-loading, and only after the promise resolves does the dialog close.

2. keyCode: 13 + as never in the test. Dropped. @rc-component/input checks e.key === 'Enter' only, so new KeyboardEvent("keydown", {key: "Enter", bubbles: true}) is enough and the cast goes away with it.

Suite green: vitest run src/components/AgentChatSlice/hooks/useSessionActions.test.tsx → 4 passed. ESLint clean on both files.

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.

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated no new comments.

Suppressed comments (1)

web/oss/src/components/AgentChatSlice/hooks/useSessionActions.tsx:132

  • onPressEnter calls confirm() directly, but confirm() has no in-flight guard. Users can hit Enter multiple times while the request is pending (the input stays enabled), which can issue duplicate rename mutations and potentially race the dialog lifecycle. Add a local confirming flag (or disable the input) so the Enter path is idempotent while a rename is in flight.
            const confirm = async () => {
                if (isBlank()) return
                dialog.current?.update({
                    okButtonProps: {loading: true},
                    cancelButtonProps: {disabled: true},

The OK button's loading state blocks a second click while a rename is in
flight, but the input stays enabled, so repeated Enter presses could each
call submit() and issue duplicate rename mutations.
Copilot AI review requested due to automatic review settings August 15, 2026 07:54
@MFA-G

MFA-G commented Aug 15, 2026

Copy link
Copy Markdown
Author

Thanks @copilot — valid, fixed in 0378eaf.

confirm() had no in-flight guard. The OK button goes into its loading state during the rename, which blocks a second click, but the Input stays focused and enabled — so holding/repeating Enter while the request was pending called submit() again each time, issuing duplicate rename mutations and racing the dialog lifecycle (the second resolution calls destroy() on an already-destroyed dialog).

confirm() is now idempotent while a rename is in flight:

let pending = false

const confirm = async () => {
    if (pending || isBlank()) return
    pending = true
    ...
    } finally {
        pending = false
    }
}

The finally reset matters for the failure path: a rejected rename leaves the dialog open to retry, so the flag has to clear or Enter would be dead for the rest of the dialog’s life.

On a regression test for this: I tried to add one and could not make it prove anything, so I left it out rather than ship a test that passes either way. The suite drives the dialog by dispatching native KeyboardEvents at the input (no @testing-library/react in the repo). Within a single mounted dialog, React’s synthetic onPressEnter fires only on the first dispatch — subsequent identical dispatches reach the DOM but not the React handler:

iter 0 native 1 react 1 sameNode true
iter 1 native 2 react 1 sameNode true
iter 2 native 3 react 1 sameNode true

(native = a raw listener on the same node, react = a counter inside onPressEnter.) So a "presses Enter three times" test asserts setSessionHeader was called once and passes with or without the guard — it exercises the harness, not the fix. Happy to add one if there is an established way to deliver repeated synthetic key events in this setup that I have missed.

The existing 4 rename tests still pass (vitest run useSessionActions.test.tsx), and prettier is clean.

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.

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

Suppressed comments (2)

web/oss/src/components/AgentChatSlice/hooks/useSessionActions.tsx:152

  • The onChange handler updates okButtonProps without preserving the loading flag set by the Enter path (confirm()), so typing while a rename is pending will clear the loading state and can re-enable the OK button even though the request is still in-flight.
                        onChange={(event) => {
                            next = event.target.value
                            dialog.current?.update({okButtonProps: {disabled: isBlank()}})

web/oss/src/components/AgentChatSlice/hooks/useSessionActions.test.tsx:98

  • pressEnter() dispatches the key event inside act(), but it doesn't wait for the async rename started by onPressEnter={() => void confirm()} to settle. Assertions immediately after await pressEnter(...) can race with the modal updates / destroy, making the tests flaky.
const pressEnter = async (input: HTMLInputElement) => {
    await act(async () => {
        input.dispatchEvent(new KeyboardEvent("keydown", {key: "Enter", bubbles: true}))
    })
}

Comment on lines +79 to +99
const submit = async () => {
const title = next.trim()
if (!title) return
if (isCached(target) && target.appId) {
await store.set(renameSessionAtomFamily(target.appId), {
id: target.sessionId,
title,
})
} else {
const ok = await setSessionHeader({
sessionId: target.sessionId,
projectId,
name: title,
})
if (!ok) {
message.error("Couldn't rename this session")
return
}
}
revalidate()
}

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Good catch — fixed in f7aec58.

You were right on both counts, and the second one was the worse bug: onOk: submit meant the button path had the same problem, not just Enter. A failed rename closed the dialog and threw the typed name away behind an error toast.

submit() now rejects instead of returning on failure. While wiring that up, returning the rejection from onOk turned out to be the wrong lever: antd's ActionButton re-raises a rejected onOk as an unhandled rejection (_util/ActionButton.js, the Promise.reject(e) branch), which vitest flags as an unhandled error even though the dialog behaves correctly. So the OK button now confirms through the same confirm() helper as Enter, via okButtonProps.onClick — antd spreads okButtonProps over its own handler, so this replaces it. One lifecycle, one in-flight guard, one failure path for both.

Two tests were added, both of which fail on the previous commit:

 ✓ confirms on the Rename button with the edited name
 × keeps the dialog open when the rename fails, confirmed with Enter
 × keeps the dialog open when the rename fails, confirmed with the Rename button

and pass now:

 Test Files  1 passed (1)
      Tests  7 passed (7)

eslint clean on both files; tsgo --noEmit reports nothing for them.

submit() returned normally when setSessionHeader() reported failure, so
both confirmation paths treated a failed rename as a success: the button's
onOk closed the dialog, and Enter's catch block never ran, discarding the
typed name behind an error toast.

submit() now rejects on failure. The OK button confirms through the same
confirm() helper as Enter rather than through onOk, because onOk's only
way to hold the dialog open is a rejected promise, which antd re-raises
as an unhandled rejection.
Copilot AI review requested due to automatic review settings August 15, 2026 13:16
@dosubot dosubot Bot added size:L This PR changes 100-499 lines, ignoring generated files. and removed size:M This PR changes 30-99 lines, ignoring generated files. labels Aug 15, 2026

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug frontend lgtm This PR has been approved by a maintainer size:L This PR changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

(bug) The rename session dialog ignores Enter and only confirms on the button

4 participants