[PR #8033] [CLOSED] fix: arrow key sometimes jumps to wrong index in search panel #8278

Closed
opened 2026-03-23 23:23:26 +00:00 by mirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/AppFlowy-IO/AppFlowy/pull/8033
Author: @asjqkkkk
Created: 6/5/2025
Status: Closed

Base: mainHead: fix/search/issues


📝 Commits (2)

  • b610123 fix: arrow key sometimes jump to wrong index in search panel
  • 88a736c fix: enter key will open the page

📊 Changes

8 files changed (+438 additions, -165 deletions)

View changed files

📝 frontend/appflowy_flutter/lib/workspace/presentation/command_palette/command_palette.dart (+6 -3)
frontend/appflowy_flutter/lib/workspace/presentation/command_palette/widgets/keyboard_scroller.dart (+167 -0)
📝 frontend/appflowy_flutter/lib/workspace/presentation/command_palette/widgets/recent_views_list.dart (+92 -40)
📝 frontend/appflowy_flutter/lib/workspace/presentation/command_palette/widgets/search_ask_ai_entrance.dart (+1 -0)
📝 frontend/appflowy_flutter/lib/workspace/presentation/command_palette/widgets/search_field.dart (+1 -12)
📝 frontend/appflowy_flutter/lib/workspace/presentation/command_palette/widgets/search_recent_view_cell.dart (+18 -14)
📝 frontend/appflowy_flutter/lib/workspace/presentation/command_palette/widgets/search_result_cell.dart (+28 -34)
📝 frontend/appflowy_flutter/lib/workspace/presentation/command_palette/widgets/search_results_list.dart (+125 -62)

📄 Description

Feature Preview


PR Checklist

  • My code adheres to AppFlowy's Conventions
  • I've listed at least one issue that this PR fixes in the description above.
  • I've added a test(s) to validate changes in this PR, or this PR only contains semantic changes.
  • All existing tests are passing.

Summary by Sourcery

Integrate a new KeyboardScroller utility with area detectors to unify arrow-key navigation and scrolling logic in the command palette’s search results and recent views panels, refactor list and cell widgets to wrap content in scroll controllers, reposition the search field, and simplify focus handling.

New Features:

  • Add KeyboardScroller component to manage arrow-key navigation and auto-scrolling across list panels

Bug Fixes:

  • Fix arrow-key navigation jumping to wrong index in the search panel by integrating KeyboardScroller and area detectors

Enhancements:

  • Refactor SearchResultList and RecentViewsList to use ScrollControllerBuilder and KeyboardScroller for unified navigation
  • Move SearchField into scrollable list views and simplify its focus handling
  • Enhance result and recent view cells to register AreaDetectors for correct auto-scrolling behavior
  • Adjust CommandPaletteModal to conditionally display the search field, recent list, or result list based on query state

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/AppFlowy-IO/AppFlowy/pull/8033 **Author:** [@asjqkkkk](https://github.com/asjqkkkk) **Created:** 6/5/2025 **Status:** ❌ Closed **Base:** `main` ← **Head:** `fix/search/issues` --- ### 📝 Commits (2) - [`b610123`](https://github.com/AppFlowy-IO/AppFlowy/commit/b610123150b913fcc710368fc9ef97d82c278ac3) fix: arrow key sometimes jump to wrong index in search panel - [`88a736c`](https://github.com/AppFlowy-IO/AppFlowy/commit/88a736cec9d3cc107a0d5099dcde1cc185074be6) fix: enter key will open the page ### 📊 Changes **8 files changed** (+438 additions, -165 deletions) <details> <summary>View changed files</summary> 📝 `frontend/appflowy_flutter/lib/workspace/presentation/command_palette/command_palette.dart` (+6 -3) ➕ `frontend/appflowy_flutter/lib/workspace/presentation/command_palette/widgets/keyboard_scroller.dart` (+167 -0) 📝 `frontend/appflowy_flutter/lib/workspace/presentation/command_palette/widgets/recent_views_list.dart` (+92 -40) 📝 `frontend/appflowy_flutter/lib/workspace/presentation/command_palette/widgets/search_ask_ai_entrance.dart` (+1 -0) 📝 `frontend/appflowy_flutter/lib/workspace/presentation/command_palette/widgets/search_field.dart` (+1 -12) 📝 `frontend/appflowy_flutter/lib/workspace/presentation/command_palette/widgets/search_recent_view_cell.dart` (+18 -14) 📝 `frontend/appflowy_flutter/lib/workspace/presentation/command_palette/widgets/search_result_cell.dart` (+28 -34) 📝 `frontend/appflowy_flutter/lib/workspace/presentation/command_palette/widgets/search_results_list.dart` (+125 -62) </details> ### 📄 Description ### Feature Preview <!--- List at least one issue here that this PR addresses. If it fixes the issue, please use the [fixes](https://docs.github.com/en/get-started/writing-on-github/working-with-advanced-formatting/using-keywords-in-issues-and-pull-requests) keyword to close the issue. For example: fixes https://github.com/AppFlowy-IO/AppFlowy/pull/2106 --> --- <!--- Before you mark this PR ready for review, run through this checklist! --> #### PR Checklist - [x] My code adheres to [AppFlowy's Conventions](https://docs.appflowy.io/docs/documentation/software-contributions/conventions) - [ ] I've listed at least one issue that this PR fixes in the description above. - [ ] I've added a test(s) to validate changes in this PR, or this PR only contains semantic changes. - [ ] All existing tests are passing. ## Summary by Sourcery Integrate a new KeyboardScroller utility with area detectors to unify arrow-key navigation and scrolling logic in the command palette’s search results and recent views panels, refactor list and cell widgets to wrap content in scroll controllers, reposition the search field, and simplify focus handling. New Features: - Add KeyboardScroller component to manage arrow-key navigation and auto-scrolling across list panels Bug Fixes: - Fix arrow-key navigation jumping to wrong index in the search panel by integrating KeyboardScroller and area detectors Enhancements: - Refactor SearchResultList and RecentViewsList to use ScrollControllerBuilder and KeyboardScroller for unified navigation - Move SearchField into scrollable list views and simplify its focus handling - Enhance result and recent view cells to register AreaDetectors for correct auto-scrolling behavior - Adjust CommandPaletteModal to conditionally display the search field, recent list, or result list based on query state --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
mirror 2026-03-23 23:23:26 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
AppFlowy-IO/AppFlowy#8278
No description provided.