feat: 重设计私信页并优化开源展柜体验

私信改为飞书风布局,支持缩略图表情/图片、按会话草稿与用户搜索发起会话;主页发私信直达消息页。开源展柜修复空列表粘滞并改版目录式 UI。
This commit is contained in:
2026-09-02 02:45:29 +08:00
parent 1c0f7ede55
commit 500e452c2f
11 changed files with 1176 additions and 258 deletions

View File

@@ -36,7 +36,8 @@ type homeBootPayload struct {
RecentComments []service.RecentCommentItem `json:"recent_comments"`
RecentUsers []service.RecentUserItem `json:"recent_users"`
Tags []service.TagCount `json:"tags"`
Showcase []service.CommunityShowcaseItem `json:"showcase"`
// omitempty侧栏关闭或未拉取时不写字段避免 SPA 把 [] 当成有效会话快照
Showcase []service.CommunityShowcaseItem `json:"showcase,omitempty"`
Pages []service.SitePageSummary `json:"pages"`
Limits service.ForumLimitsPublic `json:"limits"`
Branding service.SiteBranding `json:"branding"`
@@ -261,13 +262,15 @@ func (h *Handlers) gatherHomeSSR(c *gin.Context, boardID uint) (*homeSSRData, er
go func() {
defer wg.Done()
items, err := h.Community.ListShowcase(c.Request.Host)
if err != nil || items == nil {
if err != nil {
// 失败不写 showcase让前端自行请求避免假空粘死
return
}
if items == nil {
items = []service.CommunityShowcaseItem{}
}
out.boot.Showcase = items
}()
} else {
out.boot.Showcase = []service.CommunityShowcaseItem{}
}
uid := h.currentUserID(c)