Skip to content

Add Restocking tab and redesign UI with sidebar navigation - #2

Merged
stephen-masters merged 2 commits into
mainfrom
new_features
Jul 20, 2026
Merged

stephen-masters merged 2 commits into
mainfrom
new_features

Conversation

@stephen-masters

Copy link
Copy Markdown

Summary

  • Restocking tab: Budget slider ($1K–$100K), demand-driven recommendations with greedy budget allocation, place order flow that creates RST-YYYY-NNNN orders with 14-day lead time
  • Sidebar redesign: Replaced top nav bar with a fixed 240px dark sidebar (slate-900, indigo accent); collapsible to 64px with a floating toggle button that remains clickable when collapsed
  • Dropdown fixes: ProfileMenu and LanguageSwitcher now open upward and rightward from the sidebar footer, preventing viewport clipping

Changes

  • server/main.py — GET /api/restocking/recommendations and POST /api/orders endpoints
  • server/data/inventory.json — Added 3 SKU rows (WDG-001, FLT-405, GSK-203) to enable demand forecast cost join
  • client/src/views/Restocking.vue — New view with budget slider and recommendations table
  • client/src/views/Orders.vue — Submitted Restocking Orders section separated from customer orders
  • client/src/api.js — getRestockingRecommendations() and createRestockingOrder()
  • client/src/main.js — /restocking route added
  • client/src/App.vue — Sidebar layout replacing top nav
  • client/src/components/ProfileMenu.vue — Dropdown opens upward/rightward
  • client/src/components/LanguageSwitcher.vue — Dropdown opens upward/rightward

Test plan

  • Navigate all 7 sidebar tabs — each page loads correctly
  • Collapse sidebar — toggle button remains visible and re-expands
  • Open ProfileMenu and LanguageSwitcher — dropdowns visible in both expanded and collapsed states
  • Restocking: adjust slider — selected items and totals update reactively
  • Restocking: place order — success banner shows order number, order appears in Orders tab under Submitted Restocking Orders

🤖 Generated with Claude Code

stephen-masters and others added 2 commits July 20, 2026 10:45
Adds a new /restocking route with a $1K–$100K budget slider that recommends
items to restock based on increasing demand forecasts. A greedy algorithm
selects items by demand gap until the budget is exhausted. Placing an order
submits it to POST /api/orders with a fixed 14-day lead time, and the
submitted order appears in a new "Submitted Restocking Orders" section in the
Orders tab.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Replace top nav bar with fixed 240px dark sidebar (slate-900) with indigo accent
- Add collapsible sidebar with floating toggle button (always visible when collapsed)
- Fix ProfileMenu and LanguageSwitcher dropdowns to open upward and rightward when anchored to sidebar footer (avoids viewport clipping)
- Add responsive collapse at <1024px viewport width

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings July 20, 2026 10:30
@stephen-masters
stephen-masters merged commit b7d299f into main Jul 20, 2026
2 checks passed

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Adds a new Restocking workflow to the existing inventory management demo and updates the frontend layout to use a fixed, collapsible sidebar navigation instead of the prior top nav. The change set spans new backend endpoints + data needed for recommendations, a new Restocking view, and UI adjustments to make sidebar footer dropdowns usable near the viewport edge.

Changes:

  • Added backend support for restocking recommendations and creating restocking orders, plus inventory data for cost joins.
  • Introduced a new Restocking view (budget slider, greedy selection, order placement) and updated Orders to display submitted restocking orders separately.
  • Replaced the top navigation layout with a fixed/collapsible sidebar and adjusted sidebar-footer dropdown positioning.

Reviewed changes

Copilot reviewed 9 out of 9 changed files in this pull request and generated 14 comments.

Show a summary per file
File Description
server/main.py Adds restocking recommendations endpoint and a POST order-creation path for restocking orders.
server/data/inventory.json Adds SKUs needed to join demand forecasts to unit cost for recommendations.
client/src/views/Restocking.vue New Restocking page with budget-based selection and “Place Order” flow.
client/src/views/Orders.vue Splits display of submitted restocking orders from customer orders and renders a new section/table.
client/src/main.js Registers the /restocking route.
client/src/components/ProfileMenu.vue Changes dropdown positioning to open upward from the sidebar footer.
client/src/components/LanguageSwitcher.vue Changes dropdown positioning to open upward from the sidebar footer.
client/src/App.vue Implements the sidebar layout + collapse behavior and embeds the existing FilterBar in the new layout.
client/src/api.js Adds API methods for restocking recommendations and restocking order creation.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread server/main.py
Comment on lines +175 to +180
def create_restocking_order(request: CreateRestockingOrderRequest):
"""Create a restocking order from demand-driven recommendations"""
next_id = str(len(orders) + 1)
next_num = str(len(orders) + 1).zfill(4)
order_number = f"RST-{datetime.now().year}-{next_num}"
today = datetime.now()
Comment thread server/main.py
Comment on lines +174 to +175
@app.post("/api/orders", response_model=Order, status_code=201)
def create_restocking_order(request: CreateRestockingOrderRequest):
Comment on lines +102 to +105
const loading = ref(true)
const error = ref(null)
const submitting = ref(false)
const orderSuccess = ref(false)
Comment on lines +148 to +150
submitting.value = true
orderSuccess.value = false
const items = selectedItems.value.map(item => ({
Comment on lines +159 to +161
} catch (err) {
error.value = 'Failed to place order: ' + err.message
} finally {
Comment on lines +106 to +107
<span class="item-name">{{ item.name }}</span>
<span class="item-meta">Qty: {{ item.quantity }} @ ${{ item.unit_price }}</span>
Comment on lines +86 to +92
<th class="col-order-number">Order #</th>
<th class="col-customer">Type</th>
<th class="col-items">Items</th>
<th class="col-status">Status</th>
<th class="col-date">Order Date</th>
<th class="col-date">Expected Delivery</th>
<th class="col-value">Total Value</th>

<div v-if="submittedOrders.length > 0" class="card submitted-orders-card">
<div class="card-header">
<h3 class="card-title">Submitted Restocking Orders ({{ submittedOrders.length }})</h3>
Comment thread client/src/App.vue
<h1>{{ t('nav.companyName') }}</h1>
<span class="subtitle">{{ t('nav.subtitle') }}</span>
<aside class="sidebar" :class="{ collapsed: collapsed }">
<button class="sidebar-toggle" @click="toggleSidebar" :title="collapsed ? 'Expand sidebar' : 'Collapse sidebar'">
Comment thread client/src/App.vue
Comment on lines +74 to +76
<FilterBar />
<main class="main-content">
<router-view />
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