Skip to content

[WIKI-563] refactor: subscription styles #7444

Merged
sriramveeraghanta merged 2 commits intopreviewfrom
refactor-subscription_styles
Jul 24, 2025
Merged

[WIKI-563] refactor: subscription styles #7444
sriramveeraghanta merged 2 commits intopreviewfrom
refactor-subscription_styles

Conversation

@iam-vipin
Copy link
Copy Markdown
Member

@iam-vipin iam-vipin commented Jul 18, 2025

Description

This PR put all the subscription related styles in a UI package so that it can be used in editor and spaces without code duplication.

Type of Change

  • Code refactoring

Screenshots and Media (if applicable)

Test Scenarios

References

Summary by CodeRabbit

  • Refactor
    • Updated import paths for several billing and license components to use shared UI package utilities, improving consistency and maintainability.
    • Consolidated redundant imports and streamlined access to shared styling functions.
    • Extended the UI package's public API to include billing utilities.
    • Removed an obsolete comment from the UI package.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Jul 18, 2025

Walkthrough

The changes update import paths for several billing-related utility functions across multiple components, shifting them from local paths to the shared @plane/ui package. Additionally, the UI package's public API is expanded by re-exporting billing utilities. An explanatory comment in the subscription module is removed.

Changes

File(s) Change Summary
apps/web/ce/components/workspace/billing/comparison/frequency-toggle.tsx Updated imports for utility functions to use @plane/ui instead of local paths.
apps/web/ce/components/workspace/billing/comparison/plan-detail.tsx Consolidated and redirected utility imports to @plane/ui.
apps/web/ce/components/workspace/billing/root.tsx Changed import of getSubscriptionTextColor to @plane/ui.
apps/web/core/components/license/modal/card/base-paid-plan-card.tsx Updated utility imports to use @plane/ui.
apps/web/core/components/license/modal/card/checkout-button.tsx Consolidated utility imports to @plane/ui.
apps/web/core/components/license/modal/card/plan-upgrade.tsx Changed import of getDiscountPillStyle to @plane/ui.
apps/web/core/components/license/modal/card/talk-to-sales.tsx Updated utility imports to use @plane/ui.
apps/web/core/components/workspace/billing/comparison/feature-detail.tsx Changed import of getSubscriptionTextColor to @plane/ui.
packages/ui/src/billing/index.ts Added export of all from ./subscription.
packages/ui/src/billing/subscription.ts Removed explanatory comment about Tailwind CSS constraints.
packages/ui/src/index.ts Added export of all from ./billing.

Sequence Diagram(s)

sequenceDiagram
    participant Component as Billing Component
    participant UI as @plane/ui
    Component->>UI: Import utility function (e.g., getSubscriptionBackgroundColor)
    UI-->>Component: Provide utility function
Loading

Estimated code review effort

1 (<30 minutes)

Suggested reviewers

  • sriramveeraghanta

Poem

In the warren of code, imports hop anew,
From local to shared, the path is now true.
Utility bunnies, all in one place—
No more confusion, just a unified space!
With a twitch of the nose and a flick of the ear,
The billing code’s tidier—let’s all give a cheer!
🐇✨


📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 42ac15e and cf6386d.

📒 Files selected for processing (1)
  • apps/web/core/components/license/modal/card/plan-upgrade.tsx (1 hunks)
✅ Files skipped from review due to trivial changes (1)
  • apps/web/core/components/license/modal/card/plan-upgrade.tsx
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: Analyze (javascript)
✨ Finishing Touches
  • 📝 Generate Docstrings

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
🪧 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>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in 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 gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @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.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

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 pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

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.

@makeplane
Copy link
Copy Markdown

makeplane bot commented Jul 18, 2025

Pull Request Linked with Plane Work Items

Comment Automatically Generated by Plane

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🧹 Nitpick comments (1)
packages/ui/src/index.ts (1)

38-38: Barrel export added – keep an eye on bundle size

Wildcard-exporting ./billing is fine, but may pull more code than necessary if the bundler’s tree-shaking is imperfect. Consider named re-exports if size ever becomes an issue.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between df4ea1f and 42ac15e.

📒 Files selected for processing (11)
  • apps/web/ce/components/workspace/billing/comparison/frequency-toggle.tsx (1 hunks)
  • apps/web/ce/components/workspace/billing/comparison/plan-detail.tsx (1 hunks)
  • apps/web/ce/components/workspace/billing/root.tsx (1 hunks)
  • apps/web/core/components/license/modal/card/base-paid-plan-card.tsx (1 hunks)
  • apps/web/core/components/license/modal/card/checkout-button.tsx (1 hunks)
  • apps/web/core/components/license/modal/card/plan-upgrade.tsx (2 hunks)
  • apps/web/core/components/license/modal/card/talk-to-sales.tsx (1 hunks)
  • apps/web/core/components/workspace/billing/comparison/feature-detail.tsx (1 hunks)
  • packages/ui/src/billing/index.ts (1 hunks)
  • packages/ui/src/billing/subscription.ts (0 hunks)
  • packages/ui/src/index.ts (1 hunks)
💤 Files with no reviewable changes (1)
  • packages/ui/src/billing/subscription.ts
🧰 Additional context used
🧠 Learnings (5)
📓 Common learnings
Learnt from: mathalav55
PR: makeplane/plane#6107
File: web/ce/components/workspace-notifications/sidebar/notification-card/options/read.tsx:11-12
Timestamp: 2024-11-28T07:02:15.514Z
Learning: Some components are still in core and have not been moved yet, so their import paths remain the same.
Learnt from: mathalav55
PR: makeplane/plane#6107
File: web/ce/components/workspace-notifications/sidebar/notification-card/options/archive.tsx:11-14
Timestamp: 2024-11-28T07:02:54.664Z
Learning: When components are still located in `core`, it's appropriate for files to import them using `@/components/...`, and the migration to the new import paths is not necessary in such cases.
Learnt from: vamsikrishnamathala
PR: makeplane/plane#7061
File: web/core/components/workspace-notifications/root.tsx:18-18
Timestamp: 2025-05-14T13:16:23.323Z
Learning: In the Plane project codebase, the path alias `@/plane-web` resolves to the `ce` directory, making imports like `@/plane-web/hooks/use-notification-preview` correctly resolve to files in `web/ce/hooks/`.
apps/web/ce/components/workspace/billing/root.tsx (1)
Learnt from: lifeiscontent
PR: makeplane/plane#7164
File: packages/ui/.storybook/main.ts:24-47
Timestamp: 2025-06-04T16:22:44.344Z
Learning: In packages/ui/.storybook/main.ts, the webpackFinal function intentionally overrides the CSS loader strategy by finding and replacing existing CSS rules. This is a temporary workaround for a known upstream issue in Storybook's CSS handling that has been communicated to the Storybook maintainers. The current implementation should not be changed until the upstream issue is resolved.
apps/web/core/components/license/modal/card/checkout-button.tsx (2)
Learnt from: lifeiscontent
PR: makeplane/plane#7164
File: packages/ui/.storybook/main.ts:24-47
Timestamp: 2025-06-04T16:22:44.344Z
Learning: In packages/ui/.storybook/main.ts, the webpackFinal function intentionally overrides the CSS loader strategy by finding and replacing existing CSS rules. This is a temporary workaround for a known upstream issue in Storybook's CSS handling that has been communicated to the Storybook maintainers. The current implementation should not be changed until the upstream issue is resolved.
Learnt from: mathalav55
PR: makeplane/plane#6107
File: web/ce/components/workspace-notifications/sidebar/notification-card/options/archive.tsx:11-14
Timestamp: 2024-11-28T07:02:54.664Z
Learning: When components are still located in `core`, it's appropriate for files to import them using `@/components/...`, and the migration to the new import paths is not necessary in such cases.
apps/web/core/components/license/modal/card/talk-to-sales.tsx (1)
Learnt from: lifeiscontent
PR: makeplane/plane#7164
File: packages/ui/.storybook/main.ts:24-47
Timestamp: 2025-06-04T16:22:44.344Z
Learning: In packages/ui/.storybook/main.ts, the webpackFinal function intentionally overrides the CSS loader strategy by finding and replacing existing CSS rules. This is a temporary workaround for a known upstream issue in Storybook's CSS handling that has been communicated to the Storybook maintainers. The current implementation should not be changed until the upstream issue is resolved.
apps/web/ce/components/workspace/billing/comparison/plan-detail.tsx (1)
Learnt from: lifeiscontent
PR: makeplane/plane#7164
File: packages/ui/.storybook/main.ts:24-47
Timestamp: 2025-06-04T16:22:44.344Z
Learning: In packages/ui/.storybook/main.ts, the webpackFinal function intentionally overrides the CSS loader strategy by finding and replacing existing CSS rules. This is a temporary workaround for a known upstream issue in Storybook's CSS handling that has been communicated to the Storybook maintainers. The current implementation should not be changed until the upstream issue is resolved.
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: Analyze (javascript)
🔇 Additional comments (9)
apps/web/core/components/workspace/billing/comparison/feature-detail.tsx (1)

5-5: Import consolidation looks good

Switching to the central @plane/ui barrel keeps the component decoupled from internal folder structure and avoids duplication.

apps/web/ce/components/workspace/billing/root.tsx (1)

7-7: 👍 Consistent use of the new UI barrel

Import path updated correctly; getSubscriptionTextColor is still used (line 52) so no dead code concerns.

apps/web/core/components/license/modal/card/talk-to-sales.tsx (1)

8-8: No stale getButtonStyling imports remain

A search across the codebase found zero imports of getButtonStyling from @plane/utils; all usages now correctly import from @plane/ui.

apps/web/core/components/license/modal/card/base-paid-plan-card.tsx (1)

10-10: Good move to shared UI package

Centralising these helpers under @plane/ui reduces cross-layer coupling and keeps plan-related styling in one place.

packages/ui/src/billing/index.ts (1)

1-1: LGTM! Clean barrel export for billing utilities.

This export statement correctly enables the centralization of billing utilities by making subscription-related functions available through the @plane/ui package, supporting the refactoring objectives.

apps/web/core/components/license/modal/card/checkout-button.tsx (1)

6-6: LGTM! Clean import consolidation.

The import of getUpgradeButtonStyle has been successfully consolidated from a local path to the shared @plane/ui package, aligning with the refactoring objectives. The function usage remains unchanged.

apps/web/core/components/license/modal/card/plan-upgrade.tsx (1)

8-8: LGTM! Clean import consolidation.

The import of getDiscountPillStyle has been successfully moved from a local path to the shared @plane/ui package, following the refactoring pattern.

apps/web/ce/components/workspace/billing/comparison/plan-detail.tsx (1)

13-13: LGTM! Clean import consolidation.

The import of getUpgradeButtonStyle has been successfully consolidated from a local path to the shared @plane/ui package, following the refactoring pattern. The function usage remains unchanged.

apps/web/ce/components/workspace/billing/comparison/frequency-toggle.tsx (1)

5-5: LGTM! Clean import consolidation.

The imports of getSubscriptionBackgroundColor and getDiscountPillStyle have been successfully moved from a local path to the shared @plane/ui package, following the refactoring pattern. Both functions are used correctly in the component.

@sriramveeraghanta sriramveeraghanta merged commit d7e58a6 into preview Jul 24, 2025
5 of 6 checks passed
@sriramveeraghanta sriramveeraghanta deleted the refactor-subscription_styles branch July 24, 2025 08:41
lifeiscontent pushed a commit that referenced this pull request Aug 18, 2025
* refactor: billing UI

* refactor : fix typo
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🗃️ packaging ready to merge 🌐web Issues related to our web product

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants