Skip to content

Conversation

@Yasir761
Copy link

@Yasir761 Yasir761 commented Oct 7, 2025

This PR is related to issue #458
Enhance the UI as suggested by the issue and remove the Detail component entirely.

Summary by CodeRabbit

  • New Features

    • Added a Container Metadata card in Overview showing status, created time, ID, image, command, ports, and mounts with clear badges and formatting.
  • Refactor

    • Removed the Details tab and its loading state; relevant information is now surfaced in the Overview.
    • Simplified the tab layout (reduced columns) for a cleaner UI.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Oct 7, 2025

Walkthrough

Removes the Details tab and its component from the container view, adjusts tab layout, introduces a new ContainerMetadataCard used in the Overview tab, and extends the Container interface with labels and mounts to support the new metadata display.

Changes

Cohort / File(s) Summary of changes
Details tab removal
view/app/containers/[id]/components/ContainerDetailsLoading.tsx, view/app/containers/[id]/components/DetailsTab.tsx, view/app/containers/[id]/page.tsx
Removed DetailsTab component and its usage. Commented out Details tab trigger/content. Adjusted Tabs grid from 5 to 4 columns. Cleaned loading UI to exclude Details skeleton.
Overview enhancement
view/app/containers/[id]/components/OverviewTab.tsx
Imported and rendered ContainerMetadataCard within the Overview layout using responsive grid placement.
New metadata card component
view/app/containers/[id]/components/ContainerMetadataCard.tsx
Added exported component rendering container status, created time, ID, image, command, ports, and mounts using Card/Badge UI and date-fns.
API type extension
view/redux/services/container/containerApi.ts
Extended Container interface with labels: any and mounts: any. No endpoint changes.

Sequence Diagram(s)

sequenceDiagram
  autonumber
  actor User
  participant Page as Container Page
  participant API as containerApi
  participant Overview as OverviewTab
  participant Card as ContainerMetadataCard

  User->>Page: Open container view
  Page->>API: Fetch container data
  API-->>Page: Container { status, id, image, command, labels, mounts, ports, createdAt, ... }
  Page->>Overview: Render Overview tab
  Overview->>Card: Pass container props
  Card-->>Overview: Render metadata (status, times, ports, mounts)
  Overview-->>User: Display updated Overview (no Details tab)
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

Suggested labels

nixopus-view

Suggested reviewers

  • raghavyuva
  • zhravan

Poem

I hop through tabs—one fewer to see,
Details burrowed, Overview’s the key.
Labels and mounts, I nibble with glee,
Ports like carrots, lined neatly for me.
New card shines bright—metadata art,
Thump-thump! This change is smart. 🥕

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title Check ✅ Passed The title clearly and concisely summarizes the main changes by referencing the updated container metadata card UI and overview tab enhancements, which align with the core modifications introduced in this PR.
✨ 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: 5

🧹 Nitpick comments (2)
view/app/containers/[id]/components/ContainerDetailsLoading.tsx (1)

17-17: Optional whitespace cleanup.

These empty lines appear to be leftover formatting from the Details tab removal. Consider removing them for consistency.

Apply this diff to clean up whitespace:

         <TabsList>
           <TabsTrigger value="overview">Overview</TabsTrigger>
           <TabsTrigger value="logs">Logs</TabsTrigger>
-         
         </TabsList>
         </TabsContent>
-        
       </Tabs>

Also applies to: 65-65

view/app/containers/[id]/components/ContainerMetadataCard.tsx (1)

12-85: Consider i18n for user-facing labels.

The component uses hardcoded English labels ("Status", "Created", "Container ID", etc.) while other parts of the codebase use the useTranslation hook for i18n support (see OverviewTab.tsx). Consider internationalizing these labels for consistency.

Example pattern from OverviewTab:

import { useTranslation } from '@/hooks/use-translation';

export function ContainerMetadataCard({ container }: ContainerMetadataCardProps) {
  const { t } = useTranslation();
  
  return (
    // ...
    <span className="text-sm text-muted-foreground font-medium">
      {t('containers.status')}
    </span>
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 57e3ff8 and d5a45da.

📒 Files selected for processing (6)
  • view/app/containers/[id]/components/ContainerDetailsLoading.tsx (2 hunks)
  • view/app/containers/[id]/components/ContainerMetadataCard.tsx (1 hunks)
  • view/app/containers/[id]/components/DetailsTab.tsx (0 hunks)
  • view/app/containers/[id]/components/OverviewTab.tsx (2 hunks)
  • view/app/containers/[id]/page.tsx (3 hunks)
  • view/redux/services/container/containerApi.ts (1 hunks)
💤 Files with no reviewable changes (1)
  • view/app/containers/[id]/components/DetailsTab.tsx
🧰 Additional context used
🧬 Code graph analysis (3)
view/app/containers/[id]/components/OverviewTab.tsx (1)
view/app/containers/[id]/components/ContainerMetadataCard.tsx (1)
  • ContainerMetadataCard (12-85)
view/app/containers/[id]/components/ContainerMetadataCard.tsx (1)
view/redux/services/container/containerApi.ts (1)
  • Container (5-26)
view/app/containers/[id]/page.tsx (2)
view/app/containers/[id]/components/OverviewTab.tsx (1)
  • OverviewTab (13-108)
view/app/containers/[id]/components/LogsTab.tsx (1)
  • LogsTab (13-31)
🔇 Additional comments (2)
view/app/containers/[id]/components/OverviewTab.tsx (1)

7-7: LGTM!

The ContainerMetadataCard is properly imported and integrated into the Overview tab with appropriate responsive grid layout (col-span-1 md:col-span-2). The placement below existing cards provides a logical flow for the enhanced metadata display.

Also applies to: 101-104

view/app/containers/[id]/page.tsx (1)

173-173: LGTM!

Correctly adjusted grid columns from 5 to 4 after removing the Details tab.

<Card className="w-full rounded-lg shadow-md border border-gray-200">
<CardHeader>
<CardTitle className="flex items-center gap-2 text-lg">
<Info className="h-5 w-5" /> Label
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 | 🟡 Minor

Misleading card title.

The card title "Label" doesn't accurately describe the content, which shows comprehensive container metadata including status, creation time, IDs, ports, and mounts. Consider using "Metadata" or "Container Details" instead.

Apply this diff:

       <CardHeader>
         <CardTitle className="flex items-center gap-2 text-lg">
-          <Info className="h-5 w-5" /> Label
+          <Info className="h-5 w-5" /> Container Metadata
         </CardTitle>
       </CardHeader>
📝 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
<Info className="h-5 w-5" /> Label
<CardHeader>
<CardTitle className="flex items-center gap-2 text-lg">
<Info className="h-5 w-5" /> Container Metadata
</CardTitle>
</CardHeader>
🤖 Prompt for AI Agents
In view/app/containers/[id]/components/ContainerMetadataCard.tsx around line 17,
the visible card title text currently reads "Label" which is misleading for a
card that displays full container metadata; change that text to a clearer title
such as "Container Details" (or "Metadata") by replacing the "Label" text node
with "Container Details", and if present update any accessibility attributes
(aria-label/title) or i18n keys to match the new label so the UI and assistive
tech reflect the corrected title.

Comment on lines +75 to +77
{container.mounts.map((mount: { source: string | number | bigint | boolean | React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | Iterable<React.ReactNode> | React.ReactPortal | Promise<string | number | bigint | boolean | React.ReactPortal | React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | Iterable<React.ReactNode> | null | undefined> | null | undefined; destination: string | number | bigint | boolean | React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | Iterable<React.ReactNode> | React.ReactPortal | Promise<string | number | bigint | boolean | React.ReactPortal | React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | Iterable<React.ReactNode> | null | undefined> | null | undefined; }, idx: React.Key | null | undefined) => (
<li key={idx}>{mount.source}{mount.destination}</li>
))}
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

Replace verbose inline type with proper interface.

The inline type annotation for mounts is extremely verbose and unreadable. This should use the properly typed ContainerMount interface from the Container API definition (once fixed per the comment on containerApi.ts).

After fixing the types in containerApi.ts, this code will automatically benefit from proper typing:

-              {container.mounts.map((mount: { source: string | number | bigint | boolean | React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | Iterable<React.ReactNode> | React.ReactPortal | Promise<string | number | bigint | boolean | React.ReactPortal | React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | Iterable<React.ReactNode> | null | undefined> | null | undefined; destination: string | number | bigint | boolean | React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | Iterable<React.ReactNode> | React.ReactPortal | Promise<string | number | bigint | boolean | React.ReactPortal | React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | Iterable<React.ReactNode> | null | undefined> | null | undefined; }, idx: React.Key | null | undefined) => (
+              {container.mounts.map((mount, idx) => (
                 <li key={idx}>{mount.source} → {mount.destination}</li>
📝 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
{container.mounts.map((mount: { source: string | number | bigint | boolean | React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | Iterable<React.ReactNode> | React.ReactPortal | Promise<string | number | bigint | boolean | React.ReactPortal | React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | Iterable<React.ReactNode> | null | undefined> | null | undefined; destination: string | number | bigint | boolean | React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | Iterable<React.ReactNode> | React.ReactPortal | Promise<string | number | bigint | boolean | React.ReactPortal | React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | Iterable<React.ReactNode> | null | undefined> | null | undefined; }, idx: React.Key | null | undefined) => (
<li key={idx}>{mount.source}{mount.destination}</li>
))}
{container.mounts.map((mount, idx) => (
<li key={idx}>{mount.source}{mount.destination}</li>
))}
🤖 Prompt for AI Agents
In view/app/containers/[id]/components/ContainerMetadataCard.tsx around lines
75-77, replace the extremely verbose inline mount type in the map callback with
the proper ContainerMount interface: remove the inline type annotation on the
map parameter, import (or reference) the ContainerMount type from the Container
API types, and rely on container.mounts being typed as ContainerMount[] (fix
containerApi.ts first if needed); ensure the map callback signature is simply
(mount, idx) => (...) and add the ContainerMount import at the top of the file
so IDE/typechecker picks up the correct types.

import { OverviewTab } from './components/OverviewTab';
import { LogsTab } from './components/LogsTab';
import { DetailsTab } from './components/DetailsTab';
// import { DetailsTab } from './components/DetailsTab';
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 | 🟠 Major

Remove commented import.

Commented-out code should be deleted rather than kept in the codebase. The Details tab has been removed per PR objectives, so this import is no longer needed.

Apply this diff:

 import { LogsTab } from './components/LogsTab';
-// import { DetailsTab } from './components/DetailsTab';
 import { Terminal as TerminalComponent } from './components/Terminal';
📝 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
// import { DetailsTab } from './components/DetailsTab';
import { LogsTab } from './components/LogsTab';
import { Terminal as TerminalComponent } from './components/Terminal';
🤖 Prompt for AI Agents
In view/app/containers/[id]/page.tsx around line 28, remove the commented-out
import line "// import { DetailsTab } from './components/DetailsTab';" — delete
the commented code so the file no longer contains the unused commented import
(the Details tab was removed and the import is obsolete).

Comment on lines +190 to +193
{/* <TabsTrigger value="details">
<HardDrive className="mr-2 h-4 w-4" />
{t('containers.details')}
</TabsTrigger>
</TabsTrigger> */}
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 | 🟠 Major

Remove commented tab trigger and content.

Dead code should be removed, not commented out. Version control preserves the history if needed.

Apply this diff:

                 <TabsTrigger value="logs">
                   <Terminal className="mr-2 h-4 w-4" />
                   {t('containers.logs')}
                 </TabsTrigger>
-                {/* <TabsTrigger value="details">
-                  <HardDrive className="mr-2 h-4 w-4" />
-                  {t('containers.details')}
-                </TabsTrigger> */}
               </TabsList>
               </TabsContent>
-              {/* <TabsContent value="details" className="mt-4"> */}
-                {/* <DetailsTab container={container} /> */}
-              {/* </TabsContent> */}
               <TabsContent value="terminal" className="mt-4">

Also applies to: 201-203

🤖 Prompt for AI Agents
In view/app/containers/[id]/page.tsx around lines 190-193 (and also apply the
same change at 201-203), there are commented-out TabsTrigger and its related
content blocks that constitute dead code; remove these commented JSX lines
entirely rather than leaving them commented so the file contains only active
code and no commented tab trigger/content. Ensure you delete the commented
block(s) and adjust surrounding whitespace/indentation so the remaining JSX
remains valid and compiles.

Comment on lines +6 to +7
labels: any;
mounts: any;
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

Replace any types with proper TypeScript interfaces.

Using any for labels and mounts eliminates type safety and can lead to runtime errors. Based on how these fields are consumed in ContainerMetadataCard (lines 75-77), proper types should be defined.

Apply this diff to add proper type definitions:

+export interface ContainerMount {
+  source: string;
+  destination: string;
+  mode?: string;
+  rw?: boolean;
+  propagation?: string;
+}
+
 export interface Container {
-  labels: any;
-  mounts: any;
+  labels: Record<string, string>;
+  mounts: ContainerMount[];
   id: string;
📝 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
labels: any;
mounts: any;
export interface ContainerMount {
source: string;
destination: string;
mode?: string;
rw?: boolean;
propagation?: string;
}
export interface Container {
labels: Record<string, string>;
mounts: ContainerMount[];
id: string;
}
🤖 Prompt for AI Agents
In view/redux/services/container/containerApi.ts around lines 6-7, the
properties labels and mounts are typed as any; replace them with concrete
TypeScript types used by ContainerMetadataCard (lines 75-77). Define labels as
Record<string, string> (or a specific interface if keys are known) and define
mounts as an array of a Mount interface (e.g., { Type: string; Source?: string;
Destination?: string; [key: string]: any } or the exact fields consumed). Add
these type/interface declarations in this file (or a shared types file), update
the container metadata interface to use labels: Record<string,string> and
mounts: Mount[], and adjust any callers if necessary to match the new types.

@raghavyuva
Copy link
Owner

@Yasir761 can you provide a screenshot or screenrecording of the working solution, and kindly address the corerabbitai review's if they are relavant before getting reviewed by one of us,

thanks!

@Yasir761
Copy link
Author

Yasir761 commented Oct 7, 2025

@Yasir761 can you provide a screenshot or screenrecording of the working solution, and kindly address the corerabbitai review's if they are relavant before getting reviewed by one of us,

thanks!

I attached the screenshot to the new PR

@raghavyuva
Copy link
Owner

closing this as a duplicate of #468

@raghavyuva raghavyuva closed this Oct 7, 2025
@zhravan zhravan reopened this Oct 16, 2025
@zhravan zhravan closed this Oct 16, 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