Skip to content

armgit / alook

Public Imported from GitHub
0

Multi-Agent Collaboration for Team and Friends

fix(web): refine forum thread hierarchy

Guse537f139dd8b
diff --git a/src/web/src/components/community/channel-sidebar.crumb.test.ts b/src/web/src/components/community/channel-sidebar.crumb.test.ts
index 09e605507..9fa493b15 100644
--- a/src/web/src/components/community/channel-sidebar.crumb.test.ts
+++ b/src/web/src/components/community/channel-sidebar.crumb.test.ts
@@ -94,12 +94,17 @@ describe("ChannelSidebar header", () => {
expect(html).not.toContain('aria-label="Alpha"')
})
- it("renders forum children as non-sortable nested rows with one solid 2px connector", () => {
+ it("renders forum children as non-sortable nested rows with one subtle 1.5px connector", () => {
const html = renderForum()
expect(html).toContain('data-testid="community-forum-sidebar-thread-post_1"')
expect(html).toContain('data-testid="community-forum-sidebar-thread-post_2"')
expect(html).toContain('aria-current="page"')
- expect(html).toContain('stroke-width="2"')
+ expect(html).toContain('stroke-width="1.5"')
+ expect(html).toContain("text-muted-foreground/45")
+ expect(html).toContain("H 11")
+ expect(html).toContain("ml-4")
+ expect(html).toContain("text-xs font-medium")
+ expect(html).not.toContain("text-[13px]")
expect(html).toContain("First post")
expect(html).toContain("Second post")
expect(html).toContain("bg-primary")
diff --git a/src/web/src/components/community/channel-sidebar.tsx b/src/web/src/components/community/channel-sidebar.tsx
index c4a508e35..792785789 100644
--- a/src/web/src/components/community/channel-sidebar.tsx
+++ b/src/web/src/components/community/channel-sidebar.tsx
@@ -151,8 +151,8 @@ export const ChannelSidebar = memo(function ChannelSidebar({
const branchY = (index: number) => index * rowHeight + rowHeight / 2
const lastY = branchY(threads.length - 1)
const connectorPath = [
- `M 1 0 V ${lastY - 6} Q 1 ${lastY} 7 ${lastY} H 16`,
- ...threads.slice(0, -1).map((_, index) => `M 1 ${branchY(index)} H 16`),
+ `M 1 0 V ${lastY - 6} Q 1 ${lastY} 7 ${lastY} H 11`,
+ ...threads.slice(0, -1).map((_, index) => `M 1 ${branchY(index)} H 11`),
].join(" ")
return (
<div className="relative mt-0! ml-5">
@@ -160,14 +160,14 @@ export const ChannelSidebar = memo(function ChannelSidebar({
aria-hidden="true"
viewBox={`0 0 16 ${threads.length * rowHeight}`}
preserveAspectRatio="none"
- className="pointer-events-none absolute top-0 left-0 w-4 text-muted-foreground/60"
+ className="pointer-events-none absolute top-0 left-0 w-4 text-muted-foreground/45"
style={{ height: threads.length * rowHeight }}
>
<path
d={connectorPath}
fill="none"
stroke="currentColor"
- strokeWidth="2"
+ strokeWidth="1.5"
strokeLinecap="round"
strokeLinejoin="round"
vectorEffect="non-scaling-stroke"
@@ -415,13 +415,13 @@ function ForumSidebarThreadRow({
event.stopPropagation()
}}
className={[
- "ml-4 flex h-7 w-[calc(100%-1rem)] min-w-0 items-center rounded-md px-2 text-left text-xs",
+ "ml-4 flex h-7 w-[calc(100%-1rem)] min-w-0 items-center rounded-md px-2 text-left text-xs font-medium",
active
? "bg-sidebar-accent text-foreground"
: muted
? "text-muted-foreground/50 hover:bg-sidebar-accent/60 hover:text-muted-foreground"
: thread.unread
- ? "font-semibold text-foreground hover:bg-sidebar-accent/60"
+ ? "text-foreground hover:bg-sidebar-accent/60"
: "text-muted-foreground hover:bg-sidebar-accent/60 hover:text-foreground",
].join(" ")}
>