feat(comment): tighten the comments panel density

The Comments panel was sparse: 12px inner/outer paddings per thread, a
16px gap between avatar and body, body text at the global 16px ProseMirror
size. On a narrow aside column this ate vertical space - few comments per
screen, lots of air.

Tighten strictly inside features/comment (the shared aside frame is left
untouched, so TOC/Details tabs keep their padding):

- Thread Paper: p='sm'->p='xs', mb='sm'->mb='xs' (12->10px).
- Reply-editor Divider: my={4}->my={2}.
- CommentListItem outer Box: pb='xs'->pb={6}; the header Group
  (avatar + body) gains gap='xs' (16->10px).
- Font hierarchy: author name sm->xs (14->12px, fw=500 kept), selection
  quote sm->xs; comment body via a scoped CSS override on
  .commentEditor .ProseMirror: font-size sm (14px) + line-height 1.4,
  margin-top 10->4. The page editor is unaffected (the override is
  scoped to the comment editor module).
- Selection quote padding 8->6, margin-top 4->2.
- Dropped the unused .wrapper rule (no references).
This commit is contained in:
glm5.2 agent 180
2026-06-20 14:02:40 +03:00
parent c8af637654
commit 680995247a
3 changed files with 15 additions and 14 deletions

View File

@@ -116,8 +116,8 @@ function CommentListItem({
} }
return ( return (
<Box ref={ref} pb="xs"> <Box ref={ref} pb={6}>
<Group> <Group gap="xs">
<CustomAvatar <CustomAvatar
size="sm" size="sm"
avatarUrl={comment.creator.avatarUrl} avatarUrl={comment.creator.avatarUrl}
@@ -126,7 +126,7 @@ function CommentListItem({
<div style={{ flex: 1 }}> <div style={{ flex: 1 }}>
<Group justify="space-between" wrap="nowrap"> <Group justify="space-between" wrap="nowrap">
<Text size="sm" fw={500} lineClamp={1}> <Text size="xs" fw={500} lineClamp={1}>
{comment.creator.name} {comment.creator.name}
</Text> </Text>
@@ -177,7 +177,7 @@ function CommentListItem({
tabIndex={0} tabIndex={0}
aria-label={t("Jump to comment selection")} aria-label={t("Jump to comment selection")}
> >
<Text size="sm">{comment?.selection}</Text> <Text size="xs">{comment?.selection}</Text>
</Box> </Box>
)} )}

View File

@@ -121,8 +121,8 @@ function CommentListWithTabs() {
<Paper <Paper
shadow="sm" shadow="sm"
radius="md" radius="md"
p="sm" p="xs"
mb="sm" mb="xs"
withBorder withBorder
key={comment.id} key={comment.id}
data-comment-id={comment.id} data-comment-id={comment.id}
@@ -145,7 +145,7 @@ function CommentListWithTabs() {
{!comment.resolvedAt && canComment && ( {!comment.resolvedAt && canComment && (
<> <>
<Divider my={4} /> <Divider my={2} />
<CommentEditorWithActions <CommentEditorWithActions
commentId={comment.id} commentId={comment.id}
onSave={handleAddReply} onSave={handleAddReply}

View File

@@ -1,15 +1,11 @@
.wrapper {
padding: var(--mantine-spacing-md);
}
.focused-thread { .focused-thread {
border: 2px solid #8d7249; border: 2px solid #8d7249;
} }
.textSelection { .textSelection {
margin-top: 4px; margin-top: 2px;
border-left: 2px solid var(--mantine-color-gray-6); border-left: 2px solid var(--mantine-color-gray-6);
padding: 8px; padding: 6px;
background: var(--mantine-color-gray-light); background: var(--mantine-color-gray-light);
cursor: pointer; cursor: pointer;
overflow-wrap: break-word; overflow-wrap: break-word;
@@ -32,6 +28,9 @@
box-shadow: 0 0 0 2px var(--mantine-color-blue-3); box-shadow: 0 0 0 2px var(--mantine-color-blue-3);
} }
/* Denser comments: override the global 16px ProseMirror body size with 14px
and tighten the rhythm vs. the comment header. Scoped to the comment
editor only - the page editor is unaffected. */
.ProseMirror :global(.ProseMirror){ .ProseMirror :global(.ProseMirror){
border-radius: var(--mantine-radius-sm); border-radius: var(--mantine-radius-sm);
max-width: 100%; max-width: 100%;
@@ -39,7 +38,9 @@
word-break: break-word; word-break: break-word;
padding-left: 6px; padding-left: 6px;
padding-right: 6px; padding-right: 6px;
margin-top: 10px; font-size: var(--mantine-font-size-sm);
line-height: 1.4;
margin-top: 4px;
margin-bottom: 2px; margin-bottom: 2px;
} }