Skip to content

Conversation

rupanshi01
Copy link

@rupanshi01 rupanshi01 commented Sep 16, 2025

changed 3 files global.css , app-sidebar.tsx , nav-user-tsx .

Summary by CodeRabbit

  • New Features

    • Added a bottom-anchored “Report issue” action in the app sidebar for quicker access.
  • Style

    • Sidebar updated to a full-height, column layout to support bottom-anchored actions and improve consistency.
  • UX Improvements

    • “Report issue” moved out of the user dropdown, remaining menu items unchanged and the action persistently visible.
  • Display

    • Container creation dates now show a short-month, day, year format (e.g., Sep 05, 2023).

Copy link
Contributor

coderabbitai bot commented Sep 16, 2025

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Walkthrough

Adds a .sidebar CSS class for full-height column flex layout, applies it to the AppSidebar, and moves the “Report Issue” action out of the user dropdown into a bottom-anchored button in the sidebar; no exported/public APIs changed.

Changes

Cohort / File(s) Summary
Sidebar styling
view/app/globals.css
Added .sidebar rule with display: flex; flex-direction: column; height: 100vh; and comment /* Ensure the sidebar supports bottom anchoring */.
Sidebar component hook-up
view/components/layout/app-sidebar.tsx
Added className="sidebar" to the Sidebar element; no other logic/API changes.
User menu restructuring
view/components/layout/nav-user.tsx
Removed DropdownMenuItem for "Report Issue" and rendered a bottom-anchored button (mt-auto p-4) with the same handleReportIssue handler; remaining menu items unchanged.
Date format change
view/app/containers/components/table.tsx
Switched container.created formatting from Intl.DateTimeFormat(undefined, { day: 'numeric', month: 'long' }) to Intl.DateTimeFormat('en-US', { month: 'short', day: '2-digit', year: 'numeric' }).

Sequence Diagram(s)

sequenceDiagram
  autonumber
  actor User
  participant Sidebar as AppSidebar / NavUser
  participant Handler as handleReportIssue
  Note over Sidebar: Sidebar is a full-height flex column (new `.sidebar`)
  User->>Sidebar: Click "Report Issue" (bottom-anchored button)
  Sidebar->>Handler: invoke handleReportIssue()
  Handler-->>Sidebar: complete (open modal/route)
  Sidebar-->>User: UI response (existing feedback)
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related issues

Poem

A rabbit nudges the sidebar tight,
Stretches column-wise into the night.
The report button hops down low,
Waiting patient, ready to go.
Click, and off the bug-trail flows. 🥕

Pre-merge checks

✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Docstring Coverage ✅ Passed No functions found in the changes. Docstring coverage check skipped.
Title Check ✅ Passed The title clearly and specifically summarizes the two main changes in this PR—moving the "Report Issue" action to the bottom of the sidebar and fixing an invalid date preview on the container listing—which matches the file changes (globals.css, app-sidebar.tsx, nav-user.tsx, and table.tsx); it is a single, descriptive sentence without vague language.

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: 0

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
view/app/globals.css (1)

526-533: Add mobile‑safe viewport units; don’t rename .sidebar without updating call sites

view/app/globals.css declares .sidebar (view/app/globals.css:527–528) and it’s referenced as className="sidebar" in view/components/layout/app-sidebar.tsx:154 — renaming the CSS to .app-sidebar will break that usage.

  • Action: update the existing .sidebar rule to include mobile‑safe fallbacks (keep height:100vh fallback, add height:100dvh and min-height:100svh).
  • If you want a namespaced class, either update all call sites (at least view/components/layout/app-sidebar.tsx:154) or add an alias selector so both work (.sidebar, .app-sidebar { … }) and migrate gradually.
🧹 Nitpick comments (2)
view/components/layout/app-sidebar.tsx (1)

154-175: Align className with the namespaced CSS and avoid generic selectors

If you adopt the CSS change, update the component to use the new class to prevent global selector collisions.

-    <Sidebar className="sidebar" collapsible="icon" {...props}>
+    <Sidebar className="app-sidebar" collapsible="icon" {...props}>
view/components/layout/nav-user.tsx (1)

231-241: Use SidebarMenuItem/SidebarMenuButton for consistency, collapse/tooltip behavior, and focus states

Raw may not integrate with the sidebar’s collapsed mode and a11y. Wrap it in SidebarMenuItem/SidebarMenuButton and add focus-visible styles.

-      {/* Bottom-anchored "Report Issue" action */}
-      <div className="mt-auto p-4">
-        <button
-          onClick={handleReportIssue}
-          className="flex items-center gap-2 text-sm text-sidebar-foreground hover:text-sidebar-accent"
-        >
-          <AlertCircle />
-          {t('user.menu.reportIssue')}
-        </button>
-      </div>
+      {/* Bottom-anchored "Report Issue" action */}
+      <div className="mt-auto p-4">
+        <SidebarMenuItem>
+          <SidebarMenuButton asChild>
+            <button
+              onClick={handleReportIssue}
+              className="flex items-center gap-2 text-sm text-sidebar-foreground hover:text-sidebar-accent focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-sidebar-ring focus-visible:ring-offset-2"
+              aria-label={t('user.menu.reportIssue')}
+              title={t('user.menu.reportIssue')}
+            >
+              <AlertCircle />
+              <span className="truncate">{t('user.menu.reportIssue')}</span>
+            </button>
+          </SidebarMenuButton>
+        </SidebarMenuItem>
+      </div>

Please verify in:

  • collapsed “icon” mode: icon shows and tooltip/title is available
  • mobile: button remains reachable and anchored at bottom

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 6777ca8 and b649d7a.

📒 Files selected for processing (3)
  • view/app/globals.css (1 hunks)
  • view/components/layout/app-sidebar.tsx (1 hunks)
  • view/components/layout/nav-user.tsx (1 hunks)

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: 0

🧹 Nitpick comments (1)
view/app/containers/components/table.tsx (1)

86-89: Locale hardcoding, potential invalid timestamp, and per-row formatter creation

  • Don’t hardcode 'en-US' (breaks i18n); use default locale or app locale.
  • parseInt without radix is brittle; also guard against invalid/empty timestamps to avoid RangeError.
  • New Intl.DateTimeFormat is created per row; memoize once.

Option A (minimal change; within current lines):

-            ? new Intl.DateTimeFormat('en-US', { month: 'short', day: '2-digit', year: 'numeric' }).format(
-             new Date(parseInt(container.created) * 1000)
-                  )
+            ? new Intl.DateTimeFormat(undefined, { month: 'short', day: '2-digit', year: 'numeric' }).format(
+                new Date(parseInt(container.created as string, 10) * 1000)
+              )

Option B (more robust; replaces Lines 85–89):

-      const formattedDate = container.created
-            ? new Intl.DateTimeFormat('en-US', { month: 'short', day: '2-digit', year: 'numeric' }).format(
-             new Date(parseInt(container.created) * 1000)
-                  )
-             : '-';
+      const tsSec = Number(container.created);
+      const formattedDate =
+        Number.isFinite(tsSec)
+          ? dateFormatter.format(new Date(tsSec * 1000))
+          : '-';

Add once near Line 41:

const dateFormatter = React.useMemo(
  () => new Intl.DateTimeFormat(undefined, { month: 'short', day: '2-digit', year: 'numeric' }),
  []
);
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between b649d7a and 263cff8.

📒 Files selected for processing (1)
  • view/app/containers/components/table.tsx (1 hunks)
🔇 Additional comments (1)
view/app/containers/components/table.tsx (1)

86-89: Scope creep: date-format change seems unrelated to “Move Report Issue to sidebar”

Confirm this change belongs in this PR; otherwise split to a separate PR to keep diffs focused and revert here.

@rupanshi01 rupanshi01 changed the title enhancement: Move Report Issue to sidebar (bottom) enhancement: Move Report Issue to sidebar (bottom) & bug: invalid date preview on container listing screen Sep 16, 2025
@zhravan
Copy link
Collaborator

zhravan commented Sep 16, 2025

@rupanshi01: Can you comment on the issues so that I can assign these issues to you?
Thank you so much for your contribution. We will review this PR and let you know!

Could you please add screenshot for reference as well?

Stay around, you will have more issues where you can get involved and contribute!

Join our Discord community for discussions and updates.

Happy learning! 💚

@zhravan zhravan changed the base branch from master to feat/develop September 17, 2025 06:54
Copy link
Owner

@raghavyuva raghavyuva left a comment

Choose a reason for hiding this comment

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

Hey @rupanshi01, your PR needs some tweaks before we can merge it. Also, try to focus on one thing per PR, okay? Your title mentions two things, so maybe split it into two separate PRs?

@@ -523,3 +523,10 @@
scrollbar-width: none;
}
}

/* Ensure the sidebar supports bottom anchoring */
Copy link
Owner

Choose a reason for hiding this comment

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

This is not required, ideally we shouldn't be modifying the global.css file, you can modify the behaviour in sidebar itself

@@ -232,6 +228,17 @@ Add any other context about the problem here.`;
</DropdownMenuContent>
</DropdownMenu>
</SidebarMenuItem>

{/* Bottom-anchored "Report Issue" action */}
<div className="mt-auto p-4">
Copy link
Owner

Choose a reason for hiding this comment

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

Div is not required here, sidebar section remains same but resuse the components to make it bottom aligned and render

@zhravan zhravan deleted the branch raghavyuva:feat/develop September 19, 2025 16:19
@zhravan zhravan closed this Sep 19, 2025
@zhravan zhravan reopened this Sep 19, 2025
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.

3 participants