feat: 重设计私信页并优化开源展柜体验
私信改为飞书风布局,支持缩略图表情/图片、按会话草稿与用户搜索发起会话;主页发私信直达消息页。开源展柜修复空列表粘滞并改版目录式 UI。
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user