Refine hono-door admin UI and public link lifecycle - #1
Merged
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
This PR refines the hono-door admin UI + API lifecycle around issuing/reissuing, archiving, and archive preview/delete, while also simplifying the public/admin-facing model by removing role from types and UI surfaces. It also introduces bilingual (JA/EN) admin UI rendering and a more polished UI design system.
Changes:
- Remove
rolefromShortLinkContext/token summaries and update admin/public rendering + docs accordingly. - Add roomId uniqueness enforcement across linkIds, plus archive deletion and richer archive-preview rendering hooks.
- Add bilingual admin UI (language detection + i18n strings) and substantial CSS/layout/accessibility improvements.
Reviewed changes
Copilot reviewed 23 out of 24 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| src/sample-public-page.tsx | Removes Role display from the sample public page meta panel. |
| src/index.tsx | Wires archive preview rendering through createDoorUi and adds a helper to render archived rooms via ShortLinkContext. |
| README.md | Updates repo-level docs for roomId uniqueness, removed role, and new archive deletion endpoints. |
| packages/hono-door/src/types.ts | Removes role and some deprecated issue inputs; adds ShortLinkDeletedLink type. |
| packages/hono-door/src/short-link.ts | Plumbs new operations (revokeLinkToken, deleteArchivedLink) into the door surface. |
| packages/hono-door/src/operations.ts | Implements roomId uniqueness enforcement, token revoke op, room snapshot recording, and archive deletion op. |
| packages/hono-door/src/middleware.ts | Removes role from the ShortLinkContext injected into requests. |
| packages/hono-door/src/index.ts | Re-exports the new ShortLinkDeletedLink type. |
| packages/hono-door/src/durable-objects/registry.ts | Removes role from registry token records; adds room usage lookup + archive deletion + room cleanup. |
| packages/hono-door/src/durable-objects/public-link.ts | Removes role from token storage/access/policy; adds DO-side deleteLinkData(). |
| packages/hono-door/src/admin-api.ts | Removes role from schemas; adds DELETE /admin/links/archive/:linkId; routes revoke through operations. |
| packages/hono-door/README.md | Updates package-level docs for roomId uniqueness and removal of role. |
| packages/hono-door-ui/src/types.ts | Adds locale support to page input types. |
| packages/hono-door-ui/src/styles.ts | Major CSS refresh: design tokens, layout changes, dark mode polish, reduced motion support. |
| packages/hono-door-ui/src/pages.tsx | Adds i18n-backed rendering for main pages and shared nav; updates copy structure; preview page still default-locale. |
| packages/hono-door-ui/src/index.ts | Adds language detection middleware, archive deletion route, reissue-with-policy update flow, and archive preview render hook. |
| packages/hono-door-ui/src/i18n.ts | Introduces JA/EN string tables and locale resolution helpers. |
| packages/hono-door-ui/src/generated/admin-ui-client.ts | Regenerated bundled client JS to reflect new UI/i18n/layout behaviors. |
| packages/hono-door-ui/src/admin-ui-client.tsx | Refactors client UI for i18n, improved “one-time URL/QR” handoff UX, archive deletion, and accessibility semantics. |
| packages/hono-door-ui/README.md | Documents new archive preview renderer hook, archive deletion, and locale detection behavior. |
| packages/hono-door-ui/PRODUCT.md | Adds product framing and UX/accessibility goals for hono-door-ui. |
| packages/hono-door-ui/DESIGN.md | Adds an explicit design system/spec for the admin UI styling and behavior. |
| packages/hono-door-ui/.impeccable/design.json | Adds generated design-system JSON for tooling. |
| packages/hono-door-ui/.impeccable/critique/2026-07-03T02-55-04Z__packages-hono-door-ui-src-pages-tsx.md | Adds an automated design critique snapshot for pages.tsx. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
104
to
108
| CREATE TABLE IF NOT EXISTS tokens ( | ||
| token_hash TEXT PRIMARY KEY, | ||
| link_id TEXT NOT NULL, | ||
| label TEXT, | ||
| role TEXT NOT NULL, | ||
| room_id TEXT NOT NULL, |
Comment on lines
184
to
188
| INSERT INTO tokens ( | ||
| token_hash, | ||
| link_id, | ||
| label, | ||
| role, | ||
| room_id, |
Comment on lines
116
to
+120
| const room = normalizeRoomInput(input.room) | ||
| const roomId = room.id ?? input.roomId | ||
|
|
||
| if (roomId !== undefined) { | ||
| const roomInput: { title?: string; body?: string } = {} | ||
| const title = room.title ?? input.title | ||
| const body = room.body ?? input.body | ||
| if (title) roomInput.title = title | ||
| if (body) roomInput.body = body | ||
| if (roomInput.title !== undefined || roomInput.body !== undefined) { | ||
| await resolve(config.rooms, c).getByName(roomId).setState(roomInput) | ||
| await resolve(config.registry, c).getByName('default').recordRoomSet(roomId, roomInput) | ||
| } | ||
| } | ||
| const publicLink = resolve(config.publicLinks, c).getByName(input.linkId) | ||
| const roomId = room.id ?? input.roomId ?? await publicLink.getCurrentRoomId() | ||
| const availability = await ensureRoomIdAvailable(config, c, input.linkId, roomId) | ||
| if (!availability.ok) return availability |
| useCount: '利用回数', | ||
| none: '-', | ||
| qrCode: 'QR コード', | ||
| requiredFieldsInvalid: 'Required fields are missing or invalid.', |
Comment on lines
133
to
137
| export function renderAdminArchivePreviewPage({ linkId, room }: ArchiveRoomPreviewInput) { | ||
| const t = adminUiText[adminUiDefaultLocale] | ||
| return ( | ||
| <html lang="ja"> | ||
| <html lang={adminUiDefaultLocale}> | ||
| <head> |
|
🎉 This PR is included in version 0.3.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Validation
rtk bun run check