From 28eb17f60bf478d87a5d39def2f91c8cbe1d1723 Mon Sep 17 00:00:00 2001 From: Chuyaoyuan Date: Wed, 13 May 2026 14:39:57 +0800 Subject: [PATCH] front ui fix --- .../controller/api/RestMsgController.java | 18 ----------- src/main/resources/static/semanticui/my.css | 32 +++++++++++++++++++ src/main/resources/templates/comm/header.ftl | 21 ++++++++++-- src/main/resources/templates/conversation.ftl | 2 +- .../resources/templates/notifications.ftl | 2 +- src/main/resources/templates/user.ftl | 2 +- 6 files changed, 54 insertions(+), 23 deletions(-) diff --git a/src/main/java/com/yaoyuan/jiscuss/controller/api/RestMsgController.java b/src/main/java/com/yaoyuan/jiscuss/controller/api/RestMsgController.java index 1a077a3..29d3597 100644 --- a/src/main/java/com/yaoyuan/jiscuss/controller/api/RestMsgController.java +++ b/src/main/java/com/yaoyuan/jiscuss/controller/api/RestMsgController.java @@ -35,24 +35,6 @@ public class RestMsgController extends BaseController { @Autowired private IUsersService usersService; - // ─── Debug (TEMP) ───────────────────────────────────────────────────── - - /** Temp debug: returns raw message counts and inbox list for current user. */ - @GetMapping("/debug/inbox") - public ApiResponse> debugInbox(HttpServletRequest request) { - UserInfo user = getUserInfo(request); - if (user == null) return ApiResponse.fail(401, "请先登录"); - long unread = messageService.countUnread(user.getId()); - List inbox = messageService.getInbox(user.getId()); - return ApiResponse.ok(Map.of( - "userId", user.getId(), - "username", user.getUsername(), - "unreadCount", unread, - "inboxSize", inbox.size(), - "inbox", inbox - )); - } - // ─── User card (public — accessible to any authenticated user) ──────── /** Returns basic user info for the hover card (discussionsCount, commentsCount). */ diff --git a/src/main/resources/static/semanticui/my.css b/src/main/resources/static/semanticui/my.css index 37e389e..2ec4b7d 100644 --- a/src/main/resources/static/semanticui/my.css +++ b/src/main/resources/static/semanticui/my.css @@ -17,8 +17,40 @@ --border: rgba(255, 255, 255, 0.1); } +/* ── Global reset ─────────────────────────────────────────────────────────── */ +html, body { margin: 0; padding: 0; } body { background-color: var(--bg-page) !important; color: var(--text-primary); } +/* ── Sticky header (CSS sticky — works on all pages) ─────────────────────── */ +#menu.ui.menu { + position: sticky; + top: 0; + z-index: 999; + box-shadow: 0 2px 6px rgba(0,0,0,.08); +} + +/* ── Back-to-top button ───────────────────────────────────────────────────── */ +#backToTop { + position: fixed; + bottom: 32px; + right: 32px; + width: 42px; + height: 42px; + border-radius: 50%; + background: var(--accent); + color: #fff; + border: none; + cursor: pointer; + display: none; + align-items: center; + justify-content: center; + font-size: 1.2em; + box-shadow: 0 2px 8px rgba(0,0,0,.2); + z-index: 1000; + transition: opacity .2s; +} +#backToTop:hover { opacity: .85; } + /* Apply card background where Semantic UI uses white */ [data-theme="dark"] .ui.card, [data-theme="dark"] .ui.segment, diff --git a/src/main/resources/templates/comm/header.ftl b/src/main/resources/templates/comm/header.ftl index b86fb48..9647a77 100644 --- a/src/main/resources/templates/comm/header.ftl +++ b/src/main/resources/templates/comm/header.ftl @@ -1,7 +1,7 @@