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"); + } +});