chore: remove typography selection in app theming
/ok-to-test tags="@tag.All"
Summary by CodeRabbit
Summary by CodeRabbit
-
New Features
- Introduced new hooks for icon management:
useIconDensityanduseIconSizing.
- Introduced new hooks for icon management:
-
Improvements
- Refactored hooks to enhance performance by using
useMemoinstead of state management, leading to more efficient calculations for icon size, density, spacing, and typography. - Streamlined theme management by consolidating logic and removing unnecessary properties, improving clarity and maintainability.
- Optimized CSS class name management within the
useCssTokenshook for better performance.
- Refactored hooks to enhance performance by using
-
Bug Fixes
- Removed
fontFamilyproperty from various components, which may affect text rendering but simplifies font management.
- Removed
-
Documentation
- Updated comments and documentation to reflect changes in typography and theme handling.
[!TIP] 🟢 🟢 🟢 All cypress tests have passed! 🎉 🎉 🎉 Workflow run: https://github.com/appsmithorg/appsmith/actions/runs/10786030048 Commit: a0d12586c130252d4164305c5293c1b6fb67b5eb Cypress dashboard. Tags:
@tag.AllSpec:
Tue, 10 Sep 2024 06:00:30 UTC
Walkthrough
This update introduces several enhancements to the design system's theming hooks, focusing on optimizing performance by replacing state management with memoization. Key hooks like useIconDensity, useIconSizing, and others have been refactored for improved efficiency. Additionally, typography management has been simplified by removing the fontFamily property, resulting in a more streamlined theme configuration process.
Changes
| File Path | Change Summary |
|---|---|
app/client/packages/design-system/theming/src/hooks/src/index.ts |
Added exports for useIconDensity and useIconSizing. |
app/client/packages/design-system/theming/src/hooks/src/useIconDensity.tsx |
Refactored to use useMemo for calculating strokeWidth, improving performance and clarity. |
app/client/packages/design-system/theming/src/hooks/src/useIconSizing.tsx |
Refactored to use useMemo for calculating iconSize, enhancing performance and simplifying logic. |
app/client/packages/design-system/theming/src/hooks/src/useSizing.tsx |
Optimized getSizing function with useMemo and defined return type as TokenObj. |
app/client/packages/design-system/theming/src/hooks/src/useSpacing.tsx |
Refactored state management for outerSpacing and innerSpacing to use useMemo, improving performance. |
app/client/packages/design-system/theming/src/hooks/src/useTheme.tsx |
Consolidated theme updates in a single useMemo hook, removed fontFamily from UseThemeProps, and optimized theme logic. |
app/client/packages/design-system/theming/src/hooks/src/useTypography.tsx |
Refactored typography management to use useMemo, removing the fontFamily parameter for simplification. |
app/client/src/pages/AppViewer/index.tsx |
Enhanced type safety in theme properties, integrating ColorMode and IconStyle, and simplifying theme logic. |
app/client/packages/design-system/theming/src/hooks/src/useCssTokens.tsx |
Optimized management of CSS class names by replacing state management with useMemo, simplifying the fontFamilyCss function. |
app/client/cypress/e2e/Regression/ClientSide/Anvil/AppTheming/AnvilAppThemingSnapshot_spec.ts |
Reorganized test cases for app theming, removing the "Typography" test and renumbering subsequent tests. |
Assessment against linked issues
| Objective | Addressed | Explanation |
|---|---|---|
| Improve typography handling (#[21632]) | ✅ | |
| Set default font to system default (#[21632]) | ✅ | |
| Simplify theme customization options (#[21632]) | ✅ |
-
#36166: The changes in this PR involve modifications to the
useCssTokenshook, which optimizes CSS class name management, similar to the refactoring of hooks in the main PR that enhances performance and clarity in icon management throughuseIconDensityanduseIconSizing.
🌟 In the realm of code, changes do unfold,
Performance shines bright, as new tales are told.
With hooks refined, and typography clear,
A streamlined design, we all hold dear!
🎨✨
[!TIP]
Announcements
- The review status is no longer posted as a separate comment when there are no actionable or nitpick comments. In such cases, the review status is included in the walkthrough comment.
- We have updated our review workflow to use the Anthropic's Claude family of models. Please share any feedback in the discussion post on our Discord.
- Possibly related PRs: Walkthrough comment now includes a list of potentially related PRs to help you recall past context. Please share any feedback in the discussion post on our Discord.
- Suggested labels: CodeRabbit can now suggest labels by learning from your past PRs in the walkthrough comment. You can also provide custom labeling instructions in the UI or configuration file.
- Possibly related PRs, automatic label suggestions based on past PRs, learnings, and possibly related issues require data opt-in (enabled by default).
Recent review details
Configuration used: .coderabbit.yaml Review profile: CHILL
Commits
Files that changed from the base of the PR and between 80b57fd1caf1e0da5c95038e0333e8947ebb0cf0 and a0d12586c130252d4164305c5293c1b6fb67b5eb.
Files selected for processing (1)
- app/client/cypress/e2e/Regression/ClientSide/Anvil/AppTheming/AnvilAppThemingSnapshot_spec.ts (4 hunks)
Files skipped from review due to trivial changes (1)
- app/client/cypress/e2e/Regression/ClientSide/Anvil/AppTheming/AnvilAppThemingSnapshot_spec.ts
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?
Tips
Chat
There are 3 ways to chat with CodeRabbit:
- Review comments: Directly reply to a review comment made by CodeRabbit. Example:
-
I pushed a fix in commit <commit_id>. -
Generate unit testing code for this file. -
Open a follow-up GitHub issue for this discussion.
-
- Files and specific lines of code (under the "Files changed" tab): Tag
@coderabbitaiin a new review comment at the desired location with your query. Examples:-
@coderabbitai generate unit testing code for this file. -
@coderabbitai modularize this function.
-
- PR comments: Tag
@coderabbitaiin a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:-
@coderabbitai generate interesting stats about this repository and render them as a table. -
@coderabbitai show all the console.log statements in this repository. -
@coderabbitai read src/utils.ts and generate unit testing code. -
@coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format. -
@coderabbitai help me debug CodeRabbit configuration file.
-
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.
CodeRabbit Commands (Invoked using PR comments)
-
@coderabbitai pauseto pause the reviews on a PR. -
@coderabbitai resumeto resume the paused reviews. -
@coderabbitai reviewto trigger an incremental review. This is useful when automatic reviews are disabled for the repository. -
@coderabbitai full reviewto do a full review from scratch and review all the files again. -
@coderabbitai summaryto regenerate the summary of the PR. -
@coderabbitai resolveresolve all the CodeRabbit review comments. -
@coderabbitai configurationto show the current CodeRabbit configuration for the repository. -
@coderabbitai helpto get help.
Other keywords and placeholders
- Add
@coderabbitai ignoreanywhere in the PR description to prevent this PR from being reviewed. - Add
@coderabbitai summaryto generate the high-level summary at a specific location in the PR description. - Add
@coderabbitaianywhere in the PR title to generate the title automatically.
Documentation and Community
- Visit our Documentation for detailed information on how to use CodeRabbit.
- Join our Discord Community to get help, request features, and share feedback.
- Follow us on X/Twitter for updates and announcements.
/build-deploy-preview skip-tests=true
Deploying Your Preview: https://github.com/appsmithorg/appsmith/actions/runs/10697206787.
Workflow: On demand build Docker image and deploy preview.
skip-tests: true.
env: ``.
PR: 36110.
recreate: .
Deploy-Preview-URL: https://ce-36110.dp.appsmith.com
/build-deploy-preview skip-tests=true
Deploying Your Preview: https://github.com/appsmithorg/appsmith/actions/runs/10734651305.
Workflow: On demand build Docker image and deploy preview.
skip-tests: true.
env: ``.
PR: 36110.
recreate: .
Deploy-Preview-URL: https://ce-36110.dp.appsmith.com
@ichik can you try the DP once? For some reason, there are diffs in few components in storybook. Can you check if they are ok to go in ?
@jsartisan everything seems to be fine, minor changes in Chromatic are a mystery, I don't see them when inspecting Storybook snapshots, there appears to be a minor vertical positioning difference, though, perhaps some rounding did change somewhere. Behavior and looks in the editor seem all fine.