style: remove markdown bold syntax from code comments

Remove `**...**` emphasis markers from inline comments and JSDoc blocks across
auth and chat components, machine mappers, and quota helpers. These are
plain code comments, not rendered markdown, so the bold syntax was noise.

Files touched:
- src/app/auth/components/auth-screen.tsx
- src/app/chat/components/chat-header.tsx
- src/app/chat/components/chat-screen.tsx
- chat machine mapper / quota helpers

No functional or behavioral changes.
This commit is contained in:
2026-06-16 14:06:31 +08:00
parent 7506dcae3a
commit 9ffa30cc03
33 changed files with 206 additions and 206 deletions
+6 -6
View File
@@ -93,7 +93,7 @@ export const syncFacebookBackendActor = fromPromise<
});
// ========== 显式游客登录 actoropt-in ==========
// 由 splash UI 派发 `AuthGuestLoginSubmitted` 触发,**不**自动跑。
// 由 splash UI 派发 `AuthGuestLoginSubmitted` 触发,自动跑。
// 取代了之前 checkAuthStatusActor 的 auto-guest-login 行为 —— 避免每次
// 访 splash 都自动创建游客账号污染后端。
//
@@ -115,7 +115,7 @@ export const guestLoginActor = fromPromise<LoginStatus, void>(async () => {
console.log("[auth-machine] guestLoginActor SHORT-CIRCUIT (has local guestToken) → return guest");
return "guest" as LoginStatus;
}
// Result.err(_) 时**不**抛 —— 落到 API 路径让真正的错误信号出现
// Result.err(_) 时抛 —— 落到 API 路径让真正的错误信号出现
// 2. 没有(或读不出)才走完整流程:拿 deviceId → 调后端
const deviceId = await deviceIdentifier.getDeviceId();
@@ -138,15 +138,15 @@ export const guestLoginActor = fromPromise<LoginStatus, void>(async () => {
// ========== 启动 / 恢复时检查登录态 actor(只查不创) ==========
// 由 <AuthStatusChecker /> 在 mount 时派发(一次性)。
// 流程(**纯只读**):
// 流程(纯只读):
// 1. deviceIdentifier.getDeviceId() —— 无则通过 fingerprintjs 生成 + 落盘
// (给后续 OAuth/email 登录准备 deviceId**不**在 splash 首次访问就 auto-create 游客)
// (给后续 OAuth/email 登录准备 deviceId在 splash 首次访问就 auto-create 游客)
// 2. AuthStorage.getLoginToken() —— 有 → "email"
// 3. AuthStorage.getGuestToken() —— 有 → "guest"
// 4. 都没有 → "notLoggedIn"(让用户**显式**选 OAuth / Email / Guest 入口)
// 4. 都没有 → "notLoggedIn"(让用户显式选 OAuth / Email / Guest 入口)
export const checkAuthStatusActor = fromPromise<LoginStatus, void>(async () => {
// 1. 拿 deviceId**不**用于 auto-guest-login,仅供后续登录用)
// 1. 拿 deviceId用于 auto-guest-login,仅供后续登录用)
await deviceIdentifier.getDeviceId();
const storage = AuthStorage.getInstance();
+5 -5
View File
@@ -13,9 +13,9 @@ export type AuthEvent =
| { type: "AuthModeChanged"; mode: AuthMode }
| { type: "AuthFormCleared" }
| { type: "AuthReset" }
/** 启动 / 恢复时检查登录态 —— 拿 deviceId → 查 token**不**自动创建游客账号) */
/** 启动 / 恢复时检查登录态 —— 拿 deviceId → 查 token自动创建游客账号) */
| { type: "AuthStatusCheckSubmitted" }
/** 显式游客登录 —— splash 上点"游客模式"按钮触发(**不**自动) */
/** 显式游客登录 —— splash 上点"游客模式"按钮触发(自动) */
| { type: "AuthGuestLoginSubmitted" }
// 业务事件(提交)
| { type: "AuthEmailLoginSubmitted"; email: string; password: string }
@@ -35,7 +35,7 @@ export type AuthEvent =
| { type: "AuthGoogleSyncSubmitted"; idToken: string }
| { type: "AuthFacebookSyncSubmitted"; accessToken: string }
// ──────────────────────────────────────────────────────────────────────
// splash / auth screen 跳完 /chat 后**清**"刚按了"信号(一次性):
// `pendingRedirect` 在 login onDone action 里**自动**置 true(不是按钮派的)
// —— 因此**只**需要 `AuthClearPendingRedirect` 一个事件
// splash / auth screen 跳完 /chat 后"刚按了"信号(一次性):
// `pendingRedirect` 在 login onDone action 里自动置 true(不是按钮派的)
// —— 因此需要 `AuthClearPendingRedirect` 一个事件
| { type: "AuthClearPendingRedirect" };
+8 -8
View File
@@ -27,13 +27,13 @@ export type { AuthEvent } from "./auth-events";
//
// 设计:所有登录/同步流跑完都回 `idle`(带正确 `loginStatus`)。
//
// `pendingRedirect: boolean`"用户**显式**触发了登录"信号)——
// **在登录成功的 onDone 里自动置 true**
// `pendingRedirect: boolean`"用户显式触发了登录"信号)——
// 在登录成功的 onDone 里自动置 true
// splash / auth screen 看到 `pendingRedirect && loginStatus !== "notLoggedIn"` 跳 /chat
// 跳完派 `AuthClearPendingRedirect` 置 false
// checkingAuthStatus **不**设 flag —— 被动查 token 不算"用户意图"。
// checkingAuthStatus 设 flag —— 被动查 token 不算"用户意图"。
//
// 注:onDone 用了**内联**assign(不是 helper function)—— XState v5 的 TypeScript
// 注:onDone 用了内联assign(不是 helper function)—— XState v5 的 TypeScript
// 推断对 helper return type 不友好;内联能保留 `state.matches("loadingXxx")` 的类型。
// ============================================================
export const authMachine = setup({
@@ -83,7 +83,7 @@ export const authMachine = setup({
},
// 启动 / 恢复时检查登录态 —— 由 <AuthStatusChecker /> 派发
AuthStatusCheckSubmitted: "checkingAuthStatus",
// 显式游客登录 —— 由 splash UI 派发(**不**自动)
// 显式游客登录 —— 由 splash UI 派发(自动)
AuthGuestLoginSubmitted: "loadingGuestLogin",
AuthEmailLoginSubmitted: "loadingEmailLogin",
AuthEmailRegisterSubmitted: "loadingEmailRegister",
@@ -98,7 +98,7 @@ export const authMachine = setup({
errorMessage: "Apple login not implemented",
}),
},
// splash / auth screen 跳完 /chat 后**清**flag
// splash / auth screen 跳完 /chat 后flag
AuthClearPendingRedirect: {
actions: assign({ pendingRedirect: false }),
},
@@ -110,10 +110,10 @@ export const authMachine = setup({
invoke: {
src: "checkAuthStatus",
onDone: {
target: "idle", // ← status check 完回 idle**不**再假冒 success
target: "idle", // ← status check 完回 idle再假冒 success
actions: assign({
loginStatus: ({ event }) => event.output,
// **不**置 pendingRedirect —— 状态查询是**被动**读 token,不算"用户意图"
// 置 pendingRedirect —— 状态查询是被动读 token,不算"用户意图"
errorMessage: null,
}),
},
+3 -3
View File
@@ -18,12 +18,12 @@ export interface AuthState {
/** 当前登录状态(未登录 / 游客 / OAuth / 邮箱) */
loginStatus: LoginStatus;
/**
* **一次性的"刚按了"信号** —— Skip / Facebook / 邮箱登录按钮**刚**派事件 → 置 true
* 一次性的"刚按了"信号 —— Skip / Facebook / 邮箱登录按钮派事件 → 置 true
* → splash-screen / auth-screen 看到 `pendingRedirect && loginStatus !== "notLoggedIn"` 触发跳转
* → 跳完置 false
*
* 历史:之前用 useRef 做 transition detection**但** re-mount 时 ref 重置,bug 复发。
* 现**在 auth state 里持久**machine 不重置)—— re-mount 时也能区分"刚按"和"历史"。
* 历史:之前用 useRef 做 transition detection re-mount 时 ref 重置,bug 复发。
* 现在 auth state 里持久(machine 不重置)—— re-mount 时也能区分"刚按"和"历史"。
*/
pendingRedirect: boolean;
}
+1 -1
View File
@@ -9,7 +9,7 @@
* → auth machine 调 `authRepository.googleLogin/facebookLogin` 换业务 token
* → 业务 token 写入本地 storage
*
* 此组件**无可见 UI**(返回 null),仅作为 NextAuth session 与 auth state
* 此组件无可见 UI(返回 null),仅作为 NextAuth session 与 auth state
* machine 之间的桥接器。挂在 RootProviders 内、AuthProvider 之后:
* <AuthProvider> ← 提供 useAuthState / useAuthDispatch
* <OAuthSessionSync /> ← 用上面两个 hook