fix(home): stabilize initial popular threads box

Keep usePopularPosts() keyed to the requested board list, wait to reveal the box until the first result set is stable, and limit the grid to one thread per board. Freeze the first revealed threads until refresh or filter changes so later board loads cannot displace visible cards.
This commit is contained in:
plebeius
2026-03-08 16:48:38 +08:00
parent 2b32866b6b
commit 824c14f538
4 changed files with 256 additions and 36 deletions
@@ -19,7 +19,7 @@ interface PopularThreadProps {
boardPath: string;
}
export const ContentPreview = ({ content, maxLength = 99 }: { content: string; maxLength?: number }) => {
const ContentPreview = ({ content, maxLength = 99 }: { content: string; maxLength?: number }) => {
const plainText = removeMarkdown(content).trim().replaceAll(' ', '').replace(/\n\n/g, '\n').replaceAll('\n\n', '');
const truncatedText = plainText.length > maxLength ? `${plainText.substring(0, maxLength).trim()}...` : plainText;