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/apply free #1050

Merged
merged 13 commits into from
Mar 7, 2025
Merged

Feat/apply free #1050

merged 13 commits into from
Mar 7, 2025

Conversation

haydencleary
Copy link
Contributor

@haydencleary haydencleary commented Mar 7, 2025

Summary by CodeRabbit

  • New Features

    • Introduced an enhanced side panel for issues that provides detailed information, metrics, and interactive options for applying and bookmarking.
    • Integrated the side panel directly into chats and issue views for a more intuitive experience.
  • Refactor

    • Streamlined issue interaction flows by replacing legacy behaviors with a unified, component-based approach.
    • Removed redundant elements to simplify the UI and improve overall responsiveness.

@haydencleary haydencleary self-assigned this Mar 7, 2025
Copy link
Contributor

coderabbitai bot commented Mar 7, 2025

Walkthrough

This pull request updates how issue interactions are handled across the system. The legacy prop and hook for contributions have been replaced with an issue-focused approach. Specifically, the onOpenContribution function and related hook are removed in favor of an onOpenIssue function that accepts two parameters. Multiple components and pages now integrate the new IssueSidepanel component for displaying issue details and managing applications. Additional new shared components, utilities, and UI enhancements have been introduced to support the updated control flow and state management related to issue interactions.

Changes

File(s) Change Summary
app/(saas)/od-say/_features/chat/_features/message/message.tsx
app/(saas)/od-say/_features/chat/_features/message/message.types.ts
Removed onOpenContribution prop/method and added onOpenIssue with two parameters; updates in message rendering and prop interface.
app/(saas)/od-say/chat.tsx Introduced new state (issuePanel) and ref for managing issue side panel; replaced legacy onOpenIssue with updated implementation that triggers the side panel.
app/(saas)/od-say/page.tsx
app/(saas)/osw/[hackathonSlug]/layout.tsx
app/(saas)/projects/[projectSlug]/layout.tsx
Removed <ApplyIssueSidepanel /> component from various layout and page components.
app/(saas)/osw/[hackathonSlug]/my-applications/page.tsx
app/(saas)/projects/[projectSlug]/issues/page.tsx
app/(saas)/projects/[projectSlug]/overview/_features/available-issues/available-issues.tsx
app/(saas)/projects/[projectSlug]/overview/_features/good-first-issues/good-first-issues.tsx
Removed useApplyIssueSidePanel hook and associated click handlers; integrated IssueSidepanel component directly for issue interactions.
core/application/react-query-adapter/application/client/use-delete-application.ts Added a new query invalidation step to refresh user information after deleting an application.
shared/features/issues/apply-counter/apply-counter.tsx
shared/features/issues/apply-counter/apply-counter.types.ts
shared/features/issues/apply-issue-guideline/apply-issue-guideline.types.ts
Removed the children prop from ApplyCounter and deleted unused types for counter and guideline props.
Multiple files under shared/panels/issue-sidepanel/ (including components: apply-panel.tsx, github-comment.tsx, header.tsx, metrics.tsx, summay.tsx, issue-sidepanel.tsx, and types in issue-sidepanel.types.ts, plus utilities in utils.ts) Introduced a new IssueSidepanel component along with a set of new child components (ApplyPanel, GithubComment, Header, Metrics, Summary), utility functions for mapping contribution data, and a Zod schema for form validation.
shared/ui/sheet.tsx Added a new optional property (overlayProps) to SheetContentProps and introduced two new components: SheetLoading and SheetError for enhanced UI feedback.

Sequence Diagram(s)

sequenceDiagram
    participant U as User
    participant M as Message Component
    participant C as Chat Component
    participant P as IssueSidepanel

    U->>M: Click on an issue card
    M->>C: Call onOpenIssue(issueId, projectId)
    C->>C: Update issuePanel state & trigger button click
    C->>P: Render IssueSidepanel with issueId, projectId
    P->>P: Fetch & display issue details, manage application interactions
Loading

Possibly related PRs

Suggested reviewers

  • pixelfact

Poem

I’m a little bunny 🐰, delighted to say,
New issues shine brighter in a brand new way.
Side panels open with a gentle click,
Refactored flows make code less thick.
Hopping on changes with a happy beat,
Celebrating progress in every line so neat!
🥕 Cheers to code that’s hard to beat!

✨ 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.
    • 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 generate docstrings to generate docstrings for 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.

Copy link

vercel bot commented Mar 7, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
saas-frontend ✅ Ready (Inspect) Visit Preview 💬 Add feedback Mar 7, 2025 3:34pm
saas-storybook ❌ Failed (Inspect) Mar 7, 2025 3:34pm

@haydencleary haydencleary enabled auto-merge (squash) March 7, 2025 15:34
@haydencleary haydencleary disabled auto-merge March 7, 2025 15:34
@haydencleary haydencleary merged commit b0d3022 into main Mar 7, 2025
2 of 6 checks passed
@haydencleary haydencleary deleted the feat/apply-free branch March 7, 2025 15:34
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: 3

🧹 Nitpick comments (30)
shared/features/issues/apply-counter/apply-counter.tsx (1)

9-9: Function signature simplified by removing children prop

The function no longer accepts children as a prop, which aligns with the component's focused purpose of displaying application count information. This is a breaking change for any components that were previously passing children to ApplyCounter.

shared/panels/issue-sidepanel/issue-sidepanel.types.ts (2)

3-5: Consider revising naming convention

The naming pattern issueSidepanelzodSchema is somewhat inconsistent with typical naming conventions. Consider using a more standard approach like issueSidepanelSchema or issueSchema.

-export const issueSidepanelzodSchema = z.object({
+export const issueSidepanelSchema = z.object({
  githubComment: z.string().min(1),
});

7-7: Update type reference if schema name changes

If you rename the schema constant, don't forget to update this reference as well.

-export type IssueSidepanelFormSchema = z.infer<typeof issueSidepanelzodSchema>;
+export type IssueSidepanelFormSchema = z.infer<typeof issueSidepanelSchema>;
app/(saas)/projects/[projectSlug]/overview/_features/available-issues/available-issues.tsx (1)

72-93: Redundant key prop

The key prop is applied redundantly to both the list item (li) element and the IssueSidepanel component. It's only necessary on the list item.

<li key={issue.id}>
-  <IssueSidepanel key={issue.id} projectId={projectId} issueId={issue.id}>
+  <IssueSidepanel projectId={projectId} issueId={issue.id}>
    <button
shared/panels/issue-sidepanel/_components/header/header.tsx (2)

25-29: Add an accessible label to the back button

The back button has a clear visual icon but lacks an accessible label for screen readers. Consider adding an aria-label for better accessibility.

-          <Button variant="ghost" size="icon" className="shrink-0" onClick={onBack}>
+          <Button variant="ghost" size="icon" className="shrink-0" onClick={onBack} aria-label="Go back">
            <ChevronLeft />
          </Button>

31-31: Add title attribute to truncated text

Since you're using line-clamp-1 to limit the title to one line, it would be helpful to add a title attribute so users can see the full text on hover when it's truncated.

-        <TypographyH4 className="line-clamp-1">{issueTitle}</TypographyH4>
+        <TypographyH4 className="line-clamp-1" title={issueTitle}>{issueTitle}</TypographyH4>
shared/panels/issue-sidepanel/_components/summary/summay.tsx (4)

9-9: Consider adding error handling for dynamic import

The dynamic import for the Emoji component doesn't include error handling. Consider adding a fallback in case the import fails.

-const Emoji = dynamic(() => import("react-emoji-render"));
+const Emoji = dynamic(() => import("react-emoji-render").catch(() => ({ default: ({ children }) => children })));

23-26: Improve accessibility of Avatar component

Add an alt attribute to the AvatarImage to improve accessibility.

-          <AvatarImage src={author.avatarUrl} />
+          <AvatarImage src={author.avatarUrl} alt={`${author.login}'s avatar`} />

31-35: Consider adding loading state for Markdown content

The Markdown component might have some rendering delay, especially for larger content. Consider adding a loading state.


37-47: Enhance label semantics

The labels list could benefit from some semantic improvements. Consider adding an aria-label to the list.

-        {labels ? (
-          <ul className="flex flex-wrap items-center gap-2">
+        {labels ? (
+          <ul className="flex flex-wrap items-center gap-2" aria-label="Issue labels">
shared/panels/issue-sidepanel/_components/metrics/metrics.tsx (3)

15-16: Add error handling for date formatting

The date formatting logic doesn't include error handling for invalid date inputs. Consider adding a fallback or try/catch block.

-  const dateKernelPort = bootstrap.getDateKernelPort();
-  const openedSince = dateKernelPort.formatDistanceToNow(new Date(createdAt), { unit: "day", addSuffix: false });
+  const dateKernelPort = bootstrap.getDateKernelPort();
+  let openedSince;
+  try {
+    openedSince = dateKernelPort.formatDistanceToNow(new Date(createdAt), { unit: "day", addSuffix: false });
+  } catch (error) {
+    console.error("Error formatting date:", error);
+    openedSince = "Unknown";
+  }

18-34: Consider responsive layout for mobile views

The current grid layout with 3 columns might not work well on smaller screens. Consider adding responsive classes to adjust the column count based on screen size.

-    <div className="grid grid-cols-3 gap-3">
+    <div className="grid grid-cols-1 sm:grid-cols-2 md:grid-cols-3 gap-3">

20-23: Enhance accessibility with ARIA roles

Consider adding ARIA roles to the cards to improve accessibility and make their purpose clearer to screen readers.

-      <Card className="flex flex-col gap-1 p-3">
+      <Card className="flex flex-col gap-1 p-3" role="region" aria-label="Applicants count">

Apply similar changes to the other card elements as well.

Also applies to: 25-28, 30-33

shared/ui/sheet.tsx (1)

119-124: Simple and effective error state component.

The SheetError component provides a clean fallback for error states. Consider enhancing it in the future to include error details or retry actions for a better user experience.

shared/panels/issue-sidepanel/_utils/utils.ts (3)

4-26: Consider verifying parseInt logic and handle potential NaN.

When converting contribution.githubId to a number, be aware that parseInt can return NaN. You might want to confirm upstream validations or add a fallback if invalid inputs are possible.


28-37: Handle unknown statuses more gracefully.

Defaulting to "CANCELLED" may be fine, but consider adding an "UNKNOWN" or other fallback status to flag truly unexpected inputs.


39-88: Potential improvement for random label generation.

Maintaining a large array of strings here might hamper readability and i18n support. Consider moving the data into a separate config or resource file for easier management.

app/(saas)/od-say/_features/chat/chat.tsx (3)

24-24: Consider avoiding programmatic ref clicks.

Relying on a hidden button ref for sheet toggling can be less intuitive. A direct callback or a controlled open prop might simplify the flow.


31-33: Using programmatic click to open the sheet.

While this works, you could expose an API to open the panel directly and remove the extra DOM element.


135-137: Embedding the trigger button as a child of IssueSidepanel.

Consider controlling open via state to reduce the complexity of manually clicking a hidden trigger.

shared/panels/issue-sidepanel/issue-sidepanel.tsx (4)

34-40: IssueSidepanel: flexible approach for both issueId and contributionUuid.

If both or neither props can be passed, be mindful of potential ambiguity. You might consider splitting them into distinct modes or ensuring only one is ever passed.


42-59: Sheet usage looks correct.

You might review accessibility details (focus management, ESC key handling) to ensure the side panel aligns with best practices.


62-189: Dual fetching logic for issue and contribution.

Merging data from two queries can be effective but be sure the fallback to issueFromContribution won’t cause confusion if both are valid or if issueId is 0. Consider more explicit error handling for missing or invalid inputs.


191-301: Render logic and form submission flow.

The CTA decisions, forms, and toasts are coherent. As a minor enhancement, handling edge cases (e.g., closed issues, maximum application limit) could be further emphasized in the UI.

shared/panels/issue-sidepanel/_components/apply-panel/apply-panel.tsx (6)

34-38: Consider adding error handling for the onApply callback.

The handleApply function doesn't include any error handling. If the onApply callback throws an error, it might prevent setOpen(false) from being called, leaving the panel open unexpectedly.

function handleApply() {
  capture("issue_sidepanel_apply_normal", { issue_id: issueId });
-  onApply();
-  setOpen(false);
+  try {
+    onApply();
+  } catch (error) {
+    console.error("Error applying for issue:", error);
+  } finally {
+    setOpen(false);
+  }
}

40-44: Consider adding error handling for the onBookmark callback.

Similar to the handleApply function, the handleBookmark function should include error handling to ensure the panel always closes after the action is attempted.

function handleBookmark() {
  capture("issue_sidepanel_apply_free", { issue_id: issueId });
-  onBookmark();
-  setOpen(false);
+  try {
+    onBookmark();
+  } catch (error) {
+    console.error("Error bookmarking issue:", error);
+  } finally {
+    setOpen(false);
+  }
}

113-117: Consider adding loading state and proper fallback for external link.

When clicking on "Get to work", the user is directed to an external URL. It's good practice to provide a loading state or feedback to the user, especially if the link may take time to load.

-<Button className="w-fit" onClick={handleBookmark} asChild>
-  <a href={issueUrl} target="_blank" rel="noopener noreferrer">
-    <ArrowRight /> Get to work
-  </a>
-</Button>
+<Button 
+  className="w-fit" 
+  onClick={handleBookmark} 
+  asChild
+>
+  <a 
+    href={issueUrl} 
+    target="_blank" 
+    rel="noopener noreferrer"
+    aria-label={`Work on issue #${issueNumber}: ${issueTitle}`}
+  >
+    <ArrowRight /> Get to work
+  </a>
+</Button>

49-55: Add aria-label to the header for better accessibility.

The Header component should include an aria-label to improve accessibility for screen readers.

<Header
  issueNumber={issueNumber}
  issueStatus={issueStatus}
  issueTitle={issueTitle}
  onBack={() => setOpen(false)}
+  aria-label={`Issue #${issueNumber} details`}
/>

1-11: Consider organizing imports for better readability.

The import statements could be better organized into groups: external libraries, internal components, and internal utilities.

-import { ArrowRight, CircleDotDashed, CircleEllipsis, CircleHelp, GitMerge } from "lucide-react";
-import { PropsWithChildren, useState } from "react";
-
-import { ContributionGithubStatusUnion } from "@/core/domain/contribution/models/contribution.types";
-
-import { Header } from "@/shared/panels/issue-sidepanel/_components/header/header";
-import { usePosthog } from "@/shared/tracking/posthog/use-posthog";
-import { Button } from "@/shared/ui/button";
-import { Card } from "@/shared/ui/card";
-import { Sheet, SheetContent, SheetTrigger } from "@/shared/ui/sheet";
-import { TypographyH3, TypographyMuted, TypographyP } from "@/shared/ui/typography";

+// External libraries
+import { ArrowRight, CircleDotDashed, CircleEllipsis, CircleHelp, GitMerge } from "lucide-react";
+import { PropsWithChildren, useState } from "react";
+
+// Domain models
+import { ContributionGithubStatusUnion } from "@/core/domain/contribution/models/contribution.types";
+
+// Components
+import { Header } from "@/shared/panels/issue-sidepanel/_components/header/header";
+import { Button } from "@/shared/ui/button";
+import { Card } from "@/shared/ui/card";
+import { Sheet, SheetContent, SheetTrigger } from "@/shared/ui/sheet";
+import { TypographyH3, TypographyMuted, TypographyP } from "@/shared/ui/typography";
+
+// Utilities
+import { usePosthog } from "@/shared/tracking/posthog/use-posthog";

13-30: Enhance component documentation with JSDoc.

Adding JSDoc comments would improve the maintainability and discoverability of this component.

+/**
+ * ApplyPanel component provides an interface for users to apply for or bookmark issues.
+ * It offers two pathways for contributors: structured assignment or independent work.
+ *
+ * @param {Object} props - Component props
+ * @param {React.ReactNode} props.children - Trigger element for the sheet
+ * @param {number} props.issueId - The unique identifier for the issue
+ * @param {string} props.issueTitle - The title of the issue
+ * @param {number} props.issueNumber - The issue number
+ * @param {ContributionGithubStatusUnion} props.issueStatus - The current status of the issue
+ * @param {string} props.issueUrl - URL to the issue on GitHub
+ * @param {() => void} props.onApply - Callback function when user applies for assignment
+ * @param {() => void} props.onBookmark - Callback function when user chooses to work independently
+ */
export function ApplyPanel({
  children,
  issueId,
  issueTitle,
  issueNumber,
  issueStatus,
  issueUrl,
  onApply,
  onBookmark,
}: PropsWithChildren<{
  issueId: number;
  issueTitle: string;
  issueNumber: number;
  issueStatus: ContributionGithubStatusUnion;
  issueUrl: string;
  onApply: () => void;
  onBookmark: () => void;
}>) {
📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between d885006 and faf69ef.

📒 Files selected for processing (23)
  • app/(saas)/od-say/_features/chat/_features/message/message.tsx (2 hunks)
  • app/(saas)/od-say/_features/chat/_features/message/message.types.ts (1 hunks)
  • app/(saas)/od-say/_features/chat/chat.tsx (4 hunks)
  • app/(saas)/od-say/page.tsx (0 hunks)
  • app/(saas)/osw/[hackathonSlug]/layout.tsx (0 hunks)
  • app/(saas)/osw/[hackathonSlug]/my-applications/page.tsx (3 hunks)
  • app/(saas)/projects/[projectSlug]/issues/page.tsx (2 hunks)
  • app/(saas)/projects/[projectSlug]/layout.tsx (0 hunks)
  • app/(saas)/projects/[projectSlug]/overview/_features/available-issues/available-issues.tsx (2 hunks)
  • app/(saas)/projects/[projectSlug]/overview/_features/good-first-issues/good-first-issues.tsx (2 hunks)
  • core/application/react-query-adapter/application/client/use-delete-application.ts (1 hunks)
  • shared/features/issues/apply-counter/apply-counter.tsx (2 hunks)
  • shared/features/issues/apply-counter/apply-counter.types.ts (0 hunks)
  • shared/features/issues/apply-issue-guideline/apply-issue-guideline.types.ts (0 hunks)
  • shared/panels/issue-sidepanel/_components/apply-panel/apply-panel.tsx (1 hunks)
  • shared/panels/issue-sidepanel/_components/github-comment/github-comment.tsx (1 hunks)
  • shared/panels/issue-sidepanel/_components/header/header.tsx (1 hunks)
  • shared/panels/issue-sidepanel/_components/metrics/metrics.tsx (1 hunks)
  • shared/panels/issue-sidepanel/_components/summary/summay.tsx (1 hunks)
  • shared/panels/issue-sidepanel/_utils/utils.ts (1 hunks)
  • shared/panels/issue-sidepanel/issue-sidepanel.tsx (1 hunks)
  • shared/panels/issue-sidepanel/issue-sidepanel.types.ts (1 hunks)
  • shared/ui/sheet.tsx (3 hunks)
💤 Files with no reviewable changes (5)
  • shared/features/issues/apply-issue-guideline/apply-issue-guideline.types.ts
  • app/(saas)/od-say/page.tsx
  • app/(saas)/osw/[hackathonSlug]/layout.tsx
  • app/(saas)/projects/[projectSlug]/layout.tsx
  • shared/features/issues/apply-counter/apply-counter.types.ts
🧰 Additional context used
🪛 ESLint
shared/panels/issue-sidepanel/_components/apply-panel/apply-panel.tsx

[error] 77-77: ' can be escaped with &apos;, &lsquo;, &#39;, &rsquo;.

(react/no-unescaped-entities)

🔇 Additional comments (23)
shared/features/issues/apply-counter/apply-counter.tsx (3)

33-43: Component structure simplified with direct return of UI elements

The component now has a cleaner, more focused structure that directly returns the application count UI without nesting it with children. This change makes the component more reusable and single-purpose.


34-36: Application count visibility enhanced with conditional styling

Good implementation of conditional styling to highlight when the user has reached their application limit, using red text to draw attention to this state.


38-42: Progress bar effectively visualizes application usage

The progress bar provides a helpful visual indicator of application usage. The conditional styling for the progress bar (turning red when at limit) reinforces the state messaging in the text above.

core/application/react-query-adapter/application/client/use-delete-application.ts (1)

38-41: Good addition for data consistency

Adding this query invalidation ensures that the user's information gets refreshed when they delete an application, preventing stale data from being displayed.

app/(saas)/osw/[hackathonSlug]/my-applications/page.tsx (1)

113-135: Duplicate inconsistent prop naming

Same inconsistency with contributionUuid vs issueId as mentioned in the previous comment.

app/(saas)/projects/[projectSlug]/overview/_features/available-issues/available-issues.tsx (1)

72-93: Inconsistent prop naming between components

You're using issueId here, but in other components (like my-applications.tsx), the same property is named contributionUuid. Standardize this across the codebase to avoid confusion and potential bugs.

shared/panels/issue-sidepanel/_components/header/header.tsx (1)

11-35: Overall implementation looks good

The Header component is well-structured with proper typing, conditional rendering, and appropriate UI components. The layout is clean and should work well for displaying issue information.

app/(saas)/od-say/_features/chat/_features/message/message.types.ts (1)

17-17:

❓ Verification inconclusive

Update method signature looks good

The change from onOpenContribution to onOpenIssue with the addition of a projectId parameter is a sensible improvement. This provides more context to the consumer and aligns well with the PR objectives.

Ensure all component implementations using this interface are updated accordingly to pass both parameters.


🏁 Script executed:

#!/bin/bash
# Search for implementations of the new onOpenIssue method to ensure proper usage
rg "onOpenIssue\(" --type ts --type tsx -A 3 -B 3

Length of output: 79


Attention: Manual Verification Required for onOpenIssue Implementations

The updated method signature—from onOpenContribution to onOpenIssue with the added projectId parameter—aligns well with the PR objectives. However, our initial search encountered an issue with the file type filtering (error: "unrecognized file type: tsx"). To ensure all component implementations have been updated accordingly, please verify that every usage of this interface now passes both parameters.

  • Next Steps:
    • Run the following commands to search separately in .ts and .tsx files:
      echo "Searching in .ts files:"
      rg "onOpenIssue\(" --type ts -A 3 -B 3 || echo "No matches in .ts files"
      
      echo "Searching in .tsx files:"
      rg "onOpenIssue\(" --glob "*.tsx" -A 3 -B 3 || echo "No matches in .tsx files"
    • Review the output to ensure all instances of onOpenIssue have been updated.
shared/panels/issue-sidepanel/_components/metrics/metrics.tsx (1)

6-36: Good implementation of metrics component

The Metrics component is well-structured and provides a clean, consistent way to display issue statistics. The three-card layout with distinct sections for applicants, comments, and age is intuitive and aligns well with common design patterns.

app/(saas)/projects/[projectSlug]/overview/_features/good-first-issues/good-first-issues.tsx (1)

86-107: Clean implementation of the IssueSidepanel component!

The refactoring from imperative side panel opening to a declarative component approach is a solid improvement. This pattern makes the component hierarchy clearer and encapsulates the panel opening/closing logic inside the IssueSidepanel component.

app/(saas)/od-say/_features/chat/_features/message/message.tsx (2)

154-154: Appropriate prop name change aligned with new issue-focused approach.

The removal of onOpenContribution in favor of onOpenIssue aligns well with the overall shift toward an issue-focused approach mentioned in the PR summary.


200-204: Good handling of potential undefined project ID.

The implementation correctly handles the possibility of an undefined contribution.project?.id by providing an empty string fallback, ensuring the function always receives valid parameters.

shared/panels/issue-sidepanel/_components/github-comment/github-comment.tsx (1)

9-33: Well-structured form component with appropriate feedback.

This component is well-implemented with:

  • Proper form field structure
  • Clear labeling and user feedback
  • Conditional rendering based on application state
  • Appropriate validation handling

The auto-focus attribute is a nice touch for improving the user experience.

shared/ui/sheet.tsx (3)

57-58: Good extension of SheetContentProps with overlay customization.

Adding overlayProps increases the flexibility of the Sheet component, allowing consumers to customize the overlay behavior and appearance as needed.


63-63: Proper implementation of overlayProps spreading.

The change correctly spreads the optional overlay props to the SheetOverlay component.


102-117: Well-designed loading state component.

The SheetLoading component provides a clean, consistent loading state with appropriate skeleton placeholders for header, content, and footer sections. This helps maintain layout stability during loading states.

app/(saas)/od-say/_features/chat/chat.tsx (4)

3-3: No concerns with the updated import usage.


8-8: Import of IssueSidepanel is fine.


23-23: Stateful approach for issue panel management is straightforward.


76-77: Handing off onOpenIssue to Message.

This is consistent with the new approach, and it helps unify how issues are opened throughout the component tree.

app/(saas)/projects/[projectSlug]/issues/page.tsx (2)

21-21: Import of IssueSidepanel is straightforward.


200-232: Wrapping CardIssue with IssueSidepanel.

This integration looks consistent. However, verify that data?.id isn't empty if the side panel relies on a valid project ID. Consider gracefully handling the case where project data is unavailable.

shared/panels/issue-sidepanel/issue-sidepanel.tsx (1)

1-31: Imports and definitions are comprehensive.

All required dependencies are here. No immediate concerns.

Comment on lines +79 to +101
<IssueSidepanel key={issue.id} projectId={issue.project?.id ?? ""} contributionUuid={issue.id}>
<CardIssue
title={issue.githubTitle}
contribution={{
type: "ISSUE",
githubStatus: issue.githubStatus,
number: issue.githubNumber,
}}
createdAt={issue.createdAt}
users={issue.applicants.map(a => ({
login: a.login,
avatarUrl: a.avatarUrl,
}))}
createdBy={{
login: issue.githubAuthor.login,
avatarUrl: issue.githubAuthor.avatarUrl,
}}
repo={{
name: issue.repo.name,
url: issue.repo.htmlUrl,
}}
/>
</IssueSidepanel>
Copy link
Contributor

Choose a reason for hiding this comment

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

💡 Verification agent

🧩 Analysis chain

Inconsistent prop naming between components

You're using contributionUuid here, but in other components (like available-issues.tsx), the same property is named issueId. Consider using consistent prop naming across the codebase.


🏁 Script executed:

#!/bin/bash
# Find all instances of IssueSidepanel usage to check prop naming consistency
rg -n "IssueSidepanel.*\b(contributionUuid|issueId)\b" --type tsx --type jsx

Length of output: 106


I'm noticing that the initial search command failed to properly scan *.tsx files (due to the “unrecognized file type: tsx” error). To verify the naming consistency between components (i.e. using contributionUuid in this file versus issueId in, for example, available-issues.tsx), please run the following updated script:

Once you verify that other components (like available-issues.tsx) use issueId instead of contributionUuid, please update this file accordingly to ensure consistent prop naming across the codebase.

Action Required:
• Verify the prop naming in all IssueSidepanel usages (especially in available-issues.tsx).
• Refactor either the prop in this file (page.tsx) or update the other components so that both use the same prop name.


🏁 Script executed:

#!/bin/bash
# Searching for IssueSidepanel usage with both naming conventions in .tsx and .jsx files
rg -n "IssueSidepanel.*(contributionUuid|issueId)" --glob "*.tsx" --glob "*.jsx"

Length of output: 1185


Consistent Prop Naming for IssueSidepanel

The codebase shows that the IssueSidepanel component is used with two different prop names—contributionUuid in files such as app/(saas)/osw/[hackathonSlug]/my-applications/page.tsx and in app/(saas)/od-say/_features/chat/chat.tsx, versus issueId in files like app/(saas)/projects/[projectSlug]/overview/_features/available-issues/available-issues.tsx and others. This inconsistency can cause confusion and potential issues downstream.

Action Required:

  • Confirm the correct prop name by reviewing the IssueSidepanel component’s definition.
  • Refactor the code to consistently use one prop name (preferably issueId, as it is used in the majority of places) across all files.
  • Update the following usages accordingly:
    • app/(saas)/osw/[hackathonSlug]/my-applications/page.tsx (currently using contributionUuid)
    • app/(saas)/od-say/_features/chat/chat.tsx (currently passing issuePanel.issueId via contributionUuid)
    • Verify other files for similar inconsistencies.

Comment on lines +1 to +9
import dynamic from "next/dynamic";

import { Markdown } from "@/shared/features/markdown/markdown";
import { Avatar, AvatarFallback, AvatarImage } from "@/shared/ui/avatar";
import { Badge } from "@/shared/ui/badge";
import { Card } from "@/shared/ui/card";
import { TypographyP } from "@/shared/ui/typography";

const Emoji = dynamic(() => import("react-emoji-render"));
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

Fix typo in filename

The filename is misspelled as "summay.tsx" instead of "summary.tsx". This should be corrected to maintain consistency and prevent potential import issues.

✅ Clear direction from the maintainer
<br />
✅ Structured support throughout
<br />✅ Ensure you're on the right track before diving in
Copy link
Contributor

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion

Fix the unescaped entity in JSX.

React warns about unescaped entities in JSX. The apostrophe in "you're" should be escaped.

-<br />✅ Ensure you're on the right track before diving in
+<br />✅ Ensure you&apos;re on the right track before diving in
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
<br /> Ensure you're on the right track before diving in
<br /> Ensure you&apos;re on the right track before diving in
🧰 Tools
🪛 ESLint

[error] 77-77: ' can be escaped with &apos;, &lsquo;, &#39;, &rsquo;.

(react/no-unescaped-entities)

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