Skip to content

chore: implement new color tokens #7818

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

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

richardshiue
Copy link
Collaborator

@richardshiue richardshiue commented Apr 23, 2025

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

Implement new color tokens and refactor color schemes across the AppFlowy UI theme system

Enhancements:

  • Renamed and restructured color tokens to provide more semantic meaning
  • Updated color schemes to use more descriptive and consistent color naming
  • Added a new badge color scheme with extensive color variations

Chores:

  • Removed deprecated color tokens
  • Updated multiple UI components to use new color tokens
  • Simplified color scheme definitions

Copy link
Contributor

sourcery-ai bot commented Apr 23, 2025

Reviewer's Guide by Sourcery

This pull request implements new color tokens for the AppFlowy UI library. It updates the semantic color tokens for both light and dark themes, focusing on improving color usage and consistency across the UI. The changes include adjustments to text, border, fill, surface and icon colors, as well as the introduction of a badge color scheme. Additionally, it updates components such as buttons, text fields, and other UI elements to utilize the new color tokens.

No diagrams generated as the changes look simple and do not need a visual representation.

File-Level Changes

Change Details Files
Updated semantic color tokens for light and dark themes to improve consistency and accessibility.
  • Replaced theme and themeHover text colors with action and actionHover respectively.
  • Replaced purple and purpleHover text colors with featured and featuredHover respectively.
  • Adjusted hover colors for action, info, success, warning, error, and featured text colors in the light theme.
  • Adjusted hover colors for action, info, success, warning, error, and featured text colors in the dark theme.
  • Updated border colors for primary, secondary and tertiary states in both light and dark themes.
  • Updated fill colors for primary, secondary, tertiary and quaternary states in both light and dark themes.
  • Updated surface colors for primary and secondary states in both light and dark themes.
  • Updated icon colors for info, success, warning, error and featured states in both light and dark themes.
  • Removed the inverse text color.
  • Removed various alpha-based colors from the fill color scheme.
  • Updated button styles to use the new color scheme.
  • Updated textfield styles to use the new color scheme.
  • Updated settings menu element styles to use the new color scheme.
  • Updated AI prompt modal styles to use the new color scheme.
  • Updated link preview styles to use the new color scheme.
  • Updated sign in screen styles to use the new color scheme.
  • Added badge color scheme.
frontend/appflowy_flutter/packages/appflowy_ui/lib/src/theme/data/appflowy_default/semantic.dart
frontend/appflowy_flutter/packages/appflowy_ui/lib/src/theme/definition/color_scheme/fill_color_scheme.dart
frontend/appflowy_flutter/packages/appflowy_ui/lib/src/theme/definition/color_scheme/border_color_scheme.dart
frontend/appflowy_flutter/packages/appflowy_ui/lib/src/theme/definition/color_scheme/icon_color_scheme.dart
frontend/appflowy_flutter/packages/appflowy_ui/lib/src/component/button/outlined_button/outlined_button.dart
frontend/appflowy_flutter/packages/appflowy_ui/lib/src/component/button/outlined_button/outlined_text_button.dart
frontend/appflowy_flutter/packages/appflowy_ui/lib/src/component/button/outlined_button/outlined_icon_text_button.dart
frontend/appflowy_flutter/lib/src/theme/definition/color_scheme/text_color_scheme.dart
frontend/appflowy_flutter/packages/appflowy_ui/lib/src/theme/data/appflowy_default/primitive.dart
frontend/appflowy_flutter/packages/appflowy_ui/lib/src/component/button/filled_button/filled_icon_text_button.dart
frontend/appflowy_flutter/lib/ai/widgets/ai_prompt_modal/ai_prompt_category_list.dart
frontend/appflowy_flutter/lib/user/presentation/screens/sign_in_screen/widgets/continue_with/continue_with_password_page.dart
frontend/appflowy_flutter/lib/user/presentation/screens/sign_in_screen/widgets/third_party_sign_in_button/third_party_sign_in_buttons.dart
frontend/appflowy_flutter/packages/appflowy_ui/lib/src/component/button/ghost_button/ghost_button.dart
frontend/appflowy_flutter/packages/appflowy_ui/script/generate_theme.dart
frontend/appflowy_flutter/lib/workspace/presentation/settings/widgets/settings_menu_element.dart
frontend/appflowy_flutter/packages/appflowy_ui/example/lib/src/modal/modal_page.dart
frontend/appflowy_flutter/packages/appflowy_ui/lib/src/component/button/base_button/base_button.dart
frontend/appflowy_flutter/packages/appflowy_ui/lib/src/component/button/filled_button/filled_button.dart
frontend/appflowy_flutter/packages/appflowy_ui/lib/src/component/button/filled_button/filled_text_button.dart
frontend/appflowy_flutter/packages/appflowy_ui/lib/src/component/button/ghost_button/ghost_text_button.dart
frontend/appflowy_flutter/packages/appflowy_ui/lib/src/theme/definition/color_scheme/surface_color_scheme.dart
frontend/appflowy_flutter/packages/appflowy_ui/lib/src/theme/definition/theme_data.dart
frontend/appflowy_flutter/lib/ai/widgets/ai_prompt_modal/ai_prompt_visible_list.dart
frontend/appflowy_flutter/lib/ai/widgets/prompt_input/prompt_input_text_controller.dart
frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/link_preview/custom_link_preview.dart
frontend/appflowy_flutter/lib/user/presentation/screens/sign_in_screen/desktop_sign_in_screen.dart
frontend/appflowy_flutter/lib/user/presentation/screens/sign_in_screen/widgets/continue_with/continue_with_magic_link_or_passcode_page.dart
frontend/appflowy_flutter/packages/appflowy_ui/lib/src/component/button/ghost_button/ghost_icon_text_button.dart
frontend/appflowy_flutter/packages/appflowy_ui/lib/src/component/textfield/textfield.dart
frontend/appflowy_flutter/lib/ai/widgets/ai_prompt_modal/ai_prompt_preview.dart
frontend/appflowy_flutter/lib/mobile/presentation/bottom_sheet/bottom_sheet_edit_link_widget.dart
frontend/appflowy_flutter/lib/mobile/presentation/search/mobile_search_textfield.dart
frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/link_embed/link_embed_block_component.dart
frontend/appflowy_flutter/packages/appflowy_ui/lib/src/component/separator/divider.dart
frontend/appflowy_flutter/packages/appflowy_ui/lib/src/theme/definition/color_scheme/color_scheme.dart
frontend/appflowy_flutter/packages/appflowy_ui/lib/src/theme/definition/color_scheme/badge_color_scheme.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

@richardshiue richardshiue marked this pull request as draft April 23, 2025 15:39
Copy link
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 @richardshiue - I've reviewed your changes - here's some feedback:

Overall Comments:

  • Consider removing the now-unused color properties from the color scheme definitions.
  • It looks like you've renamed purple to featured - make sure this change makes sense in all contexts where the color is used.
  • Be sure to check that the changes to the button styles still look correct.
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.

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.

1 participant