Skip to content

fix: do not offer to clear an empty composer - #1445

Closed
RealBhupesh wants to merge 1 commit into
Nano-Collective:mainfrom
RealBhupesh:fix/escape-empty-composer
Closed

RealBhupesh wants to merge 1 commit into
Nano-Collective:mainfrom
RealBhupesh:fix/escape-empty-composer

Conversation

@RealBhupesh

Copy link
Copy Markdown
Contributor

Fixes #1430.

Escape always showed "Press escape again to clear", even when the composer text and attachments were already empty. The hint is now shown only when there is something to clear.

Test plan

  • composer-clear.spec.ts

Made with Cursor

Escape always showed "Press escape again to clear", including when the
input and attachments were already empty.

Fixes Nano-Collective#1430
@github-actions

Copy link
Copy Markdown
Contributor

No changeset found

This PR does not add a changeset, so it will not appear in the changelog or trigger a release.

If the change is user-facing, add one:

pnpm changeset

Pick a bump (patch / minor / major) and write the changelog entry in our usual voice ("Added X... Thanks to @you. Closes #123."), then commit the generated .changeset/*.md file.

If this PR is docs-only or a chore that needs no release note, you can ignore this — or run pnpm changeset --empty to record that intentionally.

@github-actions github-actions Bot added the area:tui Terminal UI label Sep 23, 2026
@github-actions

Copy link
Copy Markdown
Contributor

nc-review: needs work — 2 blocking, 1 nit

@RealBhupesh — there is a blocking item below.

The PR correctly gates the composer-clear hint on shouldOfferInputClear(input, attachments.length) in both branches of handleEscape (including a reset on the second Escape when content has since been emptied) and adds a small, well-named helper with colocated unit tests. It resolves issue #1430 as described. However, PR #1437 from awhite0030 (fix: prevent escape from offering to clear an empty input box) is already open against the same problem and a user-facing behavioural change of this shape requires a changeset, which is absent.

Possible duplicate of #1437 — worth checking before going further.

🔴 blocking · duplicate · source/components/user-input.tsx:660

PR #1437 (fix/escape-empty-input-4098719853249926375, awhite0030) targets the same bug described in issue #1430 — Escape offering to clear an empty composer — with a near-identical title (fix: prevent escape from offering to clear an empty input box). Both PRs read the same root cause and the same suggested fix in the issue. Per the rubric, two PRs solving the same problem are duplicates; this is not a same-file coincidence. The two authors should coordinate: one closes the issue, the other closes or rebases onto the result.

🔴 blocking · changeset

The diff changes user-visible behaviour — pressing Escape on an empty composer no longer surfaces the 'Press escape again to clear' hint — but changed_files contains no .changeset/*.md. The project rubric is explicit that user-facing changes need a changeset, and the package name must be @nanocollective/nanocoder (a wrong name passes file-presence and breaks release-prepare). Add a changeset such as:

---
"@nanocollective/nanocoder": patch
---

Escape no longer offers to clear the composer when the input is empty and no images are attached. Closes #1430

⚪ nit · design · source/components/composer-clear.ts:4

The doc comment frames shouldOfferInputClear as "Whether Escape should offer to clear the composer", which leaks the call site into the predicate. The function actually answers "does the composer have anything to clear right now?" — that is the property the tests assert and the one callers should depend on. A name like hasComposerContent (or rewording the comment) would describe the predicate without coupling it to the Escape key, so a future second caller (e.g. a /clear slash command, a confirmation dialog) is not misleadingly scoped. Optional.


🔴 blocking · 🟠 a reviewer would ask for a change · ⚪ optional

Automated code review — correctness, security, design, tests, plus duplicates and scope. A human still decides; this is not a substitute for review and is not exhaustive. The required status checks separately cover lint, formatting, types, unused dependencies, the test suite and the build. This bot never merges. Maintainers can rerun with /re-review.

@github-actions github-actions Bot added the agent:needs-work nc-review found blocking findings label Sep 23, 2026
@github-actions

github-actions Bot commented Oct 3, 2026

Copy link
Copy Markdown
Contributor

Hi @RealBhupesh, thanks for this PR! It looks like a maintainer has left feedback
or review activity and there are still some outstanding items to wrap up.

Whenever you get a chance, could you take a look at the open comments?
If anything is unclear or you'd like a hand, just reply here and we'll help you get it across the line.

@github-actions

Copy link
Copy Markdown
Contributor

Hi @RealBhupesh, just a heads-up that this PR still has outstanding items
and hasn't seen any activity in a while.

If we don't hear back within about a week, we'll close it to keep the queue tidy.
You can always reopen it later. Happy to help if anything is blocking you - just say the word.

@github-actions

Copy link
Copy Markdown
Contributor

Closing this PR for now since there hasn't been any activity from @RealBhupesh after the earlier heads-up.No worries at all - this isn't a rejection. If you'd like to pick it back up, just push a new commit or leave a comment and reopen it. Thanks for the contribution!

@github-actions github-actions Bot closed this Oct 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agent:needs-work nc-review found blocking findings area:tui Terminal UI stale:final-warning

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] Escape offers to "clear" an already-empty input box

1 participant