Skip to content

feat(ui): add ESC dialog dismissal, kanban scrollbar, zoom setting, and navigation shortcuts - #8983

Open
YadneshTeli wants to merge 3 commits into
AppFlowy-IO:mainfrom
YadneshTeli:feat/ui-fixes-navigation-shortcuts
Open

YadneshTeli wants to merge 3 commits into
AppFlowy-IO:mainfrom
YadneshTeli:feat/ui-fixes-navigation-shortcuts

Conversation

@YadneshTeli

@YadneshTeli YadneshTeli commented Aug 31, 2026

Copy link
Copy Markdown

Summary of Changes

This PR resolves multiple UI/UX, navigation, and usability issues across the desktop and mobile clients:

  1. ESC Key Dismissal for Dialogs & Peek Windows (Fixes [Bug] Somehow couldn't close the peek window using ESC key #8948):

    • Wrapped FlowyDialog with CallbackShortcuts and FocusScope bound to LogicalKeyboardKey.escape, allowing Peek windows (Row Detail) and all FlowyDialog overlays to be dismissed reliably with ESC.
  2. Kanban Horizontal Scrollbar (Fixes [Bug] Hard to scroll horizontally to see more groups in Kanban #8947):

    • Added an interactive horizontal Scrollbar attached to scrollController in board_page.dart, enabling smooth horizontal scrolling for mouse users.
  3. Sidebar Bottom "New Page" Button Consistency (Fixes [Bug] Default template not used if adding page at the bottom #8973):

    • Added setAsCurrent: true to createRootViewInSection in SidebarSectionsBloc so creating a page from the sidebar bottom button opens and initializes default templates properly.
  4. Workspace Settings UI Zoom Indicator & Reset (Fixes [FR] Show current UI zoom state on settings page ("Workspace" section) #5396):

    • Added _ZoomLevelSetting in settings_workspace_view.dart displaying the active UI zoom percentage (e.g. 100%, 110%), shortcut hints (Ctrl/Cmd +, Ctrl/Cmd -), and a reset action.
  5. Page / Tab Back & Forward Navigation Shortcuts (Fixes [FR] Create shortcuts for going back / forward a page #2306):

    • Added Alt+Left / Alt+Right (and Cmd+[ / Cmd+] on macOS) shortcuts in hotkeys.dart for navigating tab history.
  6. Build & Compatibility Fixes:

    • Updated Flutter 3.44 / Dart 3.12 theme data types in af_dropdown_menu.dart and settings_dropdown.dart.
    • Fixed flutter_svg import in appflowy_ui example.

Testing & Verification

  • Ran flutter analyze across the entire repository -> 0 errors.
  • Verified all shortcut handlers and dialog bindings.

Summary by Sourcery

Improve desktop and mobile navigation and usability with reliable dialog dismissal, enhanced Kanban scrolling, workspace zoom controls, and tab history shortcuts.

New Features:

  • Add workspace zoom controls with a live percentage indicator, keyboard shortcut guidance, and reset support.
  • Add back and forward navigation through tab history using platform-specific keyboard shortcuts.
  • Provide interactive horizontal scrolling for Kanban boards.

Bug Fixes:

  • Allow dialogs and peek windows to close reliably with the Escape key.
  • Open newly created sidebar pages as the current view so their default templates initialize correctly.

Build:

  • Update Flutter theme types and broaden dependency compatibility for newer Flutter and Dart releases.
  • Correct the SVG import used by the appflowy_ui menu example.

@sourcery-ai

sourcery-ai Bot commented Aug 31, 2026

Copy link
Copy Markdown
Contributor

Reviewer's Guide

This PR adds keyboard dismissal and navigation shortcuts, improves Kanban and sidebar interaction behavior, exposes a reactive workspace zoom setting with reset support, and applies Flutter 3.44/Dart 3.12 compatibility and dependency updates.

Sequence diagram for ESC dialog dismissal

sequenceDiagram
    participant User
    participant FlowyDialog
    participant Navigator

    User->>FlowyDialog: Press Escape
    FlowyDialog->>Navigator: maybePop()
Loading

Sequence diagram for zoom setting updates

sequenceDiagram
    participant User
    participant HomeHotKeys
    participant ZoomNotifier
    participant SettingsWorkspaceView
    participant WindowSizeManager

    User->>HomeHotKeys: Press zoom shortcut
    HomeHotKeys->>ZoomNotifier: scaleApp(scaleFactor)
    HomeHotKeys->>WindowSizeManager: setScaleFactor(fixedScale)
    ZoomNotifier-->>SettingsWorkspaceView: Rebuild zoom indicator
    User->>SettingsWorkspaceView: Request reset
    SettingsWorkspaceView->>HomeHotKeys: resetAppScale()
    HomeHotKeys->>ZoomNotifier: scaleApp(1.0)
    HomeHotKeys->>WindowSizeManager: setScaleFactor(1.0)
Loading

File-Level Changes

Change Details Files
Added reliable ESC dismissal for dialogs and peek windows.
  • Wrapped dialog content in CallbackShortcuts and an autofocus FocusScope.
  • Dismissed the root-navigator overlay with Escape via maybePop.
frontend/appflowy_flutter/packages/flowy_infra_ui/lib/src/flowy_overlay/flowy_dialog.dart
Improved Kanban horizontal scrolling for pointer-based users.
  • Wrapped the board in an always-visible interactive Scrollbar using the existing horizontal controller.
  • Preserved board layout, builders, and controller wiring beneath the new scrollbar.
frontend/appflowy_flutter/lib/plugins/database/board/presentation/board_page.dart
Corrected sidebar page creation initialization.
  • Marked newly created root views as current so default templates and page state initialize correctly.
frontend/appflowy_flutter/lib/workspace/application/menu/sidebar_sections_bloc.dart
Exposed and centralized application zoom state and controls.
  • Replaced the global scale value with a ValueNotifier-backed getter/setter.
  • Extracted scale and reset operations with integration-test handling and persisted window scaling.
  • Added a workspace settings row showing the percentage, shortcut hints, and conditional reset action.
frontend/appflowy_flutter/lib/workspace/presentation/home/hotkeys.dart
frontend/appflowy_flutter/lib/workspace/presentation/settings/pages/settings_workspace_view.dart
Added platform-specific tab history navigation shortcuts.
  • Mapped Alt+Left/Right on non-macOS platforms and Cmd+[ / Cmd+] on macOS to previous/next tab selection.
frontend/appflowy_flutter/lib/workspace/presentation/home/hotkeys.dart
Updated Flutter/Dart compatibility and dependency declarations.
  • Migrated menu input decoration types to InputDecorationThemeData.
  • Fixed the flutter_svg example import.
  • Relaxed analyzer and selected package constraints and refreshed dependency resolution with overrides.
frontend/appflowy_flutter/lib/flutter/af_dropdown_menu.dart
frontend/appflowy_flutter/lib/workspace/presentation/settings/shared/settings_dropdown.dart
frontend/appflowy_flutter/packages/appflowy_ui/example/lib/src/menu/menu_page.dart
frontend/appflowy_flutter/packages/flowy_infra/pubspec.yaml
frontend/appflowy_flutter/packages/flowy_infra_ui/pubspec.yaml
frontend/appflowy_flutter/pubspec.yaml
frontend/appflowy_flutter/pubspec.lock

Assessment against linked issues

Issue Objective Addressed Explanation
#2306 Add keyboard shortcuts to navigate back to the previous page/tab and forward to the next page/tab using Cmd/Ctrl + [ and Cmd/Ctrl + ].
#5396 Display the current UI zoom level as a percentage in the Workspace section of the settings page.
#5396 Keep the displayed zoom level synchronized with UI zoom changes and provide a way to reset the zoom to the default level.
#8947 Add an accessible horizontal scrollbar to the Kanban board so users can scroll through groups beyond the visible area.
#8948 Ensure that all peek windows opened from the Kanban board, along with other FlowyDialog overlays, can be dismissed reliably by pressing the ESC key.
#8973 Ensure that creating a page using the sidebar bottom "New Page" button uses and initializes the configured default template, consistently with the other page-creation entry points.

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@CLAassistant

CLAassistant commented Aug 31, 2026

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

@sourcery-ai sourcery-ai Bot 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.

Hey - I've found 1 issue

Prompt for AI Agents
Please address the comments from this code review:

## Individual Comments

### Comment 1
<location path="frontend/appflowy_flutter/lib/workspace/presentation/home/hotkeys.dart" line_range="143-147" />
<code_context>
     ),
+    HotKeyItem(
+      hotKey: HotKey(
+        Platform.isMacOS ? KeyCode.bracketLeft : KeyCode.arrowLeft,
+        modifiers: [Platform.isMacOS ? KeyModifier.meta : KeyModifier.alt],
+        scope: HotKeyScope.inapp,
+      ),
+      keyDownHandler: (_) => _selectTab(context, -1),
+    ),

</code_context>
<issue_to_address>
**issue (bug_risk):** The new Alt+Left/Alt+Right and Cmd+[/Cmd+] shortcuts call `_selectTab`, which selects the numerically adjacent tab instead of navigating backward or forward through tab/page history. After visiting tabs in a non-sequential order, these shortcuts therefore reach the wrong destination.

**Triggers:** When the user expects browser-style back/forward navigation after switching between non-adjacent tabs.

**Suggested fix:** Dispatch the tab-history back/forward events rather than changing `currentIndex` by ±1.
</issue_to_address>

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

Comment thread frontend/appflowy_flutter/lib/workspace/presentation/home/hotkeys.dart Outdated
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants