Skip to content

fix: emoji input blocked in command palette rename - #2

Draft
pandec wants to merge 3 commits into
upstream-main-syncfrom
fix/emoji-input-command-palette-rename
Draft

pandec wants to merge 3 commits into
upstream-main-syncfrom
fix/emoji-input-command-palette-rename

Conversation

@pandec

@pandec pandec commented Mar 28, 2026 •

Copy link
Copy Markdown
Owner

Summary

  • Emoji input could not be used reliably in command palette rename, especially when replacing selected text through the macOS emoji picker.
  • Root cause: the rename field went through the shared SwiftUI/AppKit field-editor path, which could lose a stable text input client after emoji-picker replacement. Subsequent picker interactions no longer targeted the rename field correctly.
  • Fix: move command palette rename onto a dedicated native AppKit NSTextView path and update palette responder ownership and focus handling so the emoji picker stays attached to the rename field.
  • Command palette search is intentionally unchanged. Its detached-picker behavior after selected replacement remains a separate preexisting issue.

Related: manaflow-ai#2161

Test plan

  • Open command palette rename for a workspace or tab and insert an emoji from the macOS emoji picker
  • Replace the selected name with an emoji, reopen rename, and repeat selected-text replacement multiple times
  • Verify plain typing, emoji paste, Escape, Enter, and delete-to-exit still work in rename
  • Verify command palette search behavior is unchanged and still tracked separately

@pandec pandec changed the title Fix emoji input in command palette rename fix: emoji input blocked in command palette rename Mar 28, 2026
@pandec
pandec changed the base branch from main to upstream-main-sync March 28, 2026 07:34
@pandec
pandec force-pushed the fix/emoji-input-command-palette-rename branch from fb86f58 to daea480 Compare March 28, 2026 07:34
Comment thread Sources/ContentView.swift
}
}

private struct CommandPaletteTextInputRepresentable: NSViewRepresentable {

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

I tried keeping the existing SwiftUI TextField / NSTextField path and could not make repeated selected-text emoji replacement stable. The dedicated NSTextView gives the emoji picker a persistent text-input client while preserving single-line rename behavior.

Comment thread Sources/ContentView.swift
}

private func firstEditableTextField(in view: NSView) -> NSTextField? {
private func firstEditableTextInputView(in view: NSView) -> NSView? {

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

Rename no longer uses the shared field editor, so the palette focus/select-all helpers have to recognize a native NSTextView responder as well as the old NSTextField/field-editor path.

Comment thread Sources/ContentView.swift
}
}

func invalidateTextInputGeometry(for textView: NSTextView) {

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

These calls are here so AppKit refreshes text geometry after programmatic selection changes; without that, the emoji picker can keep anchoring to stale character coordinates.

@pandec
pandec force-pushed the fix/emoji-input-command-palette-rename branch from 15b6733 to f9ae7c0 Compare March 28, 2026 11:00
pandec pushed a commit that referenced this pull request Oct 15, 2026
* Make bare CodeRouter show account usage

* Pin hosted usage support and preserve agent config
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