Skip to content

Conversation

@rbshh
Copy link
Contributor

@rbshh rbshh commented Dec 22, 2025

Description

Added a Back to workspace button to the notifications sidebar header so users can easily navigate from /[workspaceSlug]/notifications back to the workspace home.

The back button:

  • Uses ChevronLeftIcon from @plane/propel/icons
  • Navigates via next/link to /${workspaceSlug}
  • Reuses getButtonStyling("secondary", "base") and cn to match existing button and header styling
  • Is aligned inline with the notifications breadcrumb to maintain visual consistency

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • [ x ] Feature (non-breaking change which adds functionality)
  • [ x ] Improvement (change that would cause existing functionality to not work as expected)
  • Code refactoring
  • Performance improvements
  • Documentation update

Test Scenarios

  • Navigated to /[workspaceSlug]/notifications and verified:
  • The back button is visible in the notifications sidebar header.
  • Clicking the back button navigates to /${workspaceSlug}.
  • Header layout and alignment remain correct on different viewport widths.
  • Ran linting for the updated file to ensure no new lint errors:
    apps/web/core/components/workspace-notifications/sidebar/header/root.tsx

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Dec 22, 2025

Walkthrough

A back navigation button using ChevronLeftIcon within a Next.js Link component is added alongside the existing Breadcrumbs header. The header now features a horizontal container layout with the new button and updated styling via getButtonStyling utilities, while maintaining existing conditional rendering logic.

Changes

Cohort / File(s) Summary
Workspace Notifications Header Navigation
apps/web/core/components/workspace-notifications/sidebar/header/root.tsx
Added left-aligned back button (ChevronLeftIcon in Next.js Link) adjacent to Breadcrumbs. Introduced horizontal container layout with spacing and button styling via getButtonStyling. Updated imports to include Link, getButtonStyling, ChevronLeftIcon, InboxIcon, and cn utility. Preserved existing conditional rendering for missing workspaceSlug.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

  • Verify the back button navigation link target is correct (check href construction)
  • Confirm getButtonStyling and cn utilities are imported from the correct modules
  • Ensure horizontal layout and spacing work across responsive breakpoints
  • Check that ChevronLeftIcon rendering aligns with design specifications

Poem

🐰 A button of chevrons points the way back,
Next to breadcrumbs in a neat horizontal stack—
Navigation flows left, then forward once more,
Users now travel both out and in-door! 🔙

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly describes the main enhancement: adding back navigation and styling improvements to the notification sidebar header.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Description check ✅ Passed The PR description is well-structured, follows the template, and provides clear details about the changes including the back button implementation, navigation behavior, and test scenarios performed.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

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

Comment @coderabbitai help to get the list of available commands and usage tips.

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

📜 Review details

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 57bbf3c and 7fee703.

📒 Files selected for processing (1)
  • apps/web/core/components/workspace-notifications/sidebar/header/root.tsx
🧰 Additional context used
📓 Path-based instructions (4)
**/*.{ts,tsx,mts,cts}

📄 CodeRabbit inference engine (.github/instructions/typescript.instructions.md)

**/*.{ts,tsx,mts,cts}: Use const type parameters for more precise literal inference in TypeScript 5.0+
Use the satisfies operator to validate types without widening them
Leverage inferred type predicates to reduce the need for explicit is return types in filter/check functions
Use NoInfer<T> utility to block inference for specific type arguments when they should be determined by other arguments
Utilize narrowing in switch(true) blocks for control flow analysis (TypeScript 5.3+)
Rely on narrowing from direct boolean comparisons for type guards
Trust preserved narrowing in closures when variables aren't modified after the check (TypeScript 5.4+)
Use constant indices to narrow object/array properties (TypeScript 5.5+)
Use standard ECMAScript decorators (Stage 3) instead of legacy experimentalDecorators
Use using declarations for explicit resource management with Disposable pattern instead of manual cleanup (TypeScript 5.2+)
Use with { type: "json" } for import attributes; avoid deprecated assert syntax (TypeScript 5.3/5.8+)
Use import type explicitly when importing types to ensure they are erased during compilation, respecting verbatimModuleSyntax flag
Use .ts, .mts, .cts extensions in import type statements (TypeScript 5.2+)
Use import type { Type } from "mod" with { "resolution-mode": "import" } for specific module resolution contexts (TypeScript 5.3+)
Use new iterator methods (map, filter, etc.) if targeting modern environments (TypeScript 5.6+)
Utilize new Set methods like union, intersection, etc., when available (TypeScript 5.5+)
Use Object.groupBy / Map.groupBy standard methods for grouping instead of external libraries (TypeScript 5.4+)
Use Promise.withResolvers() for creating promises with exposed resolve/reject functions (TypeScript 5.7+)
Use copying array methods (toSorted, toSpliced, with) for immutable array operations (TypeScript 5.2+)
Avoid accessing instance fields via super in classes (TypeScript 5....

Files:

  • apps/web/core/components/workspace-notifications/sidebar/header/root.tsx
**/*.{ts,tsx}

📄 CodeRabbit inference engine (AGENTS.md)

Enable TypeScript strict mode and ensure all files are fully typed

Files:

  • apps/web/core/components/workspace-notifications/sidebar/header/root.tsx
**/*.{js,jsx,ts,tsx,json,css}

📄 CodeRabbit inference engine (AGENTS.md)

Use Prettier with Tailwind plugin for code formatting, run pnpm fix:format

Files:

  • apps/web/core/components/workspace-notifications/sidebar/header/root.tsx
**/*.{js,jsx,ts,tsx}

📄 CodeRabbit inference engine (AGENTS.md)

**/*.{js,jsx,ts,tsx}: Use ESLint with shared config across packages, adhering to max warnings limits per package
Use camelCase for variable and function names, PascalCase for components and types
Use try-catch with proper error types and log errors appropriately

Files:

  • apps/web/core/components/workspace-notifications/sidebar/header/root.tsx
🧠 Learnings (5)
📚 Learning: 2025-12-17T10:58:59.591Z
Learnt from: CR
Repo: makeplane/plane PR: 0
File: packages/tailwind-config/AGENTS.md:0-0
Timestamp: 2025-12-17T10:58:59.591Z
Learning: Applies to packages/tailwind-config/**/*.{ts,tsx} : Sidebar menu items should use transparent backgrounds with hover states like `hover:bg-layer-1-hover` rather than base layer backgrounds, maintaining visual lightness while providing hover feedback

Applied to files:

  • apps/web/core/components/workspace-notifications/sidebar/header/root.tsx
📚 Learning: 2025-10-09T20:42:31.843Z
Learnt from: lifeiscontent
Repo: makeplane/plane PR: 7922
File: apps/admin/app/(all)/(dashboard)/ai/form.tsx:19-19
Timestamp: 2025-10-09T20:42:31.843Z
Learning: In the makeplane/plane repository, React types are globally available through TypeScript configuration. Type annotations like React.FC, React.ReactNode, etc. can be used without explicitly importing the React namespace. The codebase uses the modern JSX transform, so React imports are not required for JSX or type references.

Applied to files:

  • apps/web/core/components/workspace-notifications/sidebar/header/root.tsx
📚 Learning: 2025-10-21T17:22:05.204Z
Learnt from: lifeiscontent
Repo: makeplane/plane PR: 7989
File: apps/web/app/(all)/[workspaceSlug]/(projects)/projects/(detail)/[projectId]/pages/(detail)/[pageId]/page.tsx:45-46
Timestamp: 2025-10-21T17:22:05.204Z
Learning: In the makeplane/plane repository, the refactor from useParams() to params prop is specifically scoped to page.tsx and layout.tsx files in apps/web/app (Next.js App Router pattern). Other components (hooks, regular client components, utilities) should continue using the useParams() hook as that is the correct pattern for non-route components.

Applied to files:

  • apps/web/core/components/workspace-notifications/sidebar/header/root.tsx
📚 Learning: 2025-12-12T15:20:36.542Z
Learnt from: CR
Repo: makeplane/plane PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-12T15:20:36.542Z
Learning: Applies to packages/plane/ui/**/*.{ts,tsx} : Build components in `plane/ui` package with Storybook for isolated development

Applied to files:

  • apps/web/core/components/workspace-notifications/sidebar/header/root.tsx
📚 Learning: 2025-10-01T15:30:17.605Z
Learnt from: lifeiscontent
Repo: makeplane/plane PR: 7888
File: packages/propel/src/avatar/avatar.stories.tsx:2-3
Timestamp: 2025-10-01T15:30:17.605Z
Learning: In the makeplane/plane repository, avoid suggesting inline type imports (e.g., `import { Avatar, type TAvatarSize }`) due to bundler compatibility issues. Keep type imports and value imports as separate statements.

Applied to files:

  • apps/web/core/components/workspace-notifications/sidebar/header/root.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). (3)
  • GitHub Check: Cursor Bugbot
  • GitHub Check: Build packages
  • GitHub Check: Analyze (javascript)
🔇 Additional comments (3)
apps/web/core/components/workspace-notifications/sidebar/header/root.tsx (3)

2-8: LGTM! Clean import organization.

The new imports are properly structured and necessary for the navigation and styling enhancements.


28-28: LGTM! Appropriate layout structure.

The flex container with gap spacing properly organizes the back button and breadcrumbs horizontally.


38-48: LGTM! Breadcrumbs properly configured.

The Breadcrumbs implementation correctly uses translations, icon sizing, and the BreadcrumbLink component pattern.

Comment on lines +29 to +37
<Link
href={`/${workspaceSlug}`}
className={cn(
getButtonStyling("secondary", "base"),
"flex items-center justify-center gap-2 text-tertiary rounded-lg h-6 w-6 p-1 hover:bg-surface-2 hover:text-secondary"
)}
>
<ChevronLeftIcon className="h-4 w-4" />
</Link>
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 | 🟠 Major

Add accessible label for screen reader users.

The back navigation button contains only a visual icon without any accessible text or aria-label. Screen readers cannot announce the button's purpose, violating WCAG 2.1 Level A (Success Criterion 2.4.4 - Link Purpose).

🔎 Proposed fix to add aria-label
 <Link
   href={`/${workspaceSlug}`}
+  aria-label={t("notification.back_to_workspace")}
   className={cn(
     getButtonStyling("secondary", "base"),
     "flex items-center justify-center gap-2 text-tertiary rounded-lg h-6 w-6 p-1 hover:bg-surface-2 hover:text-secondary"
   )}
 >
   <ChevronLeftIcon className="h-4 w-4" />
 </Link>

Note: You'll need to add the translation key "notification.back_to_workspace" to the i18n files, or use an existing appropriate translation.


Consider simplifying the button styling approach.

The implementation combines getButtonStyling("secondary", "base") with extensive custom className overrides (rounded-lg, h-6, w-6, p-1, text colors, hover states). This pattern suggests either:

  • The custom classes are unnecessary and conflict with getButtonStyling output
  • Or getButtonStyling is not the right abstraction for this use case

Consider using only custom classes or creating a dedicated icon-button variant in the design system.

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

🤖 Prompt for AI Agents
In apps/web/core/components/workspace-notifications/sidebar/header/root.tsx
around lines 29-37, the Link back button only contains an icon and lacks an
accessible label; add an aria-label prop that uses the i18n key
"notification.back_to_workspace" (or an existing appropriate translation) so
screen readers can announce the link, and ensure the translation key is added to
locale files. Also simplify styling: either remove getButtonStyling and keep the
explicit icon-button classes (rounded-lg, h-6, w-6, p-1, text/hover classes) or
replace the combined classes with a dedicated "icon-button" variant in
getButtonStyling to avoid class conflicts; pick one approach and apply it
consistently to this component.

@rbshh
Copy link
Contributor Author

rbshh commented Dec 23, 2025

I wasn't able to run the prettier fix. Let me know if this can go through or needs any change.

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