the consistency of the go-to-anything interaction #20647

Closed
opened 2026-02-21 20:08:18 -05:00 by yindo · 1 comment
Owner

Originally created by @hjlarry on GitHub (Nov 28, 2025).

Originally assigned to: @hjlarry on GitHub.

Self Checks

  • I have read the Contributing Guide and Language Policy.
  • I have searched for existing issues search for existing issues, including closed ones.
  • I confirm that I am using English to submit this report, otherwise it will be closed.
  • Please do not modify this template :) and fill in all the required fields.

1. Is this request related to a challenge you're experiencing? Tell me about your story.

When you type a / or @, the first item in the results will be automatically selected, and the item will be highlighted when your mouse hover over it.

Image

But these interactions will have no effect when you type any other letters.

Image

2. Additional context or comments

No response

3. Can you help us with this feature?

  • I am interested in contributing to this feature.
Originally created by @hjlarry on GitHub (Nov 28, 2025). Originally assigned to: @hjlarry on GitHub. ### Self Checks - [x] I have read the [Contributing Guide](https://github.com/langgenius/dify/blob/main/CONTRIBUTING.md) and [Language Policy](https://github.com/langgenius/dify/issues/1542). - [x] I have searched for existing issues [search for existing issues](https://github.com/langgenius/dify/issues), including closed ones. - [x] I confirm that I am using English to submit this report, otherwise it will be closed. - [x] Please do not modify this template :) and fill in all the required fields. ### 1. Is this request related to a challenge you're experiencing? Tell me about your story. When you type a `/` or `@`, the first item in the results will be automatically selected, and the item will be highlighted when your mouse hover over it. <img width="1080" height="736" alt="Image" src="https://github.com/user-attachments/assets/facdc61a-6737-4af5-97cf-f5f3eab2360e" /> But these interactions will have no effect when you type any other letters. <img width="1100" height="806" alt="Image" src="https://github.com/user-attachments/assets/5308fd42-92f7-4870-bf84-1b49fb3966e5" /> ### 2. Additional context or comments _No response_ ### 3. Can you help us with this feature? - [x] I am interested in contributing to this feature.
yindo added the 💪 enhancement label 2026-02-21 20:08:18 -05:00
yindo closed this issue 2026-02-21 20:08:18 -05:00
Author
Owner

@dosubot[bot] commented on GitHub (Nov 28, 2025):

The inconsistency you noticed is intentional in the current implementation: when you type / or @, the go-to-anything palette enters a special command mode and auto-selects the first result, but for general search queries (any other input), auto-selection is explicitly disabled to avoid unwanted selection when searching for arbitrary items. This is controlled in the code by clearing the selection unless the input starts with / or @ (source).

There are open issues recognizing this as a UX problem and suggesting that auto-selection should be consistent for all input types to improve keyboard-driven workflows (issue 25636). The main files to update are web/app/components/goto-anything/index.tsx (where input handling and selection state are managed) and web/app/components/goto-anything/command-selector.tsx (which handles command selection and auto-highlighting).

To make auto-selection consistent, you would need to change the logic so that the first result is always selected, regardless of input prefix. This means removing or adjusting the part of the input handler that calls clearSelection() for non-command inputs, and ensuring the selection state (cmdVal) always points to the first available result when the list changes.

If you want to contribute this improvement, it's a good idea to also update or add tests in web/__tests__/goto-anything/command-selector.test.tsx to verify the new behavior and prevent regressions (related discussion).

Let me know if you want a step-by-step code pointer or have specific edge cases in mind!

To reply, just mention @dosu.


How did I do? Good | Irrelevant | Incorrect | Verbose | Hallucination | Report 🐛 | Other

Chat with Dosu Open in Cursor Join Discord Share on X

@dosubot[bot] commented on GitHub (Nov 28, 2025): <!-- Answer --> The inconsistency you noticed is intentional in the current implementation: when you type `/` or `@`, the go-to-anything palette enters a special command mode and auto-selects the first result, but for general search queries (any other input), auto-selection is explicitly disabled to avoid unwanted selection when searching for arbitrary items. This is controlled in the code by clearing the selection unless the input starts with `/` or `@` ([source](https://github.com/langgenius/dify/blob/037389137d3ee4ea2daea7b6bfd641e9bae515a7/web/app/components/goto-anything/index.tsx#L1-L495)). There are open issues recognizing this as a UX problem and suggesting that auto-selection should be consistent for all input types to improve keyboard-driven workflows ([issue 25636](https://github.com/langgenius/dify/issues/25636)). The main files to update are `web/app/components/goto-anything/index.tsx` (where input handling and selection state are managed) and `web/app/components/goto-anything/command-selector.tsx` (which handles command selection and auto-highlighting). To make auto-selection consistent, you would need to change the logic so that the first result is always selected, regardless of input prefix. This means removing or adjusting the part of the input handler that calls `clearSelection()` for non-command inputs, and ensuring the selection state (`cmdVal`) always points to the first available result when the list changes. If you want to contribute this improvement, it's a good idea to also update or add tests in `web/__tests__/goto-anything/command-selector.test.tsx` to verify the new behavior and prevent regressions ([related discussion](https://github.com/langgenius/dify/issues/23861)). Let me know if you want a step-by-step code pointer or have specific edge cases in mind! <!-- Dosu Comment Footer --> *To reply, just mention [@dosu](https://go.dosu.dev/dosubot).* --- <sup>How did I do? [Good](https://app.dosu.dev/response-feedback/568b7924-dfd0-4bde-b575-e75545f997b6?feedback_type=great_response) | [Irrelevant](https://app.dosu.dev/response-feedback/568b7924-dfd0-4bde-b575-e75545f997b6?feedback_type=irrelevant_answer) | [Incorrect](https://app.dosu.dev/response-feedback/568b7924-dfd0-4bde-b575-e75545f997b6?feedback_type=incorrect_sources) | [Verbose](https://app.dosu.dev/response-feedback/568b7924-dfd0-4bde-b575-e75545f997b6?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/568b7924-dfd0-4bde-b575-e75545f997b6?feedback_type=hallucination) | [Report 🐛](https://app.dosu.dev/response-feedback/568b7924-dfd0-4bde-b575-e75545f997b6?feedback_type=bug_report) | [Other](https://app.dosu.dev/response-feedback/568b7924-dfd0-4bde-b575-e75545f997b6?feedback_type=other)</sup> [![Chat with Dosu](https://dosu.dev/dosu-chat-badge.svg)](https://app.dosu.dev/6088a4f4-073a-43f3-b3d4-4f06fb0c05a0/ask?utm_source=github)&nbsp;[![Open in Cursor](https://dosu.dev/dosu-in-cursor.svg)](https://cursor.com/link/prompt?text=The%20inconsistency%20you%20noticed%20is%20intentional%20in%20the%20current%20implementation%3A%20when%20you%20type%20%60/%60%20or%20%60%40%60%2C%20the%20go-to-anything%20palette%20enters%20a%20special%20command%20mode%20and%20auto-selects%20the%20first%20result%2C%20but%20for%20general%20search%20queries%20%28any%20other%20input%29%2C%20auto-selection%20is%20explicitly%20disabled%20to%20avoid%20unwanted%20selection%20when%20searching%20for%20arbitrary%20items.%20This%20is%20controlled%20in%20the%20code%20by%20clearing%20the%20selection%20unless%20the%20input%20starts%20with%20%60/%60%20or%20%60%40%60%C2%A0%28%5Bsource%5D%28https%3A//github.com/langgenius/dify/blob/037389137d3ee4ea2daea7b6bfd641e9bae515a7/web/app/components/goto-anything/index.tsx%23L1-L495%29%29.%0A%0AThere%20are%20open%20issues%20recognizing%20this%20as%20a%20UX%20problem%20and%20suggesting%20that%20auto-selection%20should%20be%20consistent%20for%20all%20input%20types%20to%20improve%20keyboard-driven%20workflows%C2%A0%28%5Bissue%2025636%5D%28https%3A//github.com/langgenius/dify/issues/25636%29%29.%20The%20main%20files%20to%20update%20are%20%60web/app/components/goto-anything/index.tsx%60%20%28where%20input%20handling%20and%20selection%20state%20are%20managed%29%20and%20%60web/app/components/goto-anything/command-selector.tsx%60%20%28which%20handles%20command%20selection%20and%20auto-highlighting%29.%0A%0ATo%20make%20auto-selection%20consistent%2C%20you%20would%20need%20to%20change%20the%20logic%20so%20that%20the%20first%20result%20is%20always%20selected%2C%20regardless%20of%20input%20prefix.%20This%20means%20removing%20or%20adjusting%20the%20part%20of%20the%20input%20handler%20that%20calls%20%60clearSelection%28%29%60%20for%20non-command%20inputs%2C%20and%20ensuring%20the%20selection%20state%20%28%60cmdVal%60%29%20always%20points%20to%20the%20first%20available%20result%20when%20the%20list%20changes.%0A%0AIf%20you%20want%20to%20contribute%20this%20improvement%2C%20it%27s%20a%20good%20idea%20to%20also%20update%20or%20add%20tests%20in%20%60web/__tests__/goto-anything/command-selector.test.tsx%60%20to%20verify%20the%20new%20behavior%20and%20prevent%20regressions%C2%A0%28%5Brelated%20discussion%5D%28https%3A//github.com/langgenius/dify/issues/23861%29%29.%0A%0ALet%20me%20know%20if%20you%20want%20a%20step-by-step%20code%20pointer%20or%20have%20specific%20edge%20cases%20in%20mind%21)&nbsp;[![Join Discord](https://img.shields.io/badge/join-5865F2?logo=discord&logoColor=white&label=)](https://go.dosu.dev/discord-bot)&nbsp;[![Share on X](https://img.shields.io/badge/X-share-black)](https://twitter.com/intent/tweet?text=%40dosu_ai%20helped%20me%20solve%20this%20issue!&url=https%3A//github.com/langgenius/dify/issues/28856)
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify#20647