Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: icon and emoji don't align in the mention page menu. #7673

Merged
merged 1 commit into from
Apr 9, 2025

Conversation

LucasXu0
Copy link
Collaborator

@LucasXu0 LucasXu0 commented Apr 2, 2025

Feature Preview

Screenshot 2025-04-02 at 11 06 37

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

Fix icon and emoji alignment in various menu components by standardizing icon sizing and introducing a more flexible iconBuilder method

Bug Fixes:

  • Corrected inconsistent icon and emoji sizing across different menu components to ensure visual alignment

Enhancements:

  • Introduced a more flexible iconBuilder method to replace the previous icon rendering approach
  • Standardized icon and emoji rendering with consistent sizing and line height

Sorry, something went wrong.

@LucasXu0 LucasXu0 added the v0.8.9 label Apr 2, 2025
@LucasXu0 LucasXu0 requested a review from asjqkkkk April 2, 2025 03:07
Copy link

sourcery-ai bot commented Apr 2, 2025

Reviewer's Guide by Sourcery

This pull request addresses an alignment issue with icons and emojis in the mention page menu. It introduces an iconBuilder to allow more flexible icon rendering, adjusts emoji sizes and line heights, and wraps the icon with a SizedBox to control its width.

Sequence diagram for rendering InlinePageReference icon

Loading
sequenceDiagram
  participant InlineActionsWidget
  participant InlineActionsMenuItem
  participant RawEmojiIconWidget

  InlineActionsWidget->>InlineActionsMenuItem: item.iconBuilder(isSelected)
  activate InlineActionsMenuItem
  InlineActionsMenuItem-->>InlineActionsWidget: Widget
  deactivate InlineActionsMenuItem
  InlineActionsWidget->>RawEmojiIconWidget: RawEmojiIconWidget(emoji, emojiSize, lineHeight)
  activate RawEmojiIconWidget
  RawEmojiIconWidget-->>InlineActionsWidget: Widget
  deactivate RawEmojiIconWidget

File-Level Changes

Change Details Files
Adjusted the icon and emoji alignment in the mention page menu.
  • Modified InlineActionsMenuItem to use iconBuilder instead of icon to allow more flexible icon rendering.
  • Wrapped the icon widget with a SizedBox to control its width.
  • Adjusted the emoji size and line height in RawEmojiIconWidget for better alignment.
  • Modified the RawEmojiIconWidget to use FlowyText.emoji instead of EmojiText.
  • Removed platform specific icon size adjustment.
frontend/appflowy_flutter/lib/plugins/inline_actions/handlers/inline_page_reference.dart
frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/header/emoji_icon_widget.dart
frontend/appflowy_flutter/lib/plugins/inline_actions/widgets/inline_actions_menu_group.dart
frontend/appflowy_flutter/lib/workspace/presentation/home/menu/view/view_item.dart
frontend/appflowy_flutter/lib/mobile/presentation/inline_actions/mobile_inline_actions_menu_group.dart
frontend/appflowy_flutter/lib/plugins/inline_actions/inline_actions_result.dart
frontend/appflowy_flutter/lib/plugins/inline_actions/handlers/child_page.dart

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!
  • Generate a plan of action for an issue: Comment @sourcery-ai plan on
    an issue to generate a plan of action for it.

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

Copy link

@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 @LucasXu0 - I've reviewed your changes - here's some feedback:

Overall Comments:

  • It looks like you're making a lot of changes to how icons are rendered - can you extract this into a separate widget or helper function?
  • Consider using a consistent naming scheme, like iconBuilder for all icon-related properties.
Here's what I looked at during the review
  • 🟢 General issues: all looks good
  • 🟢 Security: all looks good
  • 🟢 Testing: all looks good
  • 🟢 Complexity: all looks good
  • 🟢 Documentation: all looks good

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.

@LucasXu0 LucasXu0 force-pushed the recent_page_align branch from 202f3c2 to 1142b22 Compare April 2, 2025 03:09
@LucasXu0 LucasXu0 changed the title fix: icon and emoji doesn't align in mention page menu fix: icon and emoji don't align in the mention page menu. Apr 2, 2025
Copy link
Collaborator

@asjqkkkk asjqkkkk left a comment

Choose a reason for hiding this comment

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

LGTM

@LucasXu0 LucasXu0 merged commit 13028c6 into AppFlowy-IO:main Apr 9, 2025
18 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants