Skip to content

fix: improve layout of shortcut key bindings#8609

Open
aayush-p-singh wants to merge 1 commit intoAppFlowy-IO:mainfrom
aayush-p-singh:patch-1
Open

fix: improve layout of shortcut key bindings#8609
aayush-p-singh wants to merge 1 commit intoAppFlowy-IO:mainfrom
aayush-p-singh:patch-1

Conversation

@aayush-p-singh
Copy link
Copy Markdown

@aayush-p-singh aayush-p-singh commented Mar 28, 2026

  • Replaced Row with Wrap in key bindings layout
  • Added spacing between keys for better alignment
  • Fixes uneven spacing and empty layout issue

Closes #8222

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

Bug Fixes:

  • Fix uneven spacing and empty layout issues in the shortcut key bindings display.

- Replaced Row with Wrap in key bindings layout
- Added spacing between keys for better alignment
- Fixes uneven spacing and empty layout issue

Closes AppFlowy-IO#8222
@sourcery-ai
Copy link
Copy Markdown
Contributor

sourcery-ai bot commented Mar 28, 2026

Reviewer's guide (collapsed on small PRs)

Reviewer's Guide

Replaces the fixed Row-based layout for displaying shortcut key bindings with a flexible Wrap layout that adds spacing between keys and improves alignment, especially when keys wrap or space is constrained.

File-Level Changes

Change Details Files
Use a Wrap layout instead of Row for rendering shortcut key bindings, with explicit spacing and alignment for better visual layout.
  • Replace the Row widget used to render key bindings with a Wrap widget.
  • Configure horizontal spacing between key widgets via the spacing parameter.
  • Configure vertical spacing between lines of wrapped keys via the runSpacing parameter.
  • Right-align the wrapped key bindings using WrapAlignment.end.
frontend/appflowy_flutter/lib/workspace/presentation/settings/pages/settings_shortcuts_view.dart

Assessment against linked issues

Issue Objective Addressed Explanation
#8222 Make the reset shortcut button's hover effect consistent with other settings buttons (including text color change on hover). The PR only changes the layout widget for key bindings (Row → Wrap with spacing and end alignment). It does not modify any hover, style, or color behavior for the reset shortcut button or other buttons.
#8222 Improve the layout of each shortcut key tile so keys are aligned with space between them, avoiding large blank space at the end (similar to CSS justify-content: space-between).

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
Copy link
Copy Markdown

CLAassistant commented Mar 28, 2026

CLA assistant check
All committers have signed the CLA.

Copy link
Copy Markdown
Contributor

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

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

Hey - I've left some high level feedback:

  • Now that _renderKeybindings no longer uses isHovering, consider removing the parameter (and updating call sites) to keep the API minimal and avoid confusion.
  • Using WrapAlignment.end may cause unexpected layouts in RTL locales; consider deriving alignment from the current TextDirection or using a more neutral alignment if end-alignment is not strictly required.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- Now that `_renderKeybindings` no longer uses `isHovering`, consider removing the parameter (and updating call sites) to keep the API minimal and avoid confusion.
- Using `WrapAlignment.end` may cause unexpected layouts in RTL locales; consider deriving alignment from the current `TextDirection` or using a more neutral alignment if end-alignment is not strictly required.

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.

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.

[Bug] Settings btn not consistent with other btns, key tiles layout is weird

2 participants