Repository navigation
Add Restocking tab and redesign UI with sidebar navigation - #2
Merged
Merged
Conversation
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>
There was a problem hiding this comment.
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 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 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> |
| <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 on lines
+74
to
+76
| <FilterBar /> | ||
| <main class="main-content"> | ||
| <router-view /> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
RST-YYYY-NNNNorders with 14-day lead timeChanges
server/main.py—GET /api/restocking/recommendationsandPOST /api/ordersendpointsserver/data/inventory.json— Added 3 SKU rows (WDG-001, FLT-405, GSK-203) to enable demand forecast cost joinclient/src/views/Restocking.vue— New view with budget slider and recommendations tableclient/src/views/Orders.vue— Submitted Restocking Orders section separated from customer ordersclient/src/api.js—getRestockingRecommendations()andcreateRestockingOrder()client/src/main.js—/restockingroute addedclient/src/App.vue— Sidebar layout replacing top navclient/src/components/ProfileMenu.vue— Dropdown opens upward/rightwardclient/src/components/LanguageSwitcher.vue— Dropdown opens upward/rightwardTest plan
🤖 Generated with Claude Code