The desktop pages for AI问答, AI写作, 安全培训, 隐患提示, and 考试工坊 should share one left-side navigation sidebar. The AI写作, 安全培训, and 考试工坊 sidebar buttons must mirror the existing mode buttons below the Chat input, not route to the standalone legacy pages.
Use option 1: extend shudao-vue-frontend/src/components/Sidebar.vue.
This keeps the change centralized. The existing pages already import and render <Sidebar />, so updating the shared component adds the navigation buttons consistently. Chat.vue passes its current mode into the sidebar and handles sidebar mode selections with the same setMode() function used by the input-area buttons.
The sidebar will expose these route buttons:
| Label | Behavior | Route fallback |
|---|---|---|
| AI问答 | Chat mode ai-qa when already on Chat |
/chat |
| 隐患提示 | Route to the independent 隐患提示 page | /hazard-detection |
| AI写作 | Chat mode ai-writing when already on Chat |
/chat?mode=ai-writing |
| 安全培训 | Chat mode safety-training when already on Chat |
/chat?mode=safety-training |
| 考试工坊 | Chat mode exam-workshop when already on Chat |
/chat?mode=exam-workshop |
All target routes and Chat mode-query initialization already exist, so no router-table changes are required.
Sidebar.vue will become data-driven:
navItems array containing label, route name, legacy path, icon, optional Chat mode, and route fallback target.v-for.select-mode instead of routing.router.push(item.target)./.This avoids duplicated template blocks and keeps the sidebar behavior aligned with the existing Chat mode chips.
The sidebar will keep the existing desktop layout:
The user referenced an image for button style, but the image is not available in the current conversation context. Implementation will therefore match the existing Sidebar.vue visual language. If the image is provided later, the visual tokens can be adjusted without changing the routing logic.
These existing desktop pages should receive the updated sidebar automatically because they already render <Sidebar />:
shudao-vue-frontend/src/views/Chat.vueshudao-vue-frontend/src/views/AIWriting.vueshudao-vue-frontend/src/views/SafetyHazard.vueshudao-vue-frontend/src/views/HazardDetection.vueshudao-vue-frontend/src/views/ExamWorkshop.vueMobile navigation is out of scope because mobile already has separate tab and drawer components.
Implementation should be verified with:
/chat, /ai-writing, /safety-hazard, /hazard-detection, and /exam-workshop.