feat(hide): 密码可见隐藏块,发帖双栏预览与门禁体验修复
增加密码解锁与游客签名 cookie;发帖页对齐 1440 并默认双栏预览;修复 locked 解析、按钮对比度与回复聚焦。 Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -10,7 +10,7 @@ export default function ComposeLayout({
|
||||
return (
|
||||
<div
|
||||
data-compose-viewport
|
||||
className="flex flex-col flex-1 min-h-0 w-full max-w-6xl mx-auto"
|
||||
className="flex flex-col flex-1 min-h-0 w-full"
|
||||
>
|
||||
{children}
|
||||
</div>
|
||||
|
||||
@@ -1367,14 +1367,26 @@ body {
|
||||
text-align: left;
|
||||
padding: 8px 10px;
|
||||
border-radius: 8px;
|
||||
border: 0;
|
||||
appearance: none;
|
||||
-webkit-appearance: none;
|
||||
font-size: 13px;
|
||||
color: var(--ink);
|
||||
background: transparent;
|
||||
font-weight: 500;
|
||||
line-height: 1.35;
|
||||
cursor: pointer;
|
||||
/* 强制可读对比:避免暗色下系统 buttonface 浅底 + 浅字 */
|
||||
color: var(--ink) !important;
|
||||
background: transparent !important;
|
||||
}
|
||||
.j13-md-popover button[role="menuitem"]:hover,
|
||||
.j13-md-menu-item:hover {
|
||||
background: var(--accent-soft);
|
||||
color: var(--accent);
|
||||
background: var(--panel-2) !important;
|
||||
color: var(--ink) !important;
|
||||
}
|
||||
.j13-md-popover button[role="menuitem"]:focus-visible,
|
||||
.j13-md-menu-item:focus-visible {
|
||||
outline: 2px solid var(--accent);
|
||||
outline-offset: 0;
|
||||
}
|
||||
.j13-md-popover-input {
|
||||
width: 100%;
|
||||
@@ -1401,13 +1413,18 @@ body {
|
||||
text-align: left;
|
||||
padding: 7px 10px;
|
||||
border-radius: 8px;
|
||||
border: 0;
|
||||
appearance: none;
|
||||
-webkit-appearance: none;
|
||||
font-size: 12.5px;
|
||||
font-family: var(--font-mono, ui-monospace, monospace);
|
||||
color: var(--ink-2);
|
||||
cursor: pointer;
|
||||
color: var(--ink-2) !important;
|
||||
background: transparent !important;
|
||||
}
|
||||
.j13-md-popover-list button:hover {
|
||||
background: var(--accent-soft);
|
||||
color: var(--accent);
|
||||
background: var(--panel-2) !important;
|
||||
color: var(--ink) !important;
|
||||
}
|
||||
.j13-md-field {
|
||||
display: flex;
|
||||
@@ -1433,6 +1450,8 @@ body {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
min-height: 0;
|
||||
min-width: 0;
|
||||
height: 100%;
|
||||
}
|
||||
.j13-md-write-wrap.is-dragover .j13-md-textarea {
|
||||
opacity: 0.35;
|
||||
@@ -1462,18 +1481,65 @@ body {
|
||||
}
|
||||
.j13-md-mode button {
|
||||
height: 30px;
|
||||
padding: 0 12px;
|
||||
padding: 0 10px;
|
||||
border-radius: 999px;
|
||||
border: 0;
|
||||
appearance: none;
|
||||
-webkit-appearance: none;
|
||||
font-size: 12.5px;
|
||||
font-weight: 500;
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
gap: 5px;
|
||||
color: var(--ink-3);
|
||||
cursor: pointer;
|
||||
color: var(--ink-2);
|
||||
background: transparent;
|
||||
}
|
||||
.j13-md-mode button.is-on {
|
||||
background: var(--accent-soft);
|
||||
background: color-mix(in srgb, var(--accent) 18%, var(--panel));
|
||||
color: var(--accent);
|
||||
font-weight: 600;
|
||||
}
|
||||
.j13-md-panes {
|
||||
flex: 1 1 auto;
|
||||
display: grid;
|
||||
grid-template-columns: 1fr;
|
||||
grid-template-rows: minmax(0, 1fr);
|
||||
min-height: 0;
|
||||
gap: 0;
|
||||
}
|
||||
.j13-md-panes.is-split {
|
||||
grid-template-columns: 1fr;
|
||||
}
|
||||
@media (min-width: 960px) {
|
||||
.j13-md-panes.is-split {
|
||||
grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
|
||||
}
|
||||
.j13-md-panes.is-split .j13-md-write-wrap {
|
||||
border-right: 1px solid var(--line);
|
||||
padding-right: 1rem;
|
||||
margin-right: 0;
|
||||
}
|
||||
.j13-md-panes.is-split .j13-md-preview {
|
||||
padding-left: 1rem;
|
||||
}
|
||||
}
|
||||
/* 窄屏双栏:上下分栏仍同时显示 */
|
||||
@media (max-width: 959px) {
|
||||
.j13-md-panes.is-split {
|
||||
grid-template-rows: minmax(220px, 1fr) minmax(220px, 1fr);
|
||||
gap: 0;
|
||||
}
|
||||
.j13-md-panes.is-split .j13-md-write-wrap {
|
||||
border-bottom: 1px solid var(--line);
|
||||
padding-bottom: 0.5rem;
|
||||
}
|
||||
.j13-md-panes.is-split .j13-md-preview {
|
||||
padding-top: 0.35rem;
|
||||
}
|
||||
}
|
||||
.j13-md-panes > [hidden] {
|
||||
display: none !important;
|
||||
}
|
||||
.j13-md-textarea {
|
||||
flex: 1 1 auto;
|
||||
@@ -1505,9 +1571,23 @@ body {
|
||||
.j13-md-preview {
|
||||
flex: 1 1 auto;
|
||||
min-height: 320px;
|
||||
height: 100%;
|
||||
overflow-y: auto;
|
||||
padding: 1rem 0 0.75rem;
|
||||
padding: 0.65rem 0 0.75rem;
|
||||
background: transparent;
|
||||
min-width: 0;
|
||||
}
|
||||
.j13-md-preview-label {
|
||||
font-size: 11.5px;
|
||||
font-weight: 600;
|
||||
letter-spacing: 0.04em;
|
||||
text-transform: uppercase;
|
||||
margin-bottom: 0.35rem;
|
||||
color: var(--ink-3);
|
||||
}
|
||||
.j13-md-panes.is-preview .j13-md-preview-label,
|
||||
.j13-md-panes.is-write .j13-md-preview-label {
|
||||
display: none;
|
||||
}
|
||||
.j13-md-foot {
|
||||
flex-shrink: 0;
|
||||
@@ -1545,8 +1625,8 @@ body {
|
||||
border-radius: 999px;
|
||||
font-size: 11.5px;
|
||||
font-weight: 600;
|
||||
color: var(--accent);
|
||||
background: var(--accent-soft);
|
||||
color: var(--accent-on);
|
||||
background: var(--accent);
|
||||
}
|
||||
.j13-hide-block-body {
|
||||
padding: 12px 16px 14px;
|
||||
@@ -1581,6 +1661,52 @@ body {
|
||||
gap: 8px;
|
||||
flex-wrap: wrap;
|
||||
}
|
||||
.j13-hide-pwd-wrap {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
gap: 8px;
|
||||
width: 100%;
|
||||
max-width: 360px;
|
||||
margin: 0 auto;
|
||||
}
|
||||
.j13-hide-pwd-form {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 8px;
|
||||
flex-wrap: wrap;
|
||||
justify-content: center;
|
||||
width: 100%;
|
||||
}
|
||||
.j13-hide-pwd-input {
|
||||
flex: 1 1 160px;
|
||||
min-width: 140px;
|
||||
height: 36px;
|
||||
padding: 0 12px;
|
||||
border-radius: 10px;
|
||||
border: 1px solid var(--line-2);
|
||||
background: var(--panel);
|
||||
color: var(--ink);
|
||||
font-size: 14px;
|
||||
}
|
||||
.j13-hide-pwd-input:focus {
|
||||
outline: 2px solid var(--accent);
|
||||
outline-offset: 0;
|
||||
}
|
||||
.j13-hide-pwd-input.is-invalid {
|
||||
border-color: var(--danger);
|
||||
outline: none;
|
||||
box-shadow: 0 0 0 2px color-mix(in srgb, var(--danger) 22%, transparent);
|
||||
}
|
||||
.j13-hide-pwd-error {
|
||||
margin: 0;
|
||||
width: 100%;
|
||||
text-align: center;
|
||||
font-size: 13px;
|
||||
font-weight: 600;
|
||||
line-height: 1.4;
|
||||
color: var(--danger);
|
||||
}
|
||||
|
||||
.j13-compose-shell {
|
||||
background: var(--panel);
|
||||
@@ -3703,6 +3829,18 @@ a.j13-mention-token:hover {
|
||||
text-underline-offset: 3px;
|
||||
font-weight: 500;
|
||||
}
|
||||
/* 正文内嵌按钮链接:未分层的 .prose-content a 会盖掉 @layer 的 .btn-primary 字色 */
|
||||
.prose-content a.btn,
|
||||
.prose-content a.btn-primary,
|
||||
.prose-content a.btn-accent {
|
||||
color: var(--accent-on) !important;
|
||||
text-decoration: none;
|
||||
font-weight: 500;
|
||||
}
|
||||
.prose-content a.btn-line {
|
||||
color: var(--ink) !important;
|
||||
text-decoration: none;
|
||||
}
|
||||
.prose-content img,
|
||||
.prose-content .md-content-img {
|
||||
max-width: 100%;
|
||||
|
||||
@@ -37,7 +37,7 @@ export default async function EditPostPage({ params }: PageProps) {
|
||||
return (
|
||||
<div
|
||||
data-compose-viewport
|
||||
className="j13-compose-page w-full max-w-6xl mx-auto"
|
||||
className="j13-compose-page w-full"
|
||||
>
|
||||
<nav className="meta mb-4 flex items-center gap-1.5 flex-wrap text-[13px] shrink-0">
|
||||
<Link href="/" className="hover:text-[var(--accent)] transition-colors">
|
||||
|
||||
@@ -24,7 +24,7 @@ import {
|
||||
type Board,
|
||||
type CommentsResponse,
|
||||
} from "@/lib/api";
|
||||
import { authCookieHeader } from "@/lib/cookies";
|
||||
import { postViewerCookieHeader } from "@/lib/cookies";
|
||||
import { getMeCached, getPublicSettingsCached } from "@/lib/serverData";
|
||||
import CommentSection from "@/components/CommentSection";
|
||||
import PostActions from "@/components/PostActions";
|
||||
@@ -52,7 +52,7 @@ export async function generateMetadata({ params }: PageProps): Promise<Metadata>
|
||||
const { id } = await params;
|
||||
try {
|
||||
// 带登录态:作者/管理团队看待审帖时标签标题也应是真实标题而非"帖子不存在"
|
||||
const { post } = await fetchPostDetail(id, authCookieHeader(await cookies()));
|
||||
const { post } = await fetchPostDetail(id, postViewerCookieHeader(await cookies()));
|
||||
if (post.tombstone) {
|
||||
return {
|
||||
title: post.title || "帖子已删除",
|
||||
@@ -402,7 +402,7 @@ export default async function PostDetailPage({ params, searchParams }: PageProps
|
||||
const { id } = await params;
|
||||
const sp = await searchParams;
|
||||
const commentPage = Math.max(1, parseInt(sp.page || "1", 10) || 1);
|
||||
const cookie = authCookieHeader(await cookies());
|
||||
const cookie = postViewerCookieHeader(await cookies());
|
||||
// 待审/被拒帖子对无权访问者由后端返回 404,这里落到全局 not-found 页而非 500
|
||||
let post: Awaited<ReturnType<typeof fetchPostDetail>>["post"];
|
||||
try {
|
||||
|
||||
Reference in New Issue
Block a user