From 22090a497dab724ff7c277ebd4d37d8f46acd19f Mon Sep 17 00:00:00 2001 From: DongHyeonka Date: Sun, 30 Aug 2026 09:33:09 +0900 Subject: [PATCH] =?UTF-8?q?fix:=20=ED=8E=98=EC=9D=B4=EC=A7=80=20=EB=B2=88?= =?UTF-8?q?=ED=98=B8=EB=A5=BC=20=EB=88=8C=EB=9F=AC=EB=8F=84=20=EC=AA=BD?= =?UTF-8?q?=EC=9D=B4=20=EB=84=98=EC=96=B4=EA=B0=80=EC=A7=80=20=EC=95=8A?= =?UTF-8?q?=EB=8D=98=20=EA=B2=83=EC=9D=84=20=EA=B3=A0=EC=B9=98=EA=B3=A0=20?= =?UTF-8?q?UI=20=EB=A5=BC=20=EC=A0=95=EB=A6=AC=ED=95=9C=EB=8B=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 요청을 만드는 조립기가 질의 인자를 손으로 나열하는데 거기 page 가 없었다. 그래서 숫자를 눌러도, 꺾쇠를 눌러도 서버에는 page 없이 나갔고 늘 1쪽이 돌아왔다. 작업본과 게시 기록 둘 다 그랬다. 이것이 타입 검사를 통과한 이유: 조립기가 입력을 `(input: never)` 로 받아 캐스팅한다. 계약에 인자를 더해도 여기 적지 않으면 컴파일러는 아무 말도 하지 않고 요청만 조용히 그 값을 뺀다. 같은 모양으로 값이 사라지는 결함을 이 저장소에서 여러 번 만났으므로, 요청을 실제로 만들어 page 가 실리는지 확인하는 가드를 함께 둔다 — 되돌리면 깨지는 것을 확인했다. UI: 테두리 있는 흰 버튼을 줄지어 놓으니 화면에서 가장 눈에 띄는 덩어리가 되었다. 봐야 할 것은 목록이다. 상자를 걷어내고 `‹ 1 | 2 | 3 ›` 로 두되 누르는 자리는 40px 로 남긴다 — 보이는 반응은 글자뿐이지만 손가락이 닿는 범위까지 글자만큼 줄이면 터치에서 누르기 어렵다. Co-Authored-By: Claude Opus 5 (1M context) Claude-Session: https://claude.ai/code/session_011nAjrqNHGPNngN4aUbcyvJ --- .../tech-log-studio-contract-contribution.ts | 4 +++ .../tech-log/presentation/styles/studio.css | 26 ++++++++++++++----- .../studio-contract-contribution.test.ts | 26 +++++++++++++++++++ 3 files changed, 49 insertions(+), 7 deletions(-) diff --git a/src/features/tech-log/contracts/tech-log-studio-contract-contribution.ts b/src/features/tech-log/contracts/tech-log-studio-contract-contribution.ts index e1cf9ea..45df5ca 100644 --- a/src/features/tech-log/contracts/tech-log-studio-contract-contribution.ts +++ b/src/features/tech-log/contracts/tech-log-studio-contract-contribution.ts @@ -289,6 +289,7 @@ const LIST_STUDIO_DOCUMENTS = safeOperation( projectId?: string; sort?: string; cursor?: string; + page?: number; limit?: number; }>; return Object.freeze({ @@ -301,6 +302,7 @@ const LIST_STUDIO_DOCUMENTS = safeOperation( projectId: value.projectId, sort: value.sort, cursor: value.cursor, + page: value.page, limit: value.limit, }), }); @@ -453,6 +455,7 @@ const LIST_STUDIO_PUBLICATIONS = safeOperation( q?: string; type?: string; cursor?: string; + page?: number; limit?: number; }>; return Object.freeze({ @@ -461,6 +464,7 @@ const LIST_STUDIO_PUBLICATIONS = safeOperation( q: value.q, type: value.type, cursor: value.cursor, + page: value.page, limit: value.limit, }), }); diff --git a/src/features/tech-log/presentation/styles/studio.css b/src/features/tech-log/presentation/styles/studio.css index 6f86d38..dfc2030 100644 --- a/src/features/tech-log/presentation/styles/studio.css +++ b/src/features/tech-log/presentation/styles/studio.css @@ -194,10 +194,22 @@ 목록의 페이지 이동. 예전에는 「다음」 버튼 하나뿐이라 뒤로 넘어간 뒤 앞쪽으로 돌아올 방법이 없었다. 번호는 현재 쪽 좌우로만 그리고 나머지는 생략하되 첫 쪽과 끝 쪽은 늘 남긴다. */ -.studio-app .studio-pagination { display: flex; align-items: center; gap: 6px; margin-top: 32px; } -.studio-app .studio-pagination ol { display: flex; align-items: center; gap: 4px; margin: 0; padding: 0; list-style: none; } -.studio-app .studio-pagination button { min-width: 40px; min-height: 40px; padding-inline: 10px; border: 1px solid var(--line-strong); border-radius: 5px; background: var(--paper); color: var(--ink); font: inherit; font-size: 14px; font-weight: 550; } -.studio-app .studio-pagination button:disabled { opacity: 0.4; } -/* 지금 보고 있는 쪽. 눌러도 같은 자리라는 것이 보여야 한다. */ -.studio-app .studio-pagination button[aria-current="page"] { border-color: var(--signal); background: var(--signal); color: #fff; } -.studio-app .studio-pagination__gap { min-width: 24px; color: var(--faint); text-align: center; } +/* + 목록 페이지 이동. 테두리 있는 흰 버튼을 줄지어 놓았더니 이 화면에서 가장 눈에 띄는 덩어리가 + 되어 버렸다 — 봐야 할 것은 목록이지 페이지 번호가 아니다. 상자를 걷어내고 숫자와 꺾쇠만 + 남긴 뒤 사이를 세로선으로 나눈다: `‹ 1 | 2 | 3 ›` +*/ +.studio-app .studio-pagination { display: flex; align-items: center; justify-content: center; gap: 4px; margin-top: 32px; color: var(--muted); font-size: 14px; } +.studio-app .studio-pagination ol { display: flex; align-items: center; margin: 0; padding: 0; list-style: none; } +.studio-app .studio-pagination button { min-width: 32px; min-height: 40px; padding: 0 9px; border: 0; background: none; color: var(--muted); font: inherit; font-weight: 500; } +/* 숫자 사이에만 오고 양 끝에는 오지 않는다. */ +.studio-app .studio-pagination li + li::before { color: var(--line-strong); content: "|"; } +/* + 손이 닿는 자리는 40px 로 넓게 두되, 눈에 반응하는 것은 글자뿐이다 — 배경을 칠하면 걷어낸 + 상자가 그대로 되돌아온다. +*/ +.studio-app .studio-pagination button:hover:not(:disabled) { color: var(--ink); text-decoration: underline; text-underline-offset: 4px; } +.studio-app .studio-pagination button:disabled { color: var(--line-strong); } +/* 지금 보고 있는 쪽. 배경 대신 글자만 진하게. */ +.studio-app .studio-pagination button[aria-current="page"] { color: var(--ink); font-weight: 700; } +.studio-app .studio-pagination__gap { min-width: 20px; color: var(--faint); text-align: center; } diff --git a/tests/features/tech-log/studio-contract-contribution.test.ts b/tests/features/tech-log/studio-contract-contribution.test.ts index 018d009..33318fb 100644 --- a/tests/features/tech-log/studio-contract-contribution.test.ts +++ b/tests/features/tech-log/studio-contract-contribution.test.ts @@ -103,3 +103,29 @@ test("assertExactlyOneTechLogStudioBootstrapOperation rejects zero or multiple b ]), ); }); + +/** + * 목록 화면의 페이지 이동은 `page` 질의 인자 하나에 걸려 있다. 그런데 이 파일의 질의 조립기는 + * 필드를 손으로 나열하고 입력을 `never` 로 받아 캐스팅하므로, 계약에 인자를 더해도 여기에 + * 적지 않으면 타입 검사도 통과하고 요청만 조용히 그 값을 뺀 채 나간다. + * + *

실제로 그렇게 나갔다: `‹ 1 2 3 ›` 의 숫자를 눌러도 서버는 늘 1쪽을 돌려줬다. 화면·게이트웨이· + * 백엔드가 모두 맞았고 틀린 곳은 이 목록 하나였다. + */ +test("목록 연산은 page 를 질의 인자로 실어 보낸다", () => { + const byId = new Map( + TECH_LOG_STUDIO_CONTRIBUTION.http.map((entry) => [entry.contract.operationId, entry]), + ); + for (const operationId of ["listStudioDocuments", "listStudioPublications"]) { + const installed = byId.get(operationId); + assert.ok(installed, `${operationId} 가 기여 목록에 있어야 한다`); + const projected = installed.contract.projectRequest({ page: 3, limit: 20 } as never); + const entries = new Map(projected.queryEntries.map(([k, v]) => [k, v])); + assert.equal( + entries.get("page"), + "3", + `${operationId} 가 page 를 실어야 2쪽에서 1쪽으로 돌아올 수 있다`, + ); + assert.equal(entries.get("limit"), "20"); + } +});