Skip to content

Conversation

@amhsirak
Copy link
Member

@amhsirak amhsirak commented Nov 5, 2025

This change makes the navigation bar and side menu sticky, so that they are persistent on the screen, and only the internal content scrolls.

Summary by CodeRabbit

  • Style & UI Improvements

    • API key view: increased spacing and show more characters for readability.
    • Proxy form: reorganized into a clearer two-column responsive layout with improved spacing.
    • Main page & wrapper: sticky sidebar/navbar and scrollable content area for better navigation.
    • Robot configuration & schedule settings: refined spacing, alignment, and consistent layout tokens.
    • Main menu: slightly narrower sidebar for tighter layout.
  • Localization

    • Runs loading message updated to "Extracting data..."

@amhsirak amhsirak marked this pull request as draft November 5, 2025 15:22
@coderabbitai
Copy link

coderabbitai bot commented Nov 5, 2025

Walkthrough

Refactors multiple UI components to use MUI Box-based flex layouts, adjusts spacing and widths (sidebar, API key display, menu), moves the informational Alert into ProxyForm's right panel, tweaks text in locales, and simplifies spacing across robot pages; no exported API or signature changes.

Changes

Cohort / File(s) Change Summary
API Key Display
src/components/api/ApiKey.tsx
Removed top margin on intro Typography; widened monospace key container from 10ch20ch; minor formatting/whitespace cleanup.
Proxy Form Layout
src/components/proxy/ProxyForm.tsx
Replaced fragment/stack layout with a responsive two-column Box flex layout; moved informational Alert into right-side panel; converted many inline styles to MUI sx tokens and consolidated wrappers.
Robot Config
src/components/robot/pages/RobotConfigPage.tsx
Switched container sizing to width: 100%, height: auto, boxSizing: 'border-box'; adjusted margins/spacing and removed several structural comments; minor formatting change.
Main Page & Sidebar
src/pages/MainPage.tsx, src/components/dashboard/MainMenu.tsx
Replaced Stack with Box flex layout; added a sticky left sidebar (MainMenu) ~230px wide (was 250px) and a scrollable right content area; updated MainMenu width to 230px.
Page Wrapper / NavBar
src/pages/PageWrapper.tsx
Added Box wrappers and conditional sticky NavBar rendering (excluded on /recording); moved Routes into a Box with adjusted minHeight to account for sticky header; introduced isAuthPage / isRecordingPage flags.
Schedule Settings
src/components/robot/pages/ScheduleSettingsPage.tsx
Removed unused Schedule icon import; standardized spacing via sx (gap/width), fixed label widths with Typography width, and simplified containers—no behavior changes.
Locale string
public/locales/en.json
Changed runs loading message from "Loading data..." → "Extracting data...".

Sequence Diagram(s)

sequenceDiagram
  autonumber
  actor User
  participant Browser
  participant PageWrapper
  participant NavBar
  participant Routes
  participant MainPage
  participant MainMenu
  participant DisplayContent

  User->>Browser: navigate
  Browser->>PageWrapper: render
  alt not /recording
    PageWrapper->>NavBar: render (sticky)
  end
  PageWrapper->>Routes: render selected route
  Routes->>MainPage: render MainPage route
  MainPage->>MainMenu: render (sticky, 230px)
  MainPage->>DisplayContent: render content (scrollable)
Loading
sequenceDiagram
  autonumber
  actor User
  participant ProxyForm
  participant LeftForm as "Form Column"
  participant RightPanel as "Info/Alert Panel"

  User->>ProxyForm: open form
  ProxyForm->>LeftForm: render form controls (flex column)
  ProxyForm->>RightPanel: render informational Alert (fixed height)
  User->>LeftForm: interact (submit/remove)
  LeftForm-->>ProxyForm: update state
  ProxyForm-->>RightPanel: reflect state changes if needed
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20–30 minutes

  • Review focus:
    • ProxyForm: verify Alert integration, layout responsiveness, and accessibility.
    • PageWrapper/MainPage: sticky NavBar/sidebar behavior across routes (especially /recording) and minHeight adjustments.
    • ApiKey: confirm visual masking/truncation width changes don't affect accessibility or copy behavior.
    • ScheduleSettingsPage: ensure removed icon/import doesn't break builds.

Possibly related PRs

Suggested labels

Type: Feature, Scope: UI/UX

Suggested reviewers

  • RohitR311

Poem

🐰 I hopped through boxes, stretched each row,
moved alerts to the right so sidebars glow.
Keys show wider, menus sit snug and neat,
layouts aligned with a rhythmic beat.
A tiny rabbit cheers—UI looks sweet. 🥕

Pre-merge checks and finishing touches

✅ 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 accurately captures the main objective of the PR, which is restructuring the layout to make navigation elements sticky while content scrolls.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch edit-page

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.

@amhsirak amhsirak marked this pull request as ready for review November 5, 2025 15:40
@amhsirak amhsirak requested a review from RohitR311 November 5, 2025 15:40
Copy link

@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: 2

🧹 Nitpick comments (3)
src/pages/MainPage.tsx (2)

322-332: Consider extracting magic numbers to constants.

The values 64 (navbar height) and 250 (sidebar width) are hardcoded in multiple places throughout this file and others in the PR (e.g., PageWrapper.tsx line 107, MainMenu.tsx line 66). If the navbar height or sidebar width changes, all occurrences need to be updated manually.

Consider extracting these to shared constants:

// In a shared constants file (e.g., src/constants/layout.ts)
export const LAYOUT_CONSTANTS = {
  NAVBAR_HEIGHT: 64,
  SIDEBAR_WIDTH: 250,
} as const;

Then use throughout:

+import { LAYOUT_CONSTANTS } from '../constants/layout';
+
 return (
-  <Box sx={{ display: 'flex', minHeight: 'calc(100vh - 64px)', width: '100%' }}>
+  <Box sx={{ display: 'flex', minHeight: `calc(100vh - ${LAYOUT_CONSTANTS.NAVBAR_HEIGHT}px)`, width: '100%' }}>
     <Box sx={{ 
-      width: 250,
+      width: LAYOUT_CONSTANTS.SIDEBAR_WIDTH,
       flexShrink: 0,
       position: 'sticky',
-      top: 64,
+      top: LAYOUT_CONSTANTS.NAVBAR_HEIGHT,
-      height: 'calc(100vh - 64px)', 
+      height: `calc(100vh - ${LAYOUT_CONSTANTS.NAVBAR_HEIGHT}px)`,

337-343: Redundant width calculation in scrollable content area.

The width: 'calc(100% - 250px)' on line 342 is redundant since flex: 1 on line 338 already makes the content area fill the remaining space. The explicit width calculation adds maintenance overhead (another hardcoded 250px value) without functional benefit.

Consider removing the redundant width property:

     <Box sx={{ 
       flex: 1,
       minWidth: 0, 
       overflow: 'auto',
       minHeight: 'calc(100vh - 64px)',
-      width: 'calc(100% - 250px)' 
     }}>
src/components/proxy/ProxyForm.tsx (1)

159-294: Consider adding responsive behavior for smaller screens.

The two-column layout uses display: 'flex' but lacks flexWrap or responsive breakpoints. On smaller screens, both columns (each with maxWidth: 600) may cause horizontal scrolling rather than stacking vertically.

Consider adding responsive behavior:

     <Box sx={{
         display: 'flex',
+        flexDirection: { xs: 'column', md: 'row' },
         gap: 4,
         p: 5,
         width: '100%',
         maxWidth: '100%',
         boxSizing: 'border-box'
     }}>

This will stack columns vertically on extra-small screens and display them side-by-side on medium+ screens.

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between bf9679e and 75bb63d.

📒 Files selected for processing (5)
  • src/components/api/ApiKey.tsx (3 hunks)
  • src/components/proxy/ProxyForm.tsx (6 hunks)
  • src/components/robot/pages/RobotConfigPage.tsx (3 hunks)
  • src/pages/MainPage.tsx (2 hunks)
  • src/pages/PageWrapper.tsx (2 hunks)
🧰 Additional context used
🧬 Code graph analysis (2)
src/pages/PageWrapper.tsx (5)
src/components/dashboard/NavBar.tsx (1)
  • NavBar (49-597)
src/pages/MainPage.tsx (1)
  • MainPage (36-348)
src/context/browserDimensions.tsx (1)
  • BrowserDimensionsProvider (19-54)
src/pages/RecordingPage.tsx (1)
  • RecordingPage (29-180)
src/components/dashboard/NotFound.tsx (1)
  • NotFoundPage (3-11)
src/pages/MainPage.tsx (1)
src/components/dashboard/MainMenu.tsx (1)
  • MainMenu (16-186)
🔇 Additional comments (2)
src/components/robot/pages/RobotConfigPage.tsx (1)

62-71: Good responsive container improvements.

The changes to make the container responsive are well-executed:

  • width: '100%' allows flexibility
  • maxWidth: 1000 maintains readability on large screens
  • height: 'auto' with minHeight provides flexible sizing
  • boxSizing: 'border-box' ensures predictable dimension calculations

These changes align well with the PR's objective of creating responsive Box-based layouts.

src/components/proxy/ProxyForm.tsx (1)

272-293: Good separation of form and instructions.

Moving the instructions to a dedicated right column improves the layout clarity and user experience. The use of a fixed minHeight ensures the alert maintains visual weight even with varying content.

Comment on lines 94 to 104
{/* Sticky NavBar - only show on non-recording pages */}
{location.pathname !== '/recording' && (
<Box sx={{
position: 'sticky',
top: 0,
zIndex: 1100,
backgroundColor: 'background.paper'
}}>
<NavBar recordingName={recordingName} isRecording={false} />
</Box>
)}
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🔴 Critical

Missing useLocation hook call - this will cause a runtime error.

The code references location.pathname on line 95, but the useLocation hook is never called to obtain the location object. Although useLocation is imported on line 13, it must be invoked to get the location object.

Add the hook call at the beginning of the PageWrapper component:

 export const PageWrapper = () => {
   const [open, setOpen] = useState(false);
   const [isRecordingMode, setIsRecordingMode] = useState(false);
 
+  const location = useLocation();
   const navigate = useNavigate();

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

🤖 Prompt for AI Agents
In src/pages/PageWrapper.tsx around lines 94 to 104, the JSX uses
location.pathname but the useLocation hook is never invoked; call const location
= useLocation() at the top of the PageWrapper component (after imports and
inside the component body) so location is defined before rendering the
conditional NavBar, ensuring the existing import is used and no runtime error
occurs.

Copy link

@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

🧹 Nitpick comments (1)
src/components/robot/pages/RobotConfigPage.tsx (1)

142-166: Consider consistent styling for secondary actions.

The "Back to Selection" button (lines 148-150) uses explicit pink styling, while the Cancel button (line 163) now uses neutral inherit styling. For better visual consistency, secondary actions should typically share the same styling treatment, with only the primary action (Save) being prominent.

Consider applying neutral styling to the "Back to Selection" button as well:

             <Button
               variant="outlined"
               onClick={onBackToSelection}
               disabled={isLoading}
-              sx={{
-                color: '#ff00c3 !important',
-                borderColor: '#ff00c3 !important',
-                backgroundColor: 'white !important',
-              }} >
+            >
               {backToSelectionText || t("buttons.back_arrow")}
             </Button>
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 5b5aa0d and 5a18f61.

📒 Files selected for processing (7)
  • public/locales/en.json (1 hunks)
  • src/components/api/ApiKey.tsx (4 hunks)
  • src/components/dashboard/MainMenu.tsx (1 hunks)
  • src/components/robot/pages/RobotConfigPage.tsx (4 hunks)
  • src/components/robot/pages/ScheduleSettingsPage.tsx (9 hunks)
  • src/pages/MainPage.tsx (2 hunks)
  • src/pages/PageWrapper.tsx (2 hunks)
🚧 Files skipped from review as they are similar to previous changes (3)
  • src/pages/MainPage.tsx
  • src/components/api/ApiKey.tsx
  • src/pages/PageWrapper.tsx
🔇 Additional comments (5)
src/components/dashboard/MainMenu.tsx (1)

75-75: LGTM! Width adjustment aligns with the layout revamp.

The width reduction from 250px to 230px complements the sticky sidebar layout introduced in the broader PR changes.

public/locales/en.json (1)

583-583: Good improvement to user-facing text.

"Extracting data..." is more specific and descriptive than "Loading data...", providing clearer feedback to users about what's happening.

src/components/robot/pages/ScheduleSettingsPage.tsx (2)

190-191: LGTM! Cleaner spacing approach.

Using gap: 3 instead of individual margins provides consistent spacing and is more maintainable. The explicit width: "100%" ensures proper container sizing.


233-346: Excellent consistency improvements.

The standardized label styling (width: "200px", flexShrink: 0) across all form rows ensures consistent visual alignment. The use of nested Box components with gap for grouping related inputs (like the time range fields) is a clean, modern approach that improves readability and maintainability.

src/components/robot/pages/RobotConfigPage.tsx (1)

67-69: LGTM! Layout changes support flexible, responsive behavior.

The addition of width: '100%', height: 'auto', and boxSizing: 'border-box' appropriately supports the flexible layout needed for the sticky navigation implementation.

Comment on lines +124 to +125
mt: 1.8,
mb: 5,
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

Consider using standard MUI spacing values.

The mt: 1.8 value is unusual and deviates from typical Material-UI spacing patterns (which use whole numbers or standard fractions like 0.5, 1.5, 2, etc.). Consider using mt: 2 or mt: 1.5 for consistency with MUI design tokens.

-        mt: 1.8,
+        mt: 2,
📝 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
mt: 1.8,
mb: 5,
mt: 2,
mb: 5,
🤖 Prompt for AI Agents
In src/components/robot/pages/RobotConfigPage.tsx around lines 124 to 125, the
styling uses a nonstandard mt: 1.8 which deviates from Material-UI spacing
tokens; change it to a standard MUI spacing value (for example mt: 1.5 or mt: 2)
to align with design tokens and consistency across the app.

@amhsirak amhsirak removed the request for review from RohitR311 November 5, 2025 17:48
@amhsirak amhsirak merged commit 674ce9a into develop Nov 5, 2025
1 check passed
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