Files
Book-management-system/.trellis/tasks/04-28-frontend-workbench-display-fix/prd.md
T
2026-04-28 19:26:08 +08:00

55 lines
3.9 KiB
Markdown

# Fix Frontend Workbench Display
## Goal
Make the authenticated workbench reflect real application data and simplify the navigation-heavy UI so it does not duplicate the sidebar.
## What I Already Know
- The user reported that the frontend workbench data does not match actual data.
- The current `dashboard.jsp` hard-codes metric values, popular book ranking rows, borrowing rows, overdue rows, and book rows.
- The workbench shortcut cards for 读者管理, 报表中心, 借阅流通, and 系统日志 duplicate links already present in the sidebar.
- The UI uses circular single-character markers beside text in metrics, shortcut cards, sidebar links, role chips, and topbar user summary.
- The sidebar is fixed on desktop, but responsive CSS changes `.app-sidebar` and `.app-topbar` to static layout under 960px, effectively removing the persistent sidebar behavior.
- Existing report infrastructure already exposes actual inventory summary, borrowing summary, overdue rows, and popular books through `ReportService.loadReportCenter(...)`.
## Assumptions
- "UI text beside an unnecessary circle with one character" applies to decorative single-character icon circles in the authenticated shell and workbench, not to plain text labels or table status pills.
- The workbench should reuse existing server-rendered JSP/Servlet patterns rather than introducing client-side state.
- When a specific real data source does not yet exist, prefer showing an existing real metric over keeping a static fake metric.
## Requirements
- Replace hard-coded workbench summary metrics with real data.
- Replace the hard-coded popular book ranking with real ranking data.
- Replace hard-coded borrowing/overdue/book table samples with real data or remove the fake sample rows in favor of empty states.
- Keep the workbench catalog search category selector populated from real categories.
- Remove the workbench shortcut entry block containing 读者管理, 报表中心, 借阅流通, and 系统日志.
- Remove the decorative circular single-character UI markers around text in the authenticated shell/workbench where they are not functionally necessary.
- Ensure the sidebar cannot be hidden or collapsed by responsive layout rules.
- Keep role-based visibility and permissions intact for administrator, librarian, and reader users.
## Acceptance Criteria
- [ ] Workbench metrics are rendered from request attributes populated by backend services, not hard-coded numbers.
- [ ] Popular ranking and table content no longer contain static sample records such as 张晓明, 活着, 三体, or fixed 2024 dates unless those values come from the database.
- [ ] The workbench no longer shows shortcut cards for 读者管理, 报表中心, 借阅流通, or 系统日志.
- [ ] Decorative single-character circles next to UI text are removed or restyled as plain text/spacing without circular badges.
- [ ] Sidebar remains visible and occupies its sidebar column across responsive breakpoints.
- [ ] Existing navigation links still work and remain role-aware.
- [ ] Project lint/type-check or the closest available Java build/test command passes.
## Out Of Scope
- Adding new major dashboard modules beyond the current workbench content.
- Redesigning unrelated pages outside the shared authenticated shell and workbench.
- Changing database schema unless necessary to replace static workbench data.
## Technical Notes
- Likely files: `src/main/java/com/mzh/library/controller/DashboardServlet.java`, `src/main/webapp/WEB-INF/jsp/dashboard.jsp`, `src/main/webapp/WEB-INF/jsp/common/header.jspf`, and `src/main/webapp/static/css/app.css`.
- Existing actual report data: `ReportServiceImpl`, `JdbcReportDao`, `ReportCenter`, `InventorySummary`, `BorrowingSummary`, `OverdueReportRow`, and `PopularBookReportRow`.
- Existing category/book patterns: `BookServiceImpl`, `JdbcBookDao`, and `BookCatalogServlet`.
- Existing borrowing list pattern: `BorrowingServiceImpl.searchRecords(...)` and `BorrowingManagementServlet`.