refactor(web): migrate DeepInspectWorkspace and /inspect page to Tailwind CSS v4 #2263
⚠️ Code review skipped — your organization has no extra usage available to pay for this review.
If your organization's extra usage balance is empty, an organization admin can add extra usage credits at claude.ai/admin-settings/usage. If its monthly spend limit was reached, an admin can raise it on the same page. If neither applies, contact Anthropic support.
Once extra usage is available, someone with write access to this repository can comment @claude review on this pull request to trigger a review.
<!-- coderabbit-ai-generated:v1 -->
<!-- This is an auto-generated comment: summarize by coderabbit.ai -->
<!-- review_stack_entry_start -->
<a href="https://app.coderabbit.ai/change-stack/DOS/Rate/pull/2263?scope=ghh_OusAJGA4HG8ljoOV0wJvVx8NmnZIjc2DdjmxOu0xZWA&cs_source=review_comment"><picture><source media="(prefers-color-scheme: dark)" srcset="https://storage.googleapis.com/coderabbit_public_assets/review-stack-buttons-v1/explain-change-dark.svg"><source media="(prefers-color-scheme: light)" srcset="https://storage.googleapis.com/coderabbit_public_assets/review-stack-buttons-v1/explain-change.svg"><img src="https://storage.googleapis.com/coderabbit_public_assets/review-stack-buttons-v1/explain-change.svg" alt="Explain Change →" height="32"></picture></a>
<!-- review_stack_entry_end -->
<!-- recent_review_status_start -->
No actionable comments were generated in the recent review.
<!-- recent_review_status_end -->
<!-- walkthrough_start -->
<details>
<summary><strong>Walkthrough</strong></summary>
<dl>
<dd>
<br>
The inspect workspace and loading fallback now use Tailwind styling. The change adds Tailwind source paths and rendering tests, and updates existing test expectations to match the rendered classes.
Changes: Inspect UI
|Layer / File(s)|Summary|
|:---|:---|
|Tailwind entry and inspection summary <br> apps/web/src/app/[locale]/inspect/page.tsx, apps/web/src/app/style/tailwind.css, apps/web/src/components/inspect/DeepInspectWorkspace.tsx|The loading fallback and inspection summary use Tailwind classes. The workspace uses the shared Input component and updates the hero, verdict, price, Omnibus, and deal-radar displays.|
|Product and offers displays <br> apps/web/src/components/inspect/DeepInspectWorkspace.tsx|The product and offers sections use Tailwind layout and styling. The offers table adds column scopes, labels, and horizontal overflow handling.|
|Merchant risk and review displays <br> apps/web/src/components/inspect/DeepInspectWorkspace.tsx|Merchant risk displays use a helper that maps good, warning, and danger tones to Tailwind text and bar classes. Merchant, review-taxonomy, and not-found panels receive updated styling.|
|Inspection rendering and class validation <br> apps/web/components/inspect/__tests__/deep-inspect-tailwind.test.ts, apps/web/src/lib/__tests__/, apps/web/e2e/inspect-copy.spec.ts|New checks render populated and fallback inspection states across locales and validate classes and UI hooks. Existing rendering assertions and E2E selectors are updated to match the markup.|
<!-- change_assessment_start -->
Estimated code review effort: 3 (Moderate) | ~20 minutes
<!-- change_assessment_commit:"ee46c527851fc9841e1055b392afc0c95d9360ae" -->
<!-- change_assessment_priority:{"version":1,"urgency":"p3","manual":false} -->
Change: Refactor
<!-- change_assessment_end -->
</dd>
</dl>
</details>
<!-- walkthrough_end -->
<details>
<summary><strong>Merge Risk:</strong> <strong><picture><img src="https://storage.googleapis.com/coderabbit_public_assets/review-comment-icons-v1/risk-unassessed-16.svg" width="16" height="16" align="absmiddle" alt=""></picture> Minimal</strong> · up to <code>ee46c</code></summary>
<dl>
<dd>
<br>
<!-- final_review_risk_start -->
<!-- final_review_risk_label
Merge Risk: ⚪ Minimal · up to ee46c
-->
<!-- final_review_risk_coverage:{"sourceCommitId":"ee46c527851fc9841e1055b392afc0c95d9360ae","coveredCommitId":"ee46c527851fc9841e1055b392afc0c95d9360ae","kind":"reviewed"} -->
This restyles the inspect page with Tailwind and shared components and leaves the inspection logic unchanged. No concrete merge-blocking issue was found.
<!-- final_review_risk_end -->
</dd>
</dl>
</details>
<!-- pre_merge_checks_walkthrough_start -->
<details>
<summary><strong>Pre-merge checks: <sup><picture><img src="https://storage.googleapis.com/coderabbit_public_assets/pre-merge-checks-counter-passed-14-v2.svg" width="14" height="14" align="middle" alt="Passed" title="Passed"></picture></sup> 4</strong></summary>
<dl>
<dd>
<br>
| Check name | Status | Explanation |
| :------------------------ | :--------------------------------------------------------------------------------------------: | :-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Title check | !Passed | The title names the two main areas changed: DeepInspectWorkspace and the /inspect page, migrated to Tailwind CSS v4. The raw summary and objectives confirm this is the primary change. The title follow… |
| Description check | !Passed | The description follows the repository template in its main structure. It has a Summary with what changed and why, a Closes #2259 line, and a Verification section that reports the Prettier, typecheck,… |
| Linked Issues check | !Passed | [#2259] Requirements: (1) migrate Bootstrap layout, card, alert, button, and progress classes in DeepInspectWorkspace.tsx and the /inspect page to Tailwind v4 utilities and shadcn/ui Button, Badge, an… |
| Out of Scope Changes check | !Passed | All changed files map to #2259 objectives or to supporting changes for them:<br>- DeepInspectWorkspace.tsx and inspect/page.tsx: direct migration targets.<br>- apps/web/src/app/style/tailwind.css: @source e… |
<details>
<summary><strong>Full details: Title check</strong></summary>
<dl>
<dd>
<br>
Explanation
The title names the two main areas changed: DeepInspectWorkspace and the /inspect page, migrated to Tailwind CSS v4. The raw summary and objectives confirm this is the primary change. The title follows Conventional Commits format and is 80 characters long, which is within the usual limit.
</dd>
</dl>
</details>
<details>
<summary><strong>Full details: Description check</strong></summary>
<dl>
<dd>
<br>
Explanation
The description follows the repository template in its main structure. It has a Summary with what changed and why, a Closes #2259 line, and a Verification section that reports the Prettier, typecheck, lint, and test results. The Claimant line is filled in. Checklist items are not ticked in the template format, and the Notes section (affected areas and reviewers) is missing. The description also includes a TL;DR and a flow diagram that the template does not ask for. The Summary states a 44px mobile tap target requirement, while the linked issue #2259 requires at least 24px, so this needs clarification.
Resolution
Confirm the mobile tap-target requirement. The description says at least 44px, but the linked issue #2259 says at least 24px. Update the description or the code so both agree. Optionally, tick the template checklist items and add the Notes section (affected areas and reviewers) to match the template.
</dd>
</dl>
</details>
<details>
<summary><strong>Full details: Linked Issues check</strong></summary>
<dl>
<dd>
<br>
Explanation
[#2259] Requirements: (1) migrate Bootstrap layout, card, alert, button, and progress classes in DeepInspectWorkspace.tsx and the /inspect page to Tailwind v4 utilities and shadcn/ui Button, Badge, and Card primitives; (2) keep dark/light tokens; (3) keep the 5-star UI rule; (4) keep non-retail organization/place price suppression; (5) keep all data-testid hooks and ARIA semantics; (6) keep mobile touch targets at or above 24px; (7) do not change E2E budget thresholds.
Evidence from the PR summary: DeepInspectWorkspace.tsx replaces Bootstrap classes with semantic tokens (bg-surface, text-fg-secondary, border-border-subtle, bg-status-, text-ink-) and uses shadcn Input, Button, Badge, and Card. The inspect page Suspense fallback is migrated (page.tsx, +1/-1). tailwind.css adds @source entries for both files. The author states that data-testid hooks, aria- labels, 5-star ratings, and retail-verdict suppression (#2168, #2191, #2192) are preserved. The new deep-inspect-tailwind.test.ts checks UI primitives, mobile tap-target classes, required hooks, and SSR output for populated and fallback states. The PR states mobile tap targets of 44px, which exceeds the 24px minimum. The summary shows no change to E2E budget thresholds; the E2E change is limited to the inspect-copy spec querying the main landmark.
Uncertainty: the evidence is the PR summary and test descriptions. The file-level class diff was not inspected. The static test checks only selected Bootstrap classes, so full removal of Bootstrap progress classes is supported by the summary but not independently verified.
</dd>
</dl>
</details>
<details>
<summary><strong>Full details: Out of Scope Changes check</strong></summary>
<dl>
<dd>
<br>
Explanation
All changed files map to #2259 objectives or to supporting changes for them:
@source entries required for new Tailwind classes in migrated files.No change is shown that is unrelated to the issue. Limitation: the assessment relies on the summary and commit descriptions, not the full diff.
</dd>
</dl>
</details>
</dd>
</dl>
</details>
<!-- pre_merge_checks_walkthrough_end -->
<!-- finishing_touch_checkbox_start -->
<details>
<summary><strong>Finishing Touches</strong></summary>
<dl>
<dd>
<br>
<details open>
<summary><strong>Generate unit tests (beta)</strong></summary>
<dl>
<dd>
<br>
</dd>
</dl>
</details>
</dd>
</dl>
</details>
<!-- finishing_touch_checkbox_end -->
<!-- autopilot:start -->
<!-- autopilot:end -->
<!-- tips_start -->
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
<details>
<summary><strong>Share</strong></summary>
<dl>
<dd>
<br>
</dd>
</dl>
</details>
<!-- tips_end -->
<!-- recent_review_start -->
<h6>
<details>
<summary><strong><picture><img src="https://storage.googleapis.com/coderabbit_public_assets/review-comment-icons-v1/info.svg" width="12" height="12" align="absmiddle" alt=""></picture> Recent review info</strong></summary>
<dl>
<dd>
<br>
<!-- review_info_content -->
<details>
<summary><strong><picture><source media="(prefers-color-scheme: dark)" srcset="https://storage.googleapis.com/coderabbit_public_assets/review-comment-icons-v1/cog-dark.svg"><img src="https://storage.googleapis.com/coderabbit_public_assets/review-comment-icons-v1/cog.svg" width="16" height="16" align="absmiddle" alt=""></picture> Run configuration</strong></summary>
<dl>
<dd>
<br>
00669a39-b365-48cc-bf77-c28aa86fbecf</dd>
</dl>
</details>
<details>
<summary><strong><picture><source media="(prefers-color-scheme: dark)" srcset="https://storage.googleapis.com/coderabbit_public_assets/review-comment-icons-v1/git-commit-horizontal-dark.svg"><img src="https://storage.googleapis.com/coderabbit_public_assets/review-comment-icons-v1/git-commit-horizontal.svg" width="16" height="16" align="absmiddle" alt=""></picture> Commits</strong></summary>
<dl>
<dd>
<br>
Reviewing files that changed from the base of the PR and between 7baf56e1b063d1f7314f3b73175108dcf1c22521 and ee46c527851fc9841e1055b392afc0c95d9360ae.
</dd>
</dl>
</details>
<details>
<summary><strong><picture><source media="(prefers-color-scheme: dark)" srcset="https://storage.googleapis.com/coderabbit_public_assets/review-comment-icons-v1/file-plus-corner-dark.svg"><img src="https://storage.googleapis.com/coderabbit_public_assets/review-comment-icons-v1/file-plus-corner.svg" width="16" height="16" align="absmiddle" alt=""></picture> Files selected for processing: 8</strong></summary>
<dl>
<dd>
<br>
apps/web/e2e/inspect-copy.spec.ts
apps/web/src/app/[locale]/inspect/page.tsx
apps/web/src/app/style/tailwind.css
apps/web/src/components/inspect/DeepInspectWorkspace.tsx
apps/web/src/components/inspect/__tests__/deep-inspect-tailwind.test.ts
apps/web/src/lib/__tests__/display-truth.test.ts
apps/web/src/lib/__tests__/inspect-verdict-guards.test.ts
apps/web/src/lib/__tests__/sale-state.test.ts
</dd>
</dl>
</details>
Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.
</dd>
</dl>
</details>
</h6>
<!-- recent_review_end -->
<!-- dos-code-review -->
⏱️ Code Review completed (6 eligible files · 78,431 chars · 1 model call(s) · 3 PR unit(s))
Whole diff with bounded context at base 7baf56e1b063d1f7314f3b73175108dcf1c22521 / head 9eca1925f4caa490b831be29e20c6998a0a3f6d4.
✅ CLEAN_PASS: Complete diff reviewed
Use standard Tailwind CSS spacing utilities (px-3, py-12, sm:px-4) instead of arbitrary pixel values (px-[12px], py-[48px], sm:px-[16px]). This leverages Tailwind's built-in spacing scale, improving consistency and maintainability across the project.
<div className="rate-island-fallback mx-auto w-full max-w-[1320px] px-3 py-12 text-center text-fg-secondary sm:px-4">
Prefer standard Tailwind CSS spacing scale utilities (such as py-12, px-3, sm:px-4, mb-6, p-6, lg:p-12, mb-4, and gap-2) over arbitrary pixel values (py-[48px], px-[12px], sm:px-[16px], mb-[24px], p-[24px], lg:p-[48px], mb-[16px], gap-[8px]). This keeps utility classes concise and aligns with the design system.
<div className="bg-canvas py-12">
<div className="mx-auto w-full max-w-[1320px] px-3 sm:px-4">
{/* Top Hero Inspector Card */}
<div className="rate-scoreboard-dark rate-surface-dark mb-6 p-6 lg:p-12">
<div className="mb-4 flex flex-wrap items-center justify-between gap-2">
Use logical properties like ms-auto (margin-inline-start) instead of physical properties like ml-auto (margin-left). Logical properties are standard in Tailwind CSS and automatically support RTL/LTR layouts, which is a best practice for internationalization.
<ExportMenu label={t('exportMenu')} className="ms-auto">
Simplify arbitrary pixel values to standard Tailwind spacing utilities with the important modifier (e.g., mt-0!, mb-2!, and mb-6!). This maintains consistency with the Tailwind design system while preserving the required specificity override.
<h1 className="mt-0! mb-2! text-[26px]! leading-[1.2]! font-bold! text-fg-primary! sm:text-[32px]!">
{t('title')}
</h1>
<p className="mb-6! text-[15px]! leading-[1.6]! text-fg-secondary!">
{t('subtitle')}
</p>
Use logical margin properties like me-1 (margin-inline-end) instead of physical properties like mr-[4px] (margin-right). Logical properties are standard in Tailwind CSS and support RTL/LTR layouts automatically.
<BsCpu
aria-hidden="true"
className="me-1 inline-block text-ink-primary"
/>
Use logical margin properties like me-1 (margin-inline-end) instead of physical properties like mr-[4px] (margin-right). Logical properties are standard in Tailwind CSS and support RTL/LTR layouts automatically.
<BsCheckCircle
aria-hidden="true"
className="me-1 inline-block"
/>
Code Review
This pull request migrates the inspect page and DeepInspectWorkspace component from Bootstrap to Tailwind CSS v4, updating layouts, typography, and table styles, and adding a comprehensive test suite to verify the migration. The reviewer feedback suggests refactoring arbitrary pixel values (e.g., px-[12px], py-[48px]) to standard Tailwind spacing utilities (e.g., px-3, py-12) to align with the design system. Additionally, the reviewer recommends using logical properties like ms-auto and me-1 instead of physical properties like ml-auto and mr-[4px] to support RTL/LTR layouts for internationalization.
<!-- dos-code-review -->
⏱️ Code Review completed (7 eligible files · 80,802 chars · 1 model call(s) · 3 PR unit(s))
Whole diff with bounded context at base 7baf56e1b063d1f7314f3b73175108dcf1c22521 / head 350c21a7c7db90a1589f94a78e6886a058ec7dfb.
✅ CLEAN_PASS: Complete diff reviewed
<!-- dos-code-review -->
⏱️ Code Review completed (8 eligible files · 82,971 chars · 1 model call(s) · 3 PR unit(s))
Whole diff with bounded context at base 7baf56e1b063d1f7314f3b73175108dcf1c22521 / head ee46c527851fc9841e1055b392afc0c95d9360ae.
claude[bot]
JOY
Summary
apps/web/src/components/inspect/DeepInspectWorkspace.tsxandapps/web/src/app/[locale]/inspect/page.tsxfrom Bootstrap 5 grid, card, badge, alert, input-group, table, and progress utilities to Tailwind CSS v4 semantic tokens (bg-canvas,bg-surface,bg-elevated,text-fg-primary,text-fg-secondary,border-border-subtle,bg-status-,text-ink-) and shadcn/uiInput,Button,Badge, andCardprimitives.@sourceentries forDeepInspectWorkspace.tsxandapp/[locale]/inspect/page.tsxinapps/web/src/app/style/tailwind.css.data-testidhooks,aria-labels, 5-star buyer/expert ratings, mobile>= 44pxtap targets, and non-retail organization/place retail-verdict suppression (#2168,#2191,#2192).apps/web/src/components/inspect/__tests__/deep-inspect-tailwind.test.tsand update migrated Tailwind class assertions indisplay-truth.test.tsandsale-state.test.ts.Verification
npx prettier --checkon all changed files: passednpm run typecheck -w @repo/web: passednpm run lint -w @repo/web: passed (--max-warnings 0)npm test -w @repo/web: all 100 unit test files passedCloses #2259
---
<!-- dos-pr-summary -->
📌 TL;DR
This PR refactors the "Deep Inspect" workspace and its associated page from Bootstrap utility classes to a modern Tailwind CSS design system, introducing a new
inspectRiskTailwindClasseshelper for consistent risk visualization and adding a comprehensive static analysis test suite to enforce styling standards.🎯 Type of Change
🔍 Changes Walkthrough
| File | Summary of Changes |
| :--- | :--- |
|
apps/web/src/app/[locale]/inspect/page.tsx| Updated theSuspensefallback container to use Tailwind utility classes (mx-auto,max-w-[1320px], etc.) instead of legacy Bootstrap classes. ||
apps/web/src/app/style/tailwind.css| Added@sourcedirectives forDeepInspectWorkspace.tsxand the inspect page to ensure Tailwind correctly scans these files for class generation. ||
apps/web/src/components/inspect/DeepInspectWorkspace.tsx| Major Refactor: Replaced all Bootstrap classes (e.g.,d-flex,row,col-lg-8,text-muted) with Tailwind equivalents (e.g.,flex,grid,lg:col-span-8,text-fg-secondary).<br>• IntroducedinspectRiskTailwindClasseshelper to map risk tones to specific Tailwind text/background classes.<br>• Updated layout structure to use CSS Grid (grid-cols-12) for the main 8/4 column split.<br>• Enhanced accessibility (e.g.,role="alert",scope="col").<br>• Standardized spacing and typography using arbitrary values (e.g.,p-[24px],text-[15px]). ||
apps/web/src/components/inspect/__tests__/deep-inspect-tailwind.test.ts| New File: Added a static analysis test suite that reads the source code ofDeepInspectWorkspace.tsxand asserts that specific Bootstrap classes are no longer present, ensuring the migration is complete and preventing regression. |📊 Architectural Flow
<!-- /dos-pr-summary -->
Claimant: antigravity:wave-h-2259
<!-- This is an auto-generated comment: release notes by coderabbit.ai -->
<!-- coderabbit-ai-generated:v1 -->
Summary by CodeRabbit
Style
Updated the inspection workspace with a refreshed, consistent visual design across verdicts, audit details, product and offer information, merchant risk panels, and review sections.
Improved responsive layouts and mobile touch targets.
* Adjusted the inspection page’s loading layout to align with the updated page width and spacing.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->