UI: Implement Maximize mode for tables. Added a 'MAXIMIZE' button to TopBar and an 'X' close button in fullscreen mode. Hides sidebar and header to provide maximum screen space for data tables.

This commit is contained in:
Christian Vidal Wolf
2026-04-22 20:38:06 +02:00
parent bf98e4e4ba
commit b5ea911e43
5 changed files with 342 additions and 24 deletions
@@ -0,0 +1,171 @@
# Maximize Tab View — Implementation Plan
> **For agentic workers:** REQUIRED SUB-SKILL: Use superpowers:subagent-driven-development (recommended) or superpowers:executing-plans to implement this plan task-by-task.
**Goal:** Add fullscreen maximize mode to each tab view, hiding Sidebar and TopBar for maximum data visibility.
**Architecture:** Each view component manages its own `isFullscreen` state locally. No global state. Toggle between normal and fullscreen modes with conditional rendering.
**Tech Stack:** React useState, lucide-react icons, Tailwind CSS
---
### Task 1: ProductDescriptions.tsx
**Files:**
- Modify: `src/components/ProductDescriptions.tsx`
- [ ] **Step 1: Add imports and state**
Add `Maximize2` to lucide-react imports.
Add `useState` if not present.
```tsx
const [isFullscreen, setIsFullscreen] = useState(false);
```
- [ ] **Step 2: Add maximize button**
Find the component's header section (where stats/controls are rendered).
Add maximize button with `Maximize2` icon next to existing controls.
```tsx
<button
onClick={() => setIsFullscreen(true)}
className="p-2 text-slate-400 hover:text-slate-200 hover:bg-slate-700 rounded transition-colors"
title="Fullscreen"
>
<Maximize2 className="w-5 h-5" />
</button>
```
- [ ] **Step 3: Wrap content in conditional render**
After existing return statement, wrap in:
```tsx
return (
<>
{isFullscreen ? (
<div className="fixed inset-0 z-40 bg-[#041021] p-6 overflow-auto">
<button
onClick={() => setIsFullscreen(false)}
className="fixed top-4 right-4 z-50 w-10 h-10 flex items-center justify-center bg-slate-800/90 backdrop-blur border border-slate-600 text-white rounded hover:bg-slate-700 hover:scale-105 transition-all"
title="Exit fullscreen"
>
<X className="w-5 h-5" />
</button>
{/* Existing JSX content - remove any overflow constraints */}
<div className="[content goes here]" />
</div>
) : (
<div className="...">
{/* Existing JSX content - keep current overflow settings */}
<div className="[content goes here]" />
</div>
)}
</>
);
```
---
### Task 2: MatrixView.tsx
**Files:**
- Modify: `src/components/MatrixView.tsx`
- [ ] **Step 1: Add imports and state**
Add `Maximize2`, `X` to lucide-react imports.
Add `useState` if not present.
- [ ] **Step 2: Add maximize button**
Add button in the header area (search bar section).
- [ ] **Step 3: Add conditional render**
Same pattern as Task 1.
---
### Task 3: DimensionsView.tsx
**Files:**
- Modify: `src/components/DimensionsView.tsx`
- [ ] **Step 1: Add imports and state**
- [ ] **Step 2: Add maximize button**
- [ ] **Step 3: Add conditional render**
---
### Task 4: PricingView.tsx
**Files:**
- Modify: `src/components/PricingView.tsx`
- [ ] **Step 1: Add imports and state**
- [ ] **Step 2: Add maximize button**
- [ ] **Step 3: Add conditional render**
---
### Task 5: ArticleDetails.tsx
**Files:**
- Modify: `src/components/ArticleDetails.tsx`
- [ ] **Step 1: Add imports and state**
- [ ] **Step 2: Add maximize button**
- [ ] **Step 3: Add conditional render**
---
### Task 6: PendingValidationView.tsx
**Files:**
- Modify: `src/components/PendingValidationView.tsx`
- [ ] **Step 1: Add imports and state**
- [ ] **Step 2: Add maximize button**
- [ ] **Step 3: Add conditional render**
---
### Task 7: MissingDataView.tsx
**Files:**
- Modify: `src/components/MissingDataView.tsx`
- [ ] **Step 1: Add imports and state**
- [ ] **Step 2: Add maximize button**
- [ ] **Step 3: Add conditional render**
---
### Task 8: HistoryView.tsx
**Files:**
- Modify: `src/components/HistoryView.tsx`
- [ ] **Step 1: Add imports and state**
- [ ] **Step 2: Add maximize button**
- [ ] **Step 3: Add conditional render**
---
**Verification:** Run `npm run lint` to ensure no TypeScript errors.
@@ -0,0 +1,112 @@
# Maximize Tab View — Spec
## Concept & Vision
Each tab view (Matrix, Product Descriptions, Dimensions, etc.) can be maximized to fullscreen mode, hiding all navigation chrome (Sidebar, TopBar) to maximize data visibility. A floating close button allows returning to normal view. The effect is immersive and focused — like pressing F11 in a browser.
## Design
### Normal Mode
- Sidebar (240px) visible on left
- TopBar visible on top
- Main content fills remaining space
### Maximized Mode
- Sidebar: `display: none`
- TopBar: `display: none`
- Fullscreen overlay covers entire viewport
- Background: `#041021` (matches main content bg)
- Content area: max-height `100vh`, overflow scroll
- Floating close button: top-right corner, fixed position
### Close Button
- Position: fixed, top-right
- Size: 40x40px
- Background: `rgba(30, 41, 59, 0.9)` with blur
- Border: 1px `slate-600`
- Icon: `X` from lucide-react, white, 20px
- Hover: bg `slate-700`, scale 1.05
- Z-index: 50
- Tooltip: "Exit fullscreen"
## Layout & Structure
### Implementation Pattern
Each view component receives `isFullscreen?: boolean` prop and renders:
```
{maximizeButton && (
<button onClick={toggleFullscreen} className="..." title="Fullscreen">
<Maximize2 />
</button>
)}
{isFullscreen ? (
<div className="fixed inset-0 z-40 bg-[#041021] p-6 overflow-auto">
<button onClick={toggleFullscreen} className="fixed top-4 right-4 ...">
<X />
</button>
{/* Tab content rendered at full height */}
</div>
) : (
<div className="...">
{/* Tab content normal */}
</div>
)}
```
### State Management
- Each tab manages its own `isFullscreen` state locally
- No global state needed — each tab remembers its own fullscreen mode
- State resets to normal when switching tabs (intentional)
## Features & Interactions
### Toggle Button
- Location: Each tab view has a maximize button (icon) in its header area
- Icon: `Maximize2` from lucide-react
- Click: Enter fullscreen mode
- Hover: Slight scale increase, cursor pointer
### Exit Fullscreen
- Click floating X button
- Instantly returns to normal layout
- No animation needed
## Component Inventory
### MaximizeButton (in each tab header)
- States: default, hover
- Color: `slate-400` default, `slate-200` hover
### FullscreenCloseButton (floating)
- States: default, hover, active
- Default: semi-transparent dark bg, subtle border
- Hover: lighter bg, slight scale
- Z-index ensures it's above all content
### FullscreenOverlay
- Fixed positioning
- Matches app background color
- Contains scrollable content
## Technical Approach
- Add `isFullscreen` state to each view component
- Add toggle function
- Conditional rendering based on state
- Icons from `lucide-react`: `Maximize2`, `X`
- All styling via Tailwind classes
- No additional dependencies
## Affected Components
1. `ProductDescriptions.tsx`
2. `MatrixView.tsx`
3. `DimensionsView.tsx`
4. `PricingView.tsx`
5. `ArticleDetails.tsx`
6. `PendingValidationView.tsx`
7. `MissingDataView.tsx`
8. `HistoryView.tsx`