diff --git a/home-topic-tabs-2.png b/home-topic-tabs-2.png new file mode 100644 index 0000000..79a187f Binary files /dev/null and b/home-topic-tabs-2.png differ diff --git a/home-topic-tabs.png b/home-topic-tabs.png new file mode 100644 index 0000000..9d0667f Binary files /dev/null and b/home-topic-tabs.png differ diff --git a/src/features/tech-log/presentation/styles/globals.css b/src/features/tech-log/presentation/styles/globals.css index 6d79800..eb0e65d 100644 --- a/src/features/tech-log/presentation/styles/globals.css +++ b/src/features/tech-log/presentation/styles/globals.css @@ -2966,28 +2966,32 @@ textarea.studio-control { min-height: 118px; resize: vertical; line-height: 1.65 /* 주제 이름 탭. - + 한때 구역 제목 급(30px/650)으로 세웠다. 주제가 둘일 때는 그럴듯했지만 열 개, 스무 개가 되면 이름만으로 화면이 덮인다 — 여기서 하려는 말은 「이것이 이 구역의 제목이다」가 아니라 「고를 것이 이만큼 있다」이므로, 급도 그쪽이어야 한다. 지금 무엇을 읽는지는 목록 바로 위의 축 이름과 「전체 보기」 줄이 말한다. - 고르지 않은 것은 색만 죽인다. 밑줄 같은 표시를 더하면 주제 스무 개가 밑줄 스무 개 자리를 - 두고 늘어선다. + 급을 낮추고 나니 이번에는 목록 위에 글자만 떠 있는 것처럼 보였다. 고른 것이 색으로만 달라서 + 누를 수 있는 것으로 읽히지 않았고, 탭 줄과 목록 사이가 선 없이 30px 비어 있어 두 덩어리로 + 갈렸다. 그래서 고른 탭에 형태(알약)를 주고, 탭 줄을 아래 묶음의 윗선에 바로 얹는다. */ .home-topic-tabs { display: flex; flex-wrap: wrap; - gap: 4px 24px; - padding-bottom: 30px; + gap: 4px; + /* 알약의 좌우 여백만큼 당겨, 첫 탭의 글자가 아래 목록의 왼쪽 끝과 한 줄로 선다. */ + margin-left: -13px; + padding-bottom: 12px; } .home-topic-tabs button { display: inline-flex; - min-height: 32px; + min-height: 34px; align-items: center; - padding: 0; + padding: 0 13px; border: 0; + border-radius: 17px; background: transparent; color: var(--faint); cursor: pointer; @@ -2998,12 +3002,30 @@ textarea.studio-control { min-height: 118px; resize: vertical; line-height: 1.65 text-align: left; } -.home-topic-tabs button[aria-selected="true"], -.home-topic-tabs button:only-child, .home-topic-tabs button:hover { + background: #f0f0ee; color: var(--ink); } +/* + 고른 것은 형태로 말한다. 색만 바꾸면 「진한 글자와 연한 글자」로 읽히고, 밑줄을 쓰면 주제가 + 스무 개일 때 밑줄 설 자리 스무 개가 함께 늘어선다. +*/ +.home-topic-tabs button[aria-selected="true"], +.home-topic-tabs button:only-child { + background: #e7e7e3; + color: var(--ink); +} + +/* + 탭이 얹히는 묶음. 윗선을 목록이 아니라 여기가 갖는다 — 선이 목록에 있으면 축 이름 줄이 선 + 위로 밀려 나가 탭과 한 덩어리처럼 보이고, 정작 목록은 저 혼자 시작한다. +*/ +.home-topic-panel { + border-top: 1px solid var(--line-strong); + padding-top: 16px; +} + /* 축 이름과 주제로 가는 길. 목록 바로 위에 붙어야 「이 넷은 구조다」가 읽힌다 — 탭 옆에 두면 탭을 바꿀 때 무엇이 따라 바뀌는지가 보이지 않는다. @@ -3013,7 +3035,7 @@ textarea.studio-control { min-height: 118px; resize: vertical; line-height: 1.65 align-items: baseline; justify-content: space-between; gap: 24px; - padding-bottom: 10px; + padding-bottom: 6px; } .home-topic-axis .section-kicker { @@ -3023,8 +3045,7 @@ textarea.studio-control { min-height: 118px; resize: vertical; line-height: 1.65 /* 아직 오지 않았거나 오지 못한 주제. 자리를 비워 두면 목록이 사라진 것처럼 보인다. */ .home-topic-pending { margin: 0; - padding: 26px 2px; - border-top: 1px solid var(--line-strong); + padding: 20px 2px; color: var(--muted); font-size: 14px; } @@ -3033,7 +3054,6 @@ textarea.studio-control { min-height: 118px; resize: vertical; line-height: 1.65 margin: 0; padding: 0; list-style: none; - border-top: 1px solid var(--line-strong); } .home-comparison li { diff --git a/tests/features/tech-log/home-topic-tabs.test.tsx b/tests/features/tech-log/home-topic-tabs.test.tsx index 535b6de..5865754 100644 --- a/tests/features/tech-log/home-topic-tabs.test.tsx +++ b/tests/features/tech-log/home-topic-tabs.test.tsx @@ -102,6 +102,45 @@ function renderTabs( const TABS = [listItem(AUTH, 18), listItem(JPA, 3)]; describe("홈의 주제 탭", () => { + /* + 이 검사가 답하는 것: 주제를 새로 만들면 코드를 고쳐야 탭이 느는가. + + 화면에는 주제 이름도, 개수도, 상한도 적혀 있지 않다. 탭은 목록이 준 것을 그대로 세우므로 + 서버가 셋을 주면 셋이 선다. 예전에 주제 화면이 주제 셋을 코드에 적어 두고 그 셋만 열던 + 때가 있었고, 새 주제를 만들어도 화면에는 나오지 않았다. + */ + it("주제가 늘면 코드를 고치지 않아도 탭이 는다", () => { + const REDIS = topic("redis-adapter-ttl", "Redis 어댑터 TTL", "만료 전략", [ + ["ttl", "TTL", "만료를 저장소가 맡는다"], + ["sweep", "Sweep", "만료를 배치가 맡는다"], + ]); + + renderTabs([...TABS, listItem(REDIS, 5)], AUTH); + + expect(screen.getAllByRole("tab").map((tab) => tab.textContent)).toEqual([ + "OAuth/OIDC 인증 경계", + "JPA 피드 조회 성능", + "Redis 어댑터 TTL", + ]); + }); + + it("주제가 스무 개여도 전부 서고, 처음 여는 요청은 그대로 하나다", () => { + const many = Array.from({ length: 20 }, (_, index) => + listItem( + topic(`topic-${index}`, `주제 ${index}`, "축", [ + ["a", "A", ""], + ["b", "B", ""], + ]), + index, + ), + ); + + const { getTopicDetail } = renderTabs([listItem(AUTH, 99), ...many], AUTH); + + expect(screen.getAllByRole("tab")).toHaveLength(21); + expect(getTopicDetail).not.toHaveBeenCalled(); + }); + it("주제 이름이 목록보다 먼저 전부 보인다", () => { renderTabs(TABS, AUTH);