Skip to content

Added the new Help & Feedback popover to the account side menu #1482

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

Merged
merged 1 commit into from
Nov 19, 2024

Conversation

samejr
Copy link
Member

@samejr samejr commented Nov 19, 2024

  • Added the new Help & Feedback menu to the Accounts page
  • Moved the Help & Feedback component to a new file as it's accessed in 2 routes now
  • Tweaked the height of the Back to Account button so it aligns with the header

CleanShot 2024-11-19 at 09 06 53@2x

Summary by CodeRabbit

  • New Features
    • Introduced a new HelpAndFeedback component for improved access to support options.
    • Consolidated help and feedback resources into a single popover menu.
  • Bug Fixes
    • Removed outdated links and components for a cleaner navigation experience.
  • Refactor
    • Streamlined the SideMenu layout by integrating the HelpAndFeedback component.

@samejr samejr requested a review from matt-aitken November 19, 2024 09:07
Copy link

changeset-bot bot commented Nov 19, 2024

⚠️ No Changeset found

Latest commit: 171f6b2

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

Copy link
Contributor

coderabbitai bot commented Nov 19, 2024

Walkthrough

The changes involve modifications to the AccountSideMenu, HelpAndFeedbackPopover, and SideMenu components in the web application. The AccountSideMenu has removed the Feedback component and several SideMenuItem components related to Discord and documentation, replacing them with a new HelpAndFeedback component. The HelpAndFeedbackPopover component has been introduced to provide a structured interface for help and feedback options. Additionally, the SideMenu has been updated to include the HelpAndFeedbackPopover, consolidating help options and removing unnecessary complexity.

Changes

File Path Change Summary
apps/webapp/app/components/navigation/AccountSideMenu.tsx Removed DiscordIcon, Feedback component, and several SideMenuItem components; added HelpAndFeedback component; adjusted padding.
apps/webapp/app/components/navigation/HelpAndFeedbackPopover.tsx Introduced HelpAndFeedback component with UI for help and feedback options; includes subscription plan checks and links.
apps/webapp/app/components/navigation/SideMenu.tsx Removed HelpAndFeedback function and several imports; integrated HelpAndFeedbackPopover into the side menu.

Possibly related PRs

  • An improved 404 page design #1427: The changes in the main PR involve the introduction of the HelpAndFeedback component, which is related to user assistance features, while the retrieved PR focuses on enhancing the ErrorDisplay component.

Suggested reviewers

  • ericallam

🐰 "In the side menu, changes abound,
Help and feedback now can be found.
With popovers bright, and options galore,
We hop through the UI, seeking more!
A simpler path, with joy we create,
For every user, let’s celebrate!" 🐇

Warning

There were issues while running some tools. Please review the errors and either fix the tool’s configuration or disable the tool if it’s a critical failure.

🔧 eslint

If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.

apps/webapp/app/components/navigation/AccountSideMenu.tsx

(node:23583) ESLintIgnoreWarning: The ".eslintignore" file is no longer supported. Switch to using the "ignores" property in "eslint.config.js": https://eslint.org/docs/latest/use/configure/migration-guide#ignoring-files
(Use node --trace-warnings ... to show where the warning was created)

Oops! Something went wrong! :(

ESLint: 9.15.0

ESLint couldn't find an eslint.config.(js|mjs|cjs) file.

From ESLint v9.0.0, the default configuration file is now eslint.config.js.
If you are using a .eslintrc.* file, please follow the migration guide
to update your configuration file to the new format:

https://eslint.org/docs/latest/use/configure/migration-guide

If you still have problems after following the migration guide, please stop by
https://eslint.org/chat/help to chat with the team.


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.

Copy link
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: 1

🧹 Outside diff range and nitpick comments (3)
apps/webapp/app/components/navigation/HelpAndFeedbackPopover.tsx (2)

90-142: Consider moving email address to configuration

The support email address is hardcoded. Consider moving it to a configuration file to make it easier to update and maintain.

Example approach:

// config/support.ts
export const SUPPORT_EMAIL = "[email protected]";

// HelpAndFeedbackPopover.tsx
import { SUPPORT_EMAIL } from "~/config/support";
// ...
<ClipboardField
  variant="secondary/medium"
  value={SUPPORT_EMAIL}
  className="my-2"
/>

153-162: Consider a more scalable approach for booking calls

The calendar link goes directly to the founders' calendar. As the team grows, consider implementing a more scalable solution that can distribute calls among team members.

apps/webapp/app/components/navigation/SideMenu.tsx (1)

Line range hint 199-205: Consider enhancing accessibility for the help section

Since this is a critical user interaction point, consider adding appropriate ARIA attributes to improve accessibility:

-        <div className="flex flex-col gap-1 border-t border-grid-bright p-1">
+        <div 
+          className="flex flex-col gap-1 border-t border-grid-bright p-1"
+          role="complementary"
+          aria-label="Help and usage information"
+        >
           <HelpAndFeedback />
           {isV3Project && isFreeV3User && (
             <FreePlanUsage
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Reviewing files that changed from the base of the PR and between 1b3a2f2 and 171f6b2.

📒 Files selected for processing (3)
  • apps/webapp/app/components/navigation/AccountSideMenu.tsx (3 hunks)
  • apps/webapp/app/components/navigation/HelpAndFeedbackPopover.tsx (1 hunks)
  • apps/webapp/app/components/navigation/SideMenu.tsx (2 hunks)
🔇 Additional comments (9)
apps/webapp/app/components/navigation/AccountSideMenu.tsx (3)

7-11: LGTM! Clean import organization

The import changes properly reflect the component's new dependencies while removing unused ones.


22-22: Verify the header alignment with the new padding

The padding change from p-px to p-1 increases the padding from 1px to 4px. While this should help with button alignment, please verify that:

  1. The "Back to Account" button is vertically centered
  2. The total header height (including borders) aligns with other headers in the application

58-60: Verify accessibility of the Help & Feedback popover

The placement of the HelpAndFeedback component in the bordered footer section is good. However, please ensure:

  1. The popover is keyboard accessible
  2. It follows ARIA best practices for modals/popovers
  3. Focus management is properly handled when opening/closing the popover
✅ Verification successful

Accessibility implementation appears to be robust

The Help & Feedback component is built using Radix UI primitives (@radix-ui/react-popover and @radix-ui/react-dialog), which provide built-in accessibility features including:

  • Proper ARIA attributes and roles
  • Keyboard navigation support
  • Focus management
  • Screen reader compatibility

The component also implements keyboard shortcuts (h key) for quick access. Since Radix UI components are widely tested for accessibility compliance, this implementation follows accessibility best practices.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Search for ARIA attributes and keyboard handlers in the HelpAndFeedbackPopover
ast-grep --pattern 'aria-$_' HelpAndFeedbackPopover.tsx
ast-grep --pattern 'onKeyDown' HelpAndFeedbackPopover.tsx

Length of output: 263


Script:

#!/bin/bash
# First, let's find the HelpAndFeedback component file
fd HelpAndFeedback

# Then search for ARIA attributes and keyboard handlers in relevant files
rg -l "aria-" $(fd HelpAndFeedback)
rg "onKeyDown|onKeyPress|onKeyUp" $(fd HelpAndFeedback)

# Look for any Dialog or Popover usage
rg "Dialog|Popover" $(fd HelpAndFeedback)

Length of output: 1092


Script:

#!/bin/bash
# Let's check the primitives components being used for accessibility features
rg -A 5 "aria-|role=" apps/webapp/app/components/primitives/Dialog.tsx apps/webapp/app/components/primitives/Popover.tsx

# Also check for keyboard event handlers in these primitive components
rg "onKeyDown|onKeyPress|onKeyUp" apps/webapp/app/components/primitives/Dialog.tsx apps/webapp/app/components/primitives/Popover.tsx

# Check if we're using RadixUI primitives which are known for accessibility
rg "@radix-ui" apps/webapp/app/components/primitives/Dialog.tsx apps/webapp/app/components/primitives/Popover.tsx

Length of output: 590

apps/webapp/app/components/navigation/HelpAndFeedbackPopover.tsx (4)

1-22: LGTM: Well-organized imports

The imports are properly organized and all appear to be necessary for the component's functionality.


23-25: LGTM: Clean component structure

Good use of hooks for state management and subscription plan access.


23-182: Overall implementation looks good!

The component is well-structured and implements all the required functionality for the Help & Feedback menu. The code is clean, organized, and follows React best practices. The suggested improvements are minor and can be addressed in follow-up updates.


28-34: Verify keyboard shortcut compatibility

The 'h' keyboard shortcut might conflict with browser's history shortcut (Alt+h/⌥+h). Consider using a different key or a combination with modifiers.

apps/webapp/app/components/navigation/SideMenu.tsx (2)

Line range hint 65-76: LGTM: Clean import restructuring

The import changes appropriately reflect the consolidation of help & feedback functionality into a dedicated component.


76-76: Verify layout integration of the new HelpAndFeedback component

The placement in the footer section looks good, but let's verify that:

  1. The component renders correctly within the flex container
  2. There are no spacing issues with the FreePlanUsage component

Also applies to: 200-204

✅ Verification successful

Layout integration of HelpAndFeedback component is properly implemented

The verification shows that:

  1. The HelpAndFeedback component is correctly placed in SideMenu's footer section within a flex container: <div className="flex flex-col gap-1 border-t border-grid-bright p-1">
  2. The component itself uses proper flex layouts and spacing internally
  3. The implementation follows the same styling patterns as other menu items, ensuring consistent spacing with FreePlanUsage component
🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Check for any style-related props or className usage in HelpAndFeedbackPopover

# Search for className or style props in the HelpAndFeedbackPopover component
ast-grep --pattern 'export function HelpAndFeedback() {
  $$$
  return <$_$props$_$ />
}'

# Check for any flex-related styles that might affect layout
rg -l "flex|gap|space" --type tsx "HelpAndFeedbackPopover"

Length of output: 178


Script:

#!/bin/bash
# Let's try a different approach to verify the layout integration

# First, let's find the actual file path for HelpAndFeedbackPopover
fd -e tsx -e ts "HelpAndFeedback"

# Then check the SideMenu component's footer section implementation
rg -A 5 -B 5 "HelpAndFeedback" apps/webapp/app/components/navigation/SideMenu.tsx

# Look for any flex/layout related styles in both files
rg "flex|gap|space|margin|padding" apps/webapp/app/components/navigation/SideMenu.tsx

Length of output: 1853


Script:

#!/bin/bash
# Let's check the HelpAndFeedbackPopover component implementation for any layout concerns

# Check the implementation of HelpAndFeedbackPopover
cat apps/webapp/app/components/navigation/HelpAndFeedbackPopover.tsx

# Also check for any styles or className usage in this file
rg "className|style" apps/webapp/app/components/navigation/HelpAndFeedbackPopover.tsx

Length of output: 8629

Comment on lines +41 to +86
<SideMenuItem
name="Documentation"
icon="docs"
trailingIcon={ArrowUpRightIcon}
trailingIconClassName="text-text-dimmed"
inactiveIconColor="text-green-500"
activeIconColor="text-green-500"
to="https://trigger.dev/docs"
data-action="documentation"
target="_blank"
/>
</div>
<div className="flex flex-col gap-1 p-1">
<SideMenuItem
name="Status"
icon={SignalIcon}
trailingIcon={ArrowUpRightIcon}
trailingIconClassName="text-text-dimmed"
inactiveIconColor="text-green-500"
activeIconColor="text-green-500"
to="https://status.trigger.dev/"
data-action="status"
target="_blank"
/>
<SideMenuItem
name="Suggest a feature"
icon={LightBulbIcon}
trailingIcon={ArrowUpRightIcon}
trailingIconClassName="text-text-dimmed"
inactiveIconColor="text-sun-500"
activeIconColor="text-sun-500"
to="https://feedback.trigger.dev/"
data-action="suggest-a-feature"
target="_blank"
/>
<SideMenuItem
name="Changelog"
icon="star"
trailingIcon={ArrowUpRightIcon}
trailingIconClassName="text-text-dimmed"
inactiveIconColor="text-sun-500"
activeIconColor="text-sun-500"
to="https://trigger.dev/changelog"
data-action="changelog"
target="_blank"
/>
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue

Add security attributes to external links

When using target="_blank", it's recommended to add rel="noopener noreferrer" to prevent potential security vulnerabilities (reverse tabnabbing).

Apply this pattern to all external links:

 <SideMenuItem
   name="Documentation"
   icon="docs"
   trailingIcon={ArrowUpRightIcon}
   trailingIconClassName="text-text-dimmed"
   inactiveIconColor="text-green-500"
   activeIconColor="text-green-500"
   to="https://trigger.dev/docs"
   data-action="documentation"
   target="_blank"
+  rel="noopener noreferrer"
 />

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

Copy link

pkg-pr-new bot commented Nov 19, 2024

@trigger.dev/core

pnpm add https://pkg.pr.new/triggerdotdev/trigger.dev/@trigger.dev/core@1482

@trigger.dev/build

pnpm add https://pkg.pr.new/triggerdotdev/trigger.dev/@trigger.dev/build@1482

trigger.dev

pnpm add https://pkg.pr.new/triggerdotdev/trigger.dev@1482

@trigger.dev/react-hooks

pnpm add https://pkg.pr.new/triggerdotdev/trigger.dev/@trigger.dev/react-hooks@1482

@trigger.dev/sdk

pnpm add https://pkg.pr.new/triggerdotdev/trigger.dev/@trigger.dev/sdk@1482

commit: 171f6b2

@matt-aitken matt-aitken merged commit 58861a0 into main Nov 19, 2024
9 checks passed
@matt-aitken matt-aitken deleted the account-side-menu-update branch November 19, 2024 10:08
@coderabbitai coderabbitai bot mentioned this pull request Nov 21, 2024
@coderabbitai coderabbitai bot mentioned this pull request Dec 18, 2024
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.

2 participants