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

feat: mkt digest section + misc tweaks #37

Merged
merged 2 commits into from
Dec 8, 2024
Merged

Conversation

waltergalvao
Copy link
Member

@waltergalvao waltergalvao commented Dec 8, 2024

Summary by CodeRabbit

Release Notes

  • New Features

    • Introduced the FeaturesSlack component, providing a tabbed interface for Slack-related digests.
  • Improvements

    • Updated text in the FeaturesAutomations component to better target developers.
    • Revised wording in the FeaturesOverview component for inclusivity.
    • Enhanced the FeaturesTraits component with new images and updated feature descriptions for clarity.

These changes aim to improve user experience and communication within the application.

@sweetr-dev sweetr-dev bot added the medium Medium PR - Strive for smaller PRs to reduce risk and review time label Dec 8, 2024
Copy link

coderabbitai bot commented Dec 8, 2024

Caution

Review failed

The pull request is closed.

Walkthrough

This pull request introduces several changes across multiple components in the application. A new component, FeaturesSlack, is added to the Home page, enhancing its functionality. The FeaturesAutomations and FeaturesOverview components undergo text modifications to refine their messaging. Additionally, the FeaturesTraits component sees updates in image assets, icon usage, and textual content to improve clarity and focus on integrations and coaching experiences.

Changes

File Path Change Summary
apps/mkt/app/(default)/page.tsx Added import for FeaturesSlack and included it in the JSX of the Home function.
apps/mkt/components/features-automations.tsx Updated heading text from "Automate the pain away" to "Automations for developers."
apps/mkt/components/features-overview.tsx Changed text from "For managers & team leads" to "For managers & their teams."
apps/mkt/components/features-slack.tsx Introduced new component FeaturesSlack with a tabbed interface for Slack digests.
apps/mkt/components/features-traits.tsx Replaced CommunityImage with GitRepo, removed IconHeadphones, added IconPlugConnected, and updated text and styles.

Possibly related PRs

  • feat: digests page #26: The changes in the IntegrationsPage component involve modifications related to the Slack integration, which is directly relevant to the new FeaturesSlack component introduced in the main PR.
  • feat: automation integration drawers #27: The AutomationPrSizeLabelerSettings component changes may relate to the overall integration of features, including Slack, as it involves settings that could be relevant to the functionality of the FeaturesSlack component.
  • feat: featurebase #34: The updates in the README.md and other documentation files regarding community engagement and feedback may indirectly relate to the FeaturesSlack component, as it could be part of the broader feature set that encourages user interaction and feedback.

Suggested labels

huge

Suggested reviewers

  • sweetrdev

📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Reviewing files that changed from the base of the PR and between 8783cad and a4e0e85.

⛔ Files ignored due to path filters (3)
  • apps/mkt/public/images/digest-metrics.png is excluded by !**/*.png
  • apps/mkt/public/images/digest-wip.png is excluded by !**/*.png
  • apps/mkt/public/images/logos/slack.svg is excluded by !**/*.svg
📒 Files selected for processing (1)
  • apps/mkt/components/features-slack.tsx (1 hunks)

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?

❤️ 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.
    • 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 @coderabbitai in 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 @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 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 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 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.

sweetrdev
sweetrdev previously approved these changes Dec 8, 2024
@waltergalvao waltergalvao changed the title feat: digest section + misc tweaks feat(mkt): digest section + misc tweaks Dec 8, 2024
@waltergalvao waltergalvao changed the title feat(mkt): digest section + misc tweaks feat: mkt digest section + misc tweaks Dec 8, 2024
Copy link

@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: 1

🧹 Outside diff range and nitpick comments (5)
apps/mkt/components/features-slack.tsx (4)

6-7: Remove unused imports

The following imports are not used in the component:

  • FeatureIllustration
  • FeatureImage01
-import FeatureIllustration from "@/public/images/home.png";
-import FeatureImage01 from "@/public/images/home.png";

22-24: Optimize heightFix function with useCallback

The heightFix function should be memoized since it's used in both useEffect and event handlers.

+  const heightFix = useCallback(() => {
+    if (tabs.current?.parentElement) {
+      tabs.current.parentElement.style.height = `${tabs.current.clientHeight}px`;
+    }
+  }, []);

   useEffect(() => {
     heightFix();
   }, [heightFix]);

41-84: Reduce code duplication in tab buttons

Consider extracting the tab button into a reusable component to improve maintainability and reduce duplication.

+ type TabButtonProps = {
+   isActive: boolean;
+   onClick: () => void;
+   title: string;
+   description: string;
+   icon: React.ReactNode;
+ };
+
+ const TabButton: React.FC<TabButtonProps> = ({ isActive, onClick, title, description, icon }) => (
+   <button
+     className={`hover:scale-105 transition-all duration-500 text-left px-4 py-5 border border-dark-400 rounded ${
+       !isActive ? "bg-dark-800 opacity-60 hover:opacity-100 transition" : "bg-dark-900 shadow-sm"
+     }`}
+     onClick={onClick}
+   >
+     <div className="flex items-center justify-between mb-1">
+       <div className="text-xl font-inter-tight font-semibold text-zinc-200">
+         {title}
+       </div>
+       <div className={isActive ? "text-green-400" : "text-white"}>
+         {icon}
+       </div>
+     </div>
+     <div className="text-sm text-zinc-400">{description}</div>
+   </button>
+ );

// Usage:
<div className="grid grid-cols-2 md:grid-cols-2 gap-4 md:gap-6">
  <TabButton
    isActive={tab === 1}
    onClick={(e) => {
      e.preventDefault();
      setTab(1);
    }}
    title="Metrics Digest"
    description="Summary of Pull Request metrics for teams to identify bottlenecks and understand changes impact."
    icon={<IconChartBar stroke={1} />}
  />
  <TabButton
    isActive={tab === 2}
    onClick={(e) => {
      e.preventDefault();
      setTab(2);
    }}
    title="Work In Progress Digest"
    description="Summary of Pull Requests that are in progress to keep teams in sync."
    icon={<IconProgress stroke={1.5} />}
  />
</div>

90-136: Optimize tab content implementation

Two suggestions to improve the tab content implementation:

  1. Extract the transition wrapper to reduce code duplication
  2. Enhance image responsiveness with proper sizing strategy
+ const TabContent: React.FC<{
+   show: boolean;
+   children: React.ReactNode;
+   onEnter: () => void;
+ }> = ({ show, children, onEnter }) => (
+   <Transition
+     show={show}
+     className="w-full text-center"
+     enter="transition ease-in-out duration-700 transform order-first"
+     enterFrom="opacity-0 -translate-y-4"
+     enterTo="opacity-100 translate-y-0"
+     leave="transition ease-in-out duration-300 transform absolute"
+     leaveFrom="opacity-100 translate-y-0"
+     leaveTo="opacity-0 translate-y-4"
+     beforeEnter={onEnter}
+     unmount={false}
+   >
+     {children}
+   </Transition>
+ );

// Usage:
<div className="relative flex flex-col pt-12 mx-6" ref={tabs}>
  <TabContent show={tab === 1} onEnter={heightFix}>
    <div className="inline-flex relative align-top">
      <Image
        className="rounded-lg box-content w-full h-auto"
        src={DigestMetrics}
        quality={100}
        sizes="(max-width: 860px) 100vw, 860px"
        priority
        alt="Metrics Digest"
      />
    </div>
  </TabContent>
  {/* Similar for tab 2 */}
</div>
apps/mkt/components/features-traits.tsx (1)

182-182: Consider optimizing the z-index value

The z-index value of 10000 seems unnecessarily high. Consider using a lower value that still achieves the desired stacking context. This helps maintain a more manageable z-index hierarchy.

-                      className="h-[250px] mt-[27px] lg:h-[280px] lg:max-h-[280px] border border-dark-400 w-auto object-cover mx-auto object-left sm:object-contain sm:h-auto rounded-t-lg opacity-90 shadow-[0_0_20px_3px_rgba(255,255,255,0.25)] block z-[10000]"
+                      className="h-[250px] mt-[27px] lg:h-[280px] lg:max-h-[280px] border border-dark-400 w-auto object-cover mx-auto object-left sm:object-contain sm:h-auto rounded-t-lg opacity-90 shadow-[0_0_20px_3px_rgba(255,255,255,0.25)] block z-[1]"
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Reviewing files that changed from the base of the PR and between cc584b3 and 8783cad.

⛔ Files ignored due to path filters (3)
  • apps/mkt/public/images/digest-metrics.png is excluded by !**/*.png
  • apps/mkt/public/images/digest-wip.png is excluded by !**/*.png
  • apps/mkt/public/images/git-repo.jpg is excluded by !**/*.jpg
📒 Files selected for processing (5)
  • apps/mkt/app/(default)/page.tsx (1 hunks)
  • apps/mkt/components/features-automations.tsx (1 hunks)
  • apps/mkt/components/features-overview.tsx (1 hunks)
  • apps/mkt/components/features-slack.tsx (1 hunks)
  • apps/mkt/components/features-traits.tsx (3 hunks)
✅ Files skipped from review due to trivial changes (1)
  • apps/mkt/components/features-automations.tsx
🧰 Additional context used
🪛 Biome (1.9.4)
apps/mkt/components/features-slack.tsx

[error] 18-18: Change to an optional chain.

Unsafe fix: Change to an optional chain.

(lint/complexity/useOptionalChain)

🔇 Additional comments (4)
apps/mkt/app/(default)/page.tsx (1)

8-8: LGTM: Clean integration of FeaturesSlack component

The FeaturesSlack component is properly imported and integrated into the Home page layout, maintaining consistency with the existing pattern.

Also applies to: 16-16

apps/mkt/components/features-overview.tsx (1)

149-149: LGTM: Text update improves inclusivity

The text change from "For managers & team leads" to "For managers & their teams" makes the messaging more inclusive.

apps/mkt/components/features-traits.tsx (2)

5-5: LGTM: Import changes are consistent

The new imports for GitRepo and IconPlugConnected are properly organized and follow the established pattern.

Also applies to: 14-14


267-275: LGTM: Feature updates are well-structured

The changes to "More Integrations" and "1:1s" features are clear, concise, and maintain consistency with the existing structure. The icon choices appropriately represent their respective features.

Comment on lines +17 to +20
const heightFix = () => {
if (tabs.current && tabs.current.parentElement)
tabs.current.parentElement.style.height = `${tabs.current.clientHeight}px`;
};
Copy link

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion

Use optional chaining for safer property access

The current implementation could be safer using optional chaining.

-    if (tabs.current && tabs.current.parentElement)
-      tabs.current.parentElement.style.height = `${tabs.current.clientHeight}px`;
+    if (tabs.current?.parentElement) {
+      tabs.current.parentElement.style.height = `${tabs.current.clientHeight}px`;
+    }

Committable suggestion skipped: line range outside the PR's diff.

🧰 Tools
🪛 Biome (1.9.4)

[error] 18-18: Change to an optional chain.

Unsafe fix: Change to an optional chain.

(lint/complexity/useOptionalChain)

@waltergalvao waltergalvao merged commit f3efee1 into main Dec 8, 2024
4 of 5 checks passed
@coderabbitai coderabbitai bot mentioned this pull request Dec 8, 2024
@coderabbitai coderabbitai bot mentioned this pull request Jan 30, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
medium Medium PR - Strive for smaller PRs to reduce risk and review time
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants