[PR #78] Building the Admin Web Skeleton and Shared Parts
- What changed: Before building any admin screen, I set up the skeleton (the starting frame of the project) and the shared parts (buttons, dialogs, and tables that several screens use together). There are no screens yet.
- Decision: Tool versions match the ones the server uses. Two versions of the same tool in one repository would be hard to manage.
- Still unknown: I have not yet confirmed that dialogs open and close as expected in a real browser. The tests so far ran in a simulated browser environment.
What and why
I requested this work. The admin screens talk to the server the same way and share the same buttons and tables. Building these separately for each screen would copy the same code in many places, so the skeleton and shared parts were built once.
Claude built the following:
- Skeleton: The screen library (React), the build tool (Vite), and the type checker (TypeScript) are set up. During development, requests sent to the admin address are passed on to the server through a middle connection.
- Server call helper: It keeps the error code the server returns, so the screen can turn it into a readable message. When the connection drops, the screen shows that case itself, since the server sends no code for it. Error bodies are not written to logs.
- Display helpers: A function that hides the middle digits of a phone number, a function that shows dates in Korean time, and a function that counts the days left.
- Dialogs and input parts: A dialog builds its content fresh each time it opens, so old input does not carry over. When it closes, keyboard focus (the place where typing goes) returns to the button that opened it. Confirmation dialogs, input fields, a reason field, and a helper that blocks double submission are included.
- Table and status parts: A table, page navigation, status tabs, status badges, empty, error, and loading views. These are kept small and simple, and they have no separate tests.
There is still no screen. The first page only has an empty route table.
Chosen approach and rejected alternatives
- Chosen: Tool versions match the server’s. Upgrading to the newest versions would create two versions in one repository, so that was rejected.
- Chosen: Dropped connections are handled only on the screen side, not added to the server’s error code list. Changing the types that the server and the screen share would widen the scope of the change.
- Rejected: Using an outside dialog library. The plan said to build them directly, so I followed the plan.
- Rejected: Setting up shared global test configuration. Each test file loads what it needs directly.
How it was checked
- After a fresh install, the automated test suite passed. The check includes both screen tests and server tests, so existing server code was also confirmed not to break.
- Date display was checked against the expected values in its test, using real runtime output.
- The server’s admin routes were checked in the source to confirm they all start with the same prefix.
- During review, the lock file was read to confirm that no existing package version had changed.
Lessons
- Building shared pieces once, before the screens, makes the later screen work easier to keep consistent.
- Matching tool versions at the start avoids conflicts later.
- The list of error messages was not in the plan, so Claude wrote it as a first draft. A person still needs to read and refine it.