Add Chakra Admin UI and AWS Cost Dashboard#22
Conversation
- Add Chakra UI provider and Toaster to (cms) route group. - Introduce AdminShell with fixed left sidebar on desktop and slide-in Drawer on mobile. - Move admin pages under (cms)/admin/(shell) so sign-in stays outside the shell. - Replace the monolithic dashboard with a Chakra-styled overview that links to per-entity pages. - Refactor sign-in page with Chakra Card and loading state. - Remove obsolete dashboard, section, action-buttons, and inline style files.
- Add shared FormDrawer (right-side, with toast feedback) and DeleteAlertDialog. - Add reusable EntityList that renders rows with edit/delete and mounts the per-entity drawer. - Split the admin into per-entity routes under (shell): businesses, images, files, institutions, markdowns, webpages, reports, histories. - Drop the old monolithic dashboard page tests and update sign-in/layout tests for the new UI.
- Add create/update/delete server actions for AdminSettings. - Add /admin/settings page that lists settings and edits them via Drawer + AlertDialog. - Mask the stored value in the list view; key is immutable when editing.
- Install @aws-sdk/client-organizations and @aws-sdk/client-cost-explorer. - Add src/utils/aws.ts with describeOrganization, listAllAccounts (paginated), and getCurrentAndPreviousMonthCosts that buckets UnblendedCost by LINKED_ACCOUNT. - Cost Explorer client is pinned to us-east-1 (only region that serves the CE endpoint). - Add unit tests using aws-sdk-client-mock for both clients.
- New /admin/aws page that loads Organization, Accounts, and current/previous month UnblendedCost grouped by LINKED_ACCOUNT using credentials stored in AdminSettings. - Highlights the management (main) account and shows per-account current/previous month totals plus organization-wide totals. - Shows a warning with a settings link when AWS_ACCESS_KEY_ID / AWS_SECRET_ACCESS_KEY are not configured, and surfaces SDK errors via an alert. - Drop stale 'use server' from src/utils/admin-settings.ts so we can co-locate constants with helpers. - Fix Field.HelperText typo on the AdminSettings form. - Apply Prettier formatting across touched files.
- Add .prettierignore and .gitignore entry for .sisyphus/ so prettier:check stays green. - AdminSettings edit drawer no longer ships the stored secret to the browser; value stays blank and is only updated when the admin supplies a new value (matching update action now skips when value is empty). - Replace the dashboard StatCard inline-styled Next Link with Chakra LinkBox/LinkOverlay.
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
Codecov Report❌ Patch coverage is @@ Coverage Diff @@
## main #22 +/- ##
=========================================
Coverage 99.43% 99.44%
=========================================
Files 54 87 +33
Lines 2676 3985 +1309
Branches 323 700 +377
=========================================
+ Hits 2661 3963 +1302
- Misses 15 22 +7
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report in Codecov by Sentry.
🚀 New features to boost your workflow:
|
|
최종 검증 상태를 공유합니다.
Admin Chakra UI 전환, AWS 대시보드, AdminSettings 보안 보완, 리팩터링 및 테스트 보강까지 완료되어 리뷰 가능한 상태입니다. |
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: c4acf573e3
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
GetCostAndUsage returns NextPageToken when groups span multiple pages. Previously only the first page was read, so accounts in later pages were silently dropped and monthly totals were undercounted in organizations with many linked accounts. Loop until NextPageToken is exhausted. Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
AWS Organizations is retiring the Account.Status field on September 9, 2026. Both Status and State coexist during the transition window, so render State when present and fall back to Status; once Status is removed, accounts that only return State will continue to display correctly. Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
|
@codex review |
|
Codex Review: Didn't find any major issues. Already looking forward to the next diff. ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
Next.js 16 defaults next dev/build to Turbopack, but Chakra UI v3 emits emotion global styles (<style data-emotion="css-global">) whose positioning diverges from the client tree after revalidatePath. The mismatch caused all admin Drawer/Button handlers to stop responding until a full page refresh. Follow Chakra's official guidance and opt back into webpack until Next.js fixes the Turbopack emotion handling. Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
…mismatch" This reverts commit fb57afe.
Chakra v3 Drawer relies on an open: true \u2192 false transition to clean up pointer blocking, focus trap, scroll lock, and aria-hidden state injected when the drawer opens. Make the cleanup contract explicit by setting lazyMount and unmountOnExit on Drawer.Root, and accept an optional formKey prop so form fields can remount when the edit target changes. Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
The previous API conditionally rendered each list-client's Drawer with
{createOpen && ...} and hard-coded open={true}. Submitting a server
action set the parent state to false, which unmounted Drawer.Root while
its open prop was still true; Chakra never observed the close
transition, leaving an orphan backdrop and pointer-events:none on the
body so every subsequent click was blocked until full reload.
Pass open/setOpen to renderCreate and open/closeEdit plus the
preserved-during-close item to renderEdit. The 9 list-clients now wire
the FormDrawer to the actual open state, and EntityList tracks
lastEditing so the drawer keeps its data during the exit animation.
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)
Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
With Chakra Drawer's unmountOnExit, dialog/heading content stays in the DOM during the close transition, so the synchronous queryByRole().not assertion races the animation and flakes in jsdom. Wrap the post-close assertions in waitFor so they wait for the transition to settle. Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
useState-during-render kept lastEditing in sync via a derived-state guard, but the pattern fires extra renders whenever items.find returns a fresh reference and is fragile under concurrent rendering. Capture the item in the 수정 click handler instead, then resolve the rendered item as editing ?? editingSnapshot so the drawer keeps its data during the close animation without writing state during render. Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
FormDrawer accepts an optional formKey but no entity-form was passing it, so re-opening the edit drawer with a different item while the previous exit animation was still in flight could show stale defaultValue fields. Pass the entity id (or 'create' for the create drawer) so the <form> remounts when the edit target changes. Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
Add two regression cases for the Chakra Drawer cleanup fix: - after closing the create drawer the 추가 button stays clickable, so a second open succeeds without a page refresh - closing one row's edit drawer and clicking 수정 on another row swaps the form title (and therefore its remounted defaultValue fields) Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
… swap Tighten the regression coverage around the original Chakra Drawer bug: - add a submit-then-revalidate-then-reopen case that exercises the exact FormDrawer.submit -> onOpenChange(false) -> parent rerender with new items path (not just the cancel-then-reopen path already covered) - assert that switching edit targets swaps the 키 input's rendered defaultValue, proving the formKey remount actually takes effect Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
|
@codex review |
|
Codex Review: Didn't find any major issues. Nice work! ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
요약
보안 및 구현 메모
hasValue와valueLength같은 비밀이 아닌 요약 정보만 전달합니다.us-east-1에서 수행합니다..sisyphus/는 git/prettier 대상에서 제외했습니다.검증
pnpm build통과pnpm test통과 (50 files / 650 tests)pnpm lint통과pnpm prettier:check통과<promise>VERIFIED</promise>