Repository navigation
feat(billing): show the AI usage meter on the detail pages too (AI usage display, part 4) - #1434
Merged
Merged
Conversation
… pages (AI usage display, part 1) Co-Authored-By: Claude Opus 5.5 <[email protected]>
…AI usage, and once it's used up (AI usage display, part 2) Co-Authored-By: Claude Opus 5.5 <[email protected]>
…age display, part 4) A prompt, an answer, an audit, a cited page, a topic, Similar topics, an opportunity, and a brand's settings, prompts and topics. Co-Authored-By: Claude Opus 5.5 <[email protected]>
4 of 7 tasks
gkhngyk
reviewed
Oct 24, 2026
gkhngyk
left a comment
Contributor
There was a problem hiding this comment.
One fix before merge:
- The meter sits under the drawer's close button. Files:
web/src/components/content/opportunity-detail.tsx:486, withweb/src/app/[locale]/(dashboard)/dashboard/content/page.tsx:1759-1761andweb/src/components/ui/sheet.tsx:65.- On the Content page's drawer,
SheetContentkeeps its built-in close button: 28 px,absolute top-3 right-3, so it spans 12–40 px from the top and from the right. - The drawer's body is
p-6. From 640 px up, the meter now sits at 24 px from the top and the right, 32 px tall. - The two share a 16×16 px corner. The X is drawn over the meter's right end, the "%" side, and a click there closes the drawer instead of opening the popover.
- Fix: leave room for the close button in the drawer. For example, wrap the header in
<div className={cn(inDrawer && 'pr-8')}>, or giveHeaderWithAiUsageaclassNameand passpr-8wheninDrawer. Alternatively, passshowCloseButton={false}to thisSheetContentand put a close button in the header row next to the meter. - The standalone
content/[id]page has no close button and is fine as is.
- On the Content page's drawer,
ansvisor#1430 and ansvisor#1431 are on main (squash-merged), with ansvisor#1433 and ansvisor#1436; this branch's own change (part 4) is applied on top of them. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…usage meter On the Content page's drawer the opportunity's header row ends under the sheet's close button (28 px at top-3 right-3), so the X covered the meter's "%" end and a click there closed the drawer. HeaderWithAiUsage takes a className for its row, and the drawer passes pr-8. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Collaborator
Author
|
@gkhngyk Fixed, and main merged in.
Checks: web format, lint (0 errors), typecheck, |
gkhngyk
approved these changes
Oct 24, 2026
gkhngyk
left a comment
Contributor
There was a problem hiding this comment.
All items done.
- Close button: the drawer passes
pr-8toHeaderWithAiUsage(web/src/components/content/opportunity-detail.tsx:487). From 640 px up the meter now ends 56 px from the drawer's edge, clear of the X (12–40 px). Below 640 px the title row gets the same room. The standalone page is unchanged, and the new meter test pins the class. - Merge of main (eba1c38): no hidden changes. What it adds on top of main is exactly part 4 as reviewed; only one test hunk's line offset differs, because #1436 added tests above it.
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
AI usage display, part 4: the month's AI usage meter (and its 80% / 100% banner) on the detail pages too, so it is in the same place on every page (Drive › AI Usage ›
AI-USAGE-spec.md§3.1).Each detail page's header block — its Back link and its title — is wrapped in
HeaderWithAiUsage(#1430), so the meter sits at the block's top right and the banner follows it:prompts/[id]) and an answer (insights/[id]): their Back button and title block now share one block;audit/[id]): the Back link row with Re-audit and Delete;citations/url), a topic (prompts/topics/[id]) and Similar topics;brands/[id]/layout.tsx): after Workspace Settings;content/[id],OpportunityDetail):HeaderWithAiUsage banner={false}, a new option, so its badges stay under the title and the banner follows the whole block;Pages in a centred column (a prompt, an answer, Similar topics) have the meter at the column's right, level with Back. That's 24 px further in than on the other pages, from those pages' own padding. Moving it out of the column would take it off the Back row's line.
On a phone the meter goes under the header block, on the right, as on every page.
Most of the diff is re-indentation: "Hide whitespace" shows about 40 added lines.
Pre-push review: no high findings. Fixed:
Left as is: the 24 px offset on centred pages (above), and the Back link row being shorter than the meter on an audit and a cited page.
Not here:
Related issue
Drive spec AI Usage (approved 2026-10-23). No GitHub issue.
Type of change
How to test
Checked locally on the demo workspace, temporarily on Growth at 100% (restored afterwards). The demo workspace has no audit, so the audit page was checked in code and tests only.
Checklist
web/:yarn format:check,yarn lint(0 errors; 6 existing warnings elsewhere),yarn typecheck,yarn test(366 files, 3,313 tests) andyarn buildpassai-usage-meter.test.tsxcoversbanner={false}🤖 Generated with Claude Code