This commit is contained in:
Zzzz
2026-04-28 20:57:31 +08:00
parent e8c46311b9
commit acbd873fbc
15 changed files with 200 additions and 15 deletions
@@ -0,0 +1,2 @@
{"_example": "Fill with {\"file\": \"<path>\", \"reason\": \"<why>\"}. Put spec/research files only — no code paths. Run `python3 .trellis/scripts/get_context.py --mode packages` to list available specs. Delete this line once real entries are added."}
{"file": ".trellis/spec/frontend/index.md", "reason": "Frontend JSP/CSS context for verifying the refreshed preview"}
@@ -0,0 +1,2 @@
{"_example": "Fill with {\"file\": \"<path>\", \"reason\": \"<why>\"}. Put spec/research files only — no code paths. Run `python3 .trellis/scripts/get_context.py --mode packages` to list available specs. Delete this line once real entries are added."}
{"file": ".trellis/spec/frontend/index.md", "reason": "Frontend JSP/CSS context for preview verification"}
@@ -0,0 +1,47 @@
# Rebuild Current Frontend Preview
## Goal
Rebuild the current Java Web application and refresh the local Tomcat deployment so the user can view the latest frontend effect in the browser.
## What I already know
* The user asked to rebuild the program to inspect the new frontend.
* The project is a Java 11 Maven WAR application.
* Maven produces `target/library-management.war`.
* Frontend JSP/CSS assets live under `src/main/webapp`.
* Local Tomcat path recorded by prior work is `/home/sjy/apps/tomcat/apache-tomcat-9.0.117/apache-tomcat-9.0.117`.
* The Tomcat context should be `/library-management`.
## Requirements
* Run a clean Maven package build.
* Deploy the new WAR to the local Tomcat `webapps` directory.
* Remove the expanded old deployment directory before restart so stale frontend assets are not reused.
* Start or restart Tomcat.
* Verify the frontend login URL is reachable.
* Provide the local browser URL to the user.
## Acceptance Criteria
* [x] `mvn clean package` succeeds.
* [x] `target/library-management.war` exists.
* [x] Tomcat deployment is refreshed with the new WAR.
* [x] `/library-management/login` returns HTTP 200.
* [x] User receives the local preview URL.
## Out of Scope
* Source code changes.
* New UI requirements or redesign decisions.
* Database schema or seed data changes.
## Technical Notes
* Build command from README: `mvn clean package`; fallback Maven path: `/home/sjy/.sdkman/candidates/maven/current/bin/mvn clean package`.
* Deployment target: `/home/sjy/apps/tomcat/apache-tomcat-9.0.117/apache-tomcat-9.0.117/webapps/library-management.war`.
* Build completed at 2026-04-28 20:21 +0800.
* Previous Tomcat deployment was moved to `/home/sjy/apps/tomcat/apache-tomcat-9.0.117/apache-tomcat-9.0.117/deploy-backups/_pre-preview-20260428-202206/`.
* Tomcat is running in tmux session `mzh-library-tomcat`.
* Verified `http://localhost:8080/library-management/login` returns `HTTP 200` with `Content-Type: text/html;charset=UTF-8`.
* Verified demo login redirects to `/library-management/dashboard`, and the authenticated dashboard returns `HTTP 200`.
@@ -0,0 +1,26 @@
{
"id": "04-28-rebuild-current-frontend-preview",
"name": "04-28-rebuild-current-frontend-preview",
"title": "rebuild current frontend preview",
"description": "",
"status": "in_progress",
"dev_type": null,
"scope": null,
"package": null,
"priority": "P2",
"creator": "Zzzz",
"assignee": "Zzzz",
"createdAt": "2026-04-28",
"completedAt": null,
"branch": null,
"base_branch": "master",
"worktree_path": null,
"commit": null,
"pr_url": null,
"subtasks": [],
"children": [],
"parent": null,
"relatedFiles": [],
"notes": "",
"meta": {}
}
@@ -0,0 +1,6 @@
{"file": ".trellis/spec/frontend/index.md", "reason": "Review JSP changes against presentation-layer conventions."}
{"file": ".trellis/spec/frontend/component-guidelines.md", "reason": "Verify button/action removal keeps page composition and primary operations intact."}
{"file": ".trellis/spec/frontend/state-management.md", "reason": "Ensure JSP changes do not alter request/session contracts."}
{"file": ".trellis/spec/frontend/quality-guidelines.md", "reason": "Run UI-oriented quality review for removed redundant actions."}
{"file": ".trellis/spec/backend/database-guidelines.md", "reason": "Review Chinese demo data against schema and seed-data conventions."}
{"file": ".trellis/spec/backend/quality-guidelines.md", "reason": "Verify backend layer boundaries and checks for schema-only data changes."}
@@ -0,0 +1,9 @@
{"file": ".trellis/spec/frontend/index.md", "reason": "JSP presentation-layer conventions and required pre-development checklist for removing redundant page actions."}
{"file": ".trellis/spec/frontend/directory-structure.md", "reason": "Location and ownership of JSP pages, shared fragments, and static assets."}
{"file": ".trellis/spec/frontend/component-guidelines.md", "reason": "Rules for JSP fragments, forms, tables, buttons, and page composition."}
{"file": ".trellis/spec/frontend/state-management.md", "reason": "Server-rendered request/session/form state constraints for JSP changes."}
{"file": ".trellis/spec/frontend/type-safety.md", "reason": "JSP/Servlet display contracts and safe rendering expectations."}
{"file": ".trellis/spec/frontend/quality-guidelines.md", "reason": "UI quality checks for JSP/CSS changes."}
{"file": ".trellis/spec/backend/index.md", "reason": "Backend architecture overview for database initialization changes."}
{"file": ".trellis/spec/backend/database-guidelines.md", "reason": "MySQL schema and seed-data conventions for readers, categories, and books."}
{"file": ".trellis/spec/backend/quality-guidelines.md", "reason": "Layer-boundary and verification expectations for database-only backend changes."}
@@ -0,0 +1,58 @@
# remove redundant page actions and add Chinese demo data
## Goal
精简已登录页面中与侧边栏重复的右侧跨模块跳转按钮,并补充更贴近中文图书馆场景的演示图书与读者数据。
## What I already know
* 用户希望移除以下重复入口:报表中心右侧“借阅记录”;馆藏检索右侧“管理图书”;图书管理右侧“分类”“查看馆藏”;管理分类右侧“管理图书”;读者档案右侧“管理登录账户”;用户账户与角色右侧“读者档案”。
* 侧边栏已经提供这些模块之间的跳转,因此页面标题栏和工具栏中的跨模块二级入口会显得重复。
* “新增图书”“新增分类”“新增读者档案”“新增账户”等当前页面内的主要操作仍应保留。
* 演示数据位于 `src/main/resources/db/schema.sql`,当前包含英文读者名、英文分类和英文图书。
* 项目是 JSP + Servlet + MySQL 架构,前端页面在 `src/main/webapp/WEB-INF/jsp/`,数据库初始化脚本使用 `utf8mb4`
## Assumptions
* 本任务只调整冗余跨模块按钮,不改变侧边栏导航、权限控制、Servlet 路由或业务流程。
* 数据初始化仍使用 `INSERT IGNORE` / `ON DUPLICATE KEY UPDATE` 的现有风格,避免重复执行脚本破坏已有本地数据。
* 中文演示数据可以替换或扩充现有英文样例,但登录测试账号用户名和密码保持不变。
## Requirements
* 报表中心页面不再显示跳转到借阅记录的右侧按钮。
* 馆藏检索页面不再显示跳转到管理图书的右侧按钮。
* 图书管理页面不再显示跳转到分类管理或馆藏检索的右侧按钮;保留新增图书入口。
* 分类管理页面不再显示跳转到管理图书的右侧按钮;保留新增分类入口。
* 读者档案页面不再显示跳转到管理登录账户的右侧按钮;保留新增读者档案入口。
* 用户账户与角色页面不再显示跳转到读者档案的右侧按钮;保留新增账户入口。
* 数据库初始化脚本加入中文图书分类、中文书名、中文作者和中文读者姓名。
* 本地演示账号仍能用于登录验证。
## Acceptance Criteria
* [x] 指定页面中的重复跨模块按钮被移除,侧边栏仍能导航到对应模块。
* [x] 页面内新增操作按钮未被误删。
* [x] `schema.sql` 包含多条中文图书数据和多条中文读者数据。
* [x] 中文演示数据使用 `utf8mb4` 兼容的文本,不引入新表或迁移机制。
* [x] 相关检查或可用的构建验证通过;若环境缺少 Maven,记录 fallback 验证。
## Definition of Done
* Tests/checks run where available.
* Lint/typecheck/build status reported.
* Specs reviewed for whether new conventions need recording.
## Out of Scope
* 不重设计侧边栏或整体视觉风格。
* 不新增页面、权限、路由或服务层能力。
* 不改变借阅记录、报表、用户账户或读者档案的业务逻辑。
## Technical Notes
* Likely JSP files: `src/main/webapp/WEB-INF/jsp/reports/dashboard.jsp`, `src/main/webapp/WEB-INF/jsp/books/catalog.jsp`, `src/main/webapp/WEB-INF/jsp/books/manage.jsp`, `src/main/webapp/WEB-INF/jsp/books/categories.jsp`, `src/main/webapp/WEB-INF/jsp/readers/manage.jsp`, `src/main/webapp/WEB-INF/jsp/admin/users/manage.jsp`.
* Data file: `src/main/resources/db/schema.sql`.
* Relevant specs: frontend JSP/component/state/quality guidelines and backend database/quality guidelines.
* Final verification: `git diff --check`, JSP scriptlet/SQL/JDBC scan, removed-link scan, and `/home/sjy/.sdkman/candidates/maven/current/bin/mvn clean package` passed.
* Spec update decision: no `.trellis/spec/` update needed because this task did not introduce new routes, APIs, tables, cross-layer contracts, or reusable implementation conventions.
@@ -0,0 +1,26 @@
{
"id": "remove-redundant-actions-add-cn-data",
"name": "remove-redundant-actions-add-cn-data",
"title": "remove redundant page actions and add Chinese demo data",
"description": "",
"status": "in_progress",
"dev_type": null,
"scope": null,
"package": null,
"priority": "P2",
"creator": "Zzzz",
"assignee": "Zzzz",
"createdAt": "2026-04-28",
"completedAt": null,
"branch": null,
"base_branch": "master",
"worktree_path": null,
"commit": null,
"pr_url": null,
"subtasks": [],
"children": [],
"parent": null,
"relatedFiles": [],
"notes": "",
"meta": {}
}