Skip to content

Refactor homepage, remove event entry, and update categories - #15

Merged
cyanmint merged 5 commits into
TransHistoria:defaultfrom
ZTZK:default
May 28, 2026
Merged

Refactor homepage, remove event entry, and update categories#15
cyanmint merged 5 commits into
TransHistoria:defaultfrom
ZTZK:default

Conversation

@ZTZK

@ZTZK ZTZK commented May 27, 2026

Copy link
Copy Markdown
Contributor

This pull request refactors the platform’s branding and user experience, simplifies navigation, and updates the classification and moderation of posts. The main changes include rebranding the app, streamlining navigation by removing the "活动" (Events) section, and overhauling the post categories and tags to better reflect the community’s focus. There are also improvements to content moderation logic and configuration.

Branding and UI/UX Updates:

  • Changed the app’s name and branding from “跨性别社群” to “跨性别空间” across the UI, including the logo, footer, and various text descriptions, to better reflect the platform’s purpose as a safe and visible space for the community. [1] [2]
  • Updated the marketing homepage (/) with simplified, more welcoming language, removed the design principles and activity categories preview sections, and focused the call-to-action on the “广场” (Posts) instead of events. [1] [2]
  • Adjusted the posts list header to use more inclusive language.

Navigation Simplification:

  • Removed the "活动" (Events) section from both the top bar and mobile navigation, focusing navigation on posts, user profile, and notifications. The mobile nav grid was adjusted accordingly. [1] [2] [3] [4]
  • Restricted guest-accessible routes to only user profiles, no longer allowing guests to access event detail pages.

Post Categories and Tagging Overhaul:

  • Replaced the old post sections with a more granular and community-focused set: “提问求助” (Question/Help), “线下交友” (Offline Meetup), “医疗信息” (Medical), “资源分享” (Resource), and “感悟” (Reflection). Updated all related labels and enums. [1] [2]
  • Updated the controlled post tags and top-level tag tabs to match the new categories, removing deprecated tags and adding new ones for reflection and offline meetups.

Content Moderation Logic:

  • Updated the LLM moderation prompt and types to match the new post section taxonomy, removing all logic and instructions related to “EVENT” and event intent/draft extraction. Comments are now always categorized as “QUESTION”. [1] [2] [3] [4]

Configuration and Environment:

  • Refreshed the worker local development .dev.vars example to use new branding and clarified documentation, while adding placeholders for LLM moderation configuration.

ZTZK added 4 commits May 28, 2026 01:10
- 活动入口移除:
  - TopBar.tsx: 删除"活动"导航链接
  - MobileNav.tsx: 删除"活动"tab,grid 从5列改为4列,移除未使用的Calendar图标导入
  - layout.tsx: 删除/events的游客可访问路径规则
  - Footer.tsx: "活动平台"→"交流平台"
- 首页大幅精简 (page.tsx):
  - 标题改为"为社群而建的空间。"
  - 新增三行核心文案:"一个让我们彼此看见,也彼此保护的地方。" / "让相遇更安全,让资源在社群里流动。"
  - 移除右侧装饰卡片、设计原则模块(4项)、底部CTA区、Principle组件定义
  - 移除未使用的图标导入(ShieldCheck, Users, Lock, Sparkles, LucideIcon)
- 广场分类更新为5个新类别:
  - enums.ts: PostSection 新增 QUESTION / OFFLINE_MEETUP / REFLECTION,移除 POST,更新标签映射
  - post-tags.ts: TAG_TABS 改为 提问求助/线下交友/医疗信息/资源分享/感悟
  - worker/llm.ts: 更新 ModeratableSection、PostTag 类型;移除 EVENT/EventIntent/EventDraft/EventCategory/EventFormat 类型;更新系统prompt以反映新分类;移除EVENT处理逻辑
  - worker/routes/posts.ts: 移除 EVENT 自动创建活动逻辑(约130行),移除 createEventFromDraft 函数,更新 normalizePostSection 映射
  - worker/routes/events.ts: 将 section 比较改为 String() 以兼容类型变化
- Logo: "TransHistoria"→"跨性别空间"
- Footer: "跨性别社群"→"跨性别空间",描述改为"一个让我们彼此看见,也彼此保护的地方。"
- 首页: 标题和文案去除句号
- 标题: "动态、医疗、资源,都在这里" → "欢迎在这里分享信息和资源"
- 移除: "任何认证成员都可以发帖。系统会自动审核和分类,你只需要把话说清楚。"
新版 pnpm 不再从 package.json 读取 pnpm.overrides,
该配置已被忽略,导致 lockfile 与 package.json 不匹配,
CI 中 pnpm install --frozen-lockfile 报 ERR_PNPM_LOCKFILE_CONFIG_MISMATCH。

移除后对齐 lockfile 实际状态。

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR rebrands the app and simplifies the primary UX by removing the “活动 (Events)” entry points from navigation and refocusing the marketing homepage CTA toward the “广场 (Posts)”. It also overhauls post sections/tags and updates worker-side LLM moderation logic/configuration accordingly, plus removes deprecated pnpm override config to fix frozen-lockfile mismatches.

Changes:

  • Rebrand UI strings/logo/footer and simplify the marketing homepage hero + CTA to drive users to “广场”.
  • Remove “活动” navigation entry points and tighten guest-access routing.
  • Replace post sections/tags taxonomy and update LLM moderation prompt/types; remove event-draft extraction/migration logic.

Reviewed changes

Copilot reviewed 14 out of 15 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
worker/src/routes/posts.ts Removes event auto-migration logic; updates post section normalization for new taxonomy.
worker/src/routes/events.ts Adjusts section comparison to avoid TS type overlap issues after moderation type change.
worker/src/lib/llm.ts Updates moderation schema/prompt/tags/sections and removes event-draft extraction logic.
worker/.dev.vars Refreshes local dev vars template and adds LLM configuration placeholders.
src/lib/post-tags.ts Updates controlled post tags + top-level tag tabs to match new taxonomy.
src/lib/enums.ts Updates frontend post section enum/labels to new category set.
src/components/layout/TopBar.tsx Removes “活动” link from desktop top nav.
src/components/layout/MobileNav.tsx Removes events tab and updates grid layout/icon imports.
src/components/layout/Logo.tsx Updates default app name fallback to new branding.
src/components/layout/Footer.tsx Updates footer branding/name and description copy.
src/app/(marketing)/page.tsx Simplifies homepage content and switches logged-in CTA to “逛逛广场”.
src/app/(app)/posts/page.tsx Simplifies posts page header slogan.
src/app/(app)/layout.tsx Restricts guest-accessible routes to profiles only.
package.json Removes pnpm.overrides block.
pnpm-lock.yaml Updates lockfile to match removed overrides and current resolved dependency graph.
Files not reviewed (1)
  • pnpm-lock.yaml: Language not supported

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread worker/src/lib/llm.ts
Comment on lines +15 to +20
export type ModeratableSection = "QUESTION" | "OFFLINE_MEETUP" | "MEDICAL" | "RESOURCE" | "REFLECTION";

export type ModerationInputKind = "POST" | "COMMENT" | "EVENT";

export type PostTag =
| "question-help"
Comment on lines +243 to 246
if (String(decision.section) !== "EVENT") {
verdict = "reject";
reason = decision.reason || "内容看起来更像帖子,请改发到「广场」对应板块。";
}
Comment thread worker/.dev.vars Outdated
# Leave LLM_API_KEY empty to disable LLM and fall back to keyword-only filtering.
LLM_BASE_URL=https://api.deepseek.com/anthropic
LLM_MODEL=deepseek-v4-flash
LLM_API_KEY=replace-with-your-key
Comment thread worker/.dev.vars Outdated
Comment on lines +8 to +10
EMAIL_FROM=Trans Community <noreply@example.test>
APP_NAME=跨性别社群
APP_LOCALE=zh-CN
Comment on lines +116 to +120
// Map LLM section to the posts table section string.
function normalizePostSection(decisionSection: string): string {
if (decisionSection === "QUESTION" || decisionSection === "OFFLINE_MEETUP" ||
decisionSection === "MEDICAL" || decisionSection === "RESOURCE" ||
decisionSection === "REFLECTION") return decisionSection;
Comment thread src/lib/enums.ts
Comment on lines 123 to 138
export const PostSection = {
POST: "POST",
QUESTION: "QUESTION",
OFFLINE_MEETUP: "OFFLINE_MEETUP",
MEDICAL: "MEDICAL",
RESOURCE: "RESOURCE",
REFLECTION: "REFLECTION",
} as const;
export type PostSection = (typeof PostSection)[keyof typeof PostSection];

export const POST_SECTION_LABEL: Record<PostSection, string> = {
POST: "动态",
QUESTION: "提问求助",
OFFLINE_MEETUP: "线下交友",
MEDICAL: "医疗信息",
RESOURCE: "资源分享",
REFLECTION: "感悟",
};
- enums.ts: 将 POST 加回 PostSection,映射到"提问求助"标签,
  避免数据库中旧数据(section="POST")渲染时标签 undefined
- .dev.vars: LLM_API_KEY 置空,本地开发默认走纯关键词审核模式;
  APP_NAME 和 EMAIL_FROM 更新为"跨性别空间"
@cyanmint
cyanmint merged commit 036474a into TransHistoria:default May 28, 2026
1 check failed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants