René's URL Explorer Experiment


Title: feat(billing): dedicated Credit usage page with date-range filter and CSV export by waleedlatif1 · Pull Request #5405 · simstudioai/sim · GitHub

Open Graph Title: feat(billing): dedicated Credit usage page with date-range filter and CSV export by waleedlatif1 · Pull Request #5405 · simstudioai/sim

X Title: feat(billing): dedicated Credit usage page with date-range filter and CSV export by waleedlatif1 · Pull Request #5405 · simstudioai/sim

Description: Summary Moved Credit Usage out of the inline Billing section into its own page (/settings/billing/credit-usage), reached via a "View usage logs" link — mirrors the secrets/[credentialId] detail-route pattern (own back button, own chrome). Billing settings now shows a compact glance (30-day total + link) instead of the full inline list. New page has day-level date presets (Today / Last 7 days / Last 30 days / All time) plus a working Custom range picker. Fixed the broken Custom range picker in the existing Audit Logs page — the trigger was a modal ChipSelect (Radix DropdownMenu, modal by default); selecting "Custom range" opened the Calendar popover in the same tick the modal menu began its close/focus-lock teardown, trapping the popover non-interactive. Swapped to the non-modal ChipCombobox, matching the pattern the main Logs page already uses successfully. Also trimmed the Audit Logs preset list from 11 to 8 so the menu fits without scrolling. Redesigned rows: dropped the raw model description + badge, now show the humanized source ("Chat", "Agent block", etc.) or Workflow: for workflow-sourced events. Added CSV export of the currently-filtered logs via a new GET /api/users/me/usage-logs/export route (synchronous, single-response — a user's own credit ledger is bounded, unlike a workspace-wide export). Ran a 4-angle /simplify pass after the initial build: moved workflow-name enrichment into getUserUsageLogs itself (matching the established list-logs.ts join pattern) instead of a route-layer helper duplicated across two routes, which also eliminated a redundant SUM/GROUP BY aggregate being recomputed on every page of a paginated export; fixed an off-by-one in the export's pagination loop; deduplicated the source-label map; reused the existing CSV escaping helper instead of hand-rolling one; added a modal prop to the shared ChipSelect component so future call sites don't have to rediscover the same trap. Enterprise gating preserved — the Credit usage section/page is not shown to Enterprise members/owners (unchanged from #5391). Type of Change New feature Bug fix (Audit Logs Custom range) Testing bunx tsc --noEmit, biome, and bun run check:api-validation all pass. 41 vitest tests pass across the touched files (usage-logs list/export routes, credit conversion, usage-log core). Verified live end-to-end in a real browser: page navigation (back link), Custom range picker opening/applying on both the new page and Audit Logs, day presets, row rendering (source labels, workflow name resolution, no badge), CSV export (downloaded file matches on-screen rows and reconciles with the displayed total), compact Billing summary + link. Checklist Code follows project style guidelines Self-reviewed my changes Tests added/updated and passing No new warnings introduced I confirm that I have read and agree to the terms outlined in the Contributor License Agreement (CLA)

Open Graph Description: Summary Moved Credit Usage out of the inline Billing section into its own page (/settings/billing/credit-usage), reached via a "View usage logs" link — mirrors the secrets/[credentialId]...

X Description: Summary Moved Credit Usage out of the inline Billing section into its own page (/settings/billing/credit-usage), reached via a "View usage logs" link — mirrors the secrets/[crede...

Opengraph URL: https://github.com/simstudioai/sim/pull/5405

X: @github

direct link

Domain: github.com

react-profiling0
react-import-mapreact,react-dom,react-dom/client,react-dom/profiling,react-is,react-reconciler,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@d5750093facf
route-pattern/:user_id/:repository/pull/:id/files(.:format)
route-controllerpull_requests
route-actionfiles
fetch-noncev2:fe474278-54a0-8801-4c3f-7d9ff72649aa
current-catalog-service-hashae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b
request-idA184:1BB96C:AF055F:EFCD9F:6AFB50DA
html-safe-nonce5b4c6838a903699bb0eebc0138ae6d9e173d1a2517c4224f254fcf1331fe1378
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBMTg0OjFCQjk2QzpBRjA1NUY6RUZDRDlGOjZBRkI1MERBIiwidmlzaXRvcl9pZCI6IjQwMzE3NTMwNTc0NDI5NDMxOTUiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ==
visitor-hmac4354d9bd6edce85f9e6d0a06c2ca06fe63b722413d6169967eeafb573c141df6
hovercard-subject-tagpull_request:3988811913
github-keyboard-shortcutsrepository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///pull_requests/show/files
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/simstudioai/sim/pull/5405/files
twitter:imagehttps://avatars.githubusercontent.com/u/40672544?s=400&v=4
twitter:cardsummary_large_image
og:imagehttps://avatars.githubusercontent.com/u/40672544?s=400&v=4
og:image:altSummary Moved Credit Usage out of the inline Billing section into its own page (/settings/billing/credit-usage), reached via a "View usage logs" link — mirrors the secrets/[credentialId]...
og:site_nameGitHub
og:typeobject
hostnamegithub.com
expected-hostnamegithub.com
None7122bb414b542dba14d71a3f0b9f6fd2abce715b9f5912d082800563e6c806d1
turbo-cache-controlno-preview
diff-viewunified
go-importgithub.com/simstudioai/sim git https://github.com/simstudioai/sim.git
octolytics-dimension-user_id199344406
octolytics-dimension-user_loginsimstudioai
octolytics-dimension-repository_id912559512
octolytics-dimension-repository_nwosimstudioai/sim
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id912559512
octolytics-dimension-repository_network_root_nwosimstudioai/sim
turbo-body-classeslogged-out env-production page-responsive full-width
disable-turbotrue
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
releasecbf66c024bb6d10e6955baa7413c54cf13a201bb
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/simstudioai/sim/pull/5405/files#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fsimstudioai%2Fsim%2Fpull%2F5405%2Ffiles
GitHubRepository hosting, code review, and collaborationhttps://github.com/platform
CopilotAI coding agent for tasks, projects, and automated workhttps://github.com/features/copilot
ActionsCI/CD and automationhttps://github.com/features/actions
Code QualityQuality analysis, fixes, and enforcementhttps://github.com/features/code-quality
CodespacesCloud development environmentshttps://github.com/features/codespaces
Code SecurityVulnerability detection and remediationhttps://github.com/security/advanced-security/code-security
Secret ProtectionSecret scanning and leak preventionhttps://github.com/security/advanced-security/secret-protection
All Featureshttps://github.com/features
Documentationhttps://docs.github.com/en
Traininghttps://learn.github.com/skills
Certificationshttps://learn.github.com/credentials
Build with Copilothttps://github.com/features/ai
Customize Copilothttps://docs.github.com/en/copilot/how-tos/copilot-on-github/customize-copilot/customize-copilot-overview
Integrationshttps://github.com/marketplace
Trending reposhttps://github.com/trending
GitHub Sponsorshttps://github.com/open-source/sponsors
Developer articleshttps://github.com/resources/articles
ChangelogYour source for the latest features, improvements, and fixes across GitHub products, all in one place.https://github.blog/changelog/
Enterpriseshttps://github.com/enterprise
Teamhttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
See all industrieshttps://github.com/solutions/industry
Why GitHubhttps://github.com/why-github
Customer Storieshttps://github.com/customer-stories
Business insightshttps://github.com/solutions/executive-insights
Trust Centerhttps://github.com/trust-center
GitHub Advanced SecurityEnterprise-grade code securityhttps://github.com/security/advanced-security
Copilot for businessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/enterprise/premium-support
Documentationhttps://docs.github.com/en
Resource centerhttps://github.com/resources
Bloghttps://github.blog/
Events & webinarshttps://github.com/resources/events
Community Forumhttps://github.com/orgs/community/discussions
Customer Storieshttps://github.com/customer-stories
Integrationshttps://github.com/marketplace
Customer supporthttps://help.github.com/
Traininghttps://learn.github.com/skills
GitHub Statushttps://www.githubstatus.com/
Abouthttps://github.com/about
Partnershttps://github.com/partners
Changeloghttps://github.blog/changelog/
GitHub UniverseThe event for developers, by developers — talks, workshops, and what’s next for GitHub.https://githubuniverse.com/
Pricinghttps://github.com/pricing
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fsimstudioai%2Fsim%2Fpull%2F5405%2Ffiles
Sign uphttps://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fpull_requests%2Fshow%2Ffiles&source=header-repo&source_repo=simstudioai%2Fsim
Reloadhttps://github.com/simstudioai/sim/pull/5405/files
Reloadhttps://github.com/simstudioai/sim/pull/5405/files
Reloadhttps://github.com/simstudioai/sim/pull/5405/files
simstudioaihttps://github.com/simstudioai
simhttps://github.com/simstudioai/sim
Codehttps://github.com/simstudioai/sim
Issues129 (129)https://github.com/simstudioai/sim/issues
Pull requests197 (197)https://github.com/simstudioai/sim/pulls
Actionshttps://github.com/simstudioai/sim/actions
Projectshttps://github.com/simstudioai/sim/projects
Security and qualityhttps://github.com/simstudioai/sim/security
Insightshttps://github.com/simstudioai/sim/pulse
Sign up for GitHub https://github.com/signup?return_to=%2Fsimstudioai%2Fsim%2Fissues%2Fnew%2Fchoose
terms of servicehttps://docs.github.com/terms
privacy statementhttps://docs.github.com/privacy
Sign inhttps://github.com/login?return_to=%2Fsimstudioai%2Fsim%2Fissues%2Fnew%2Fchoose
waleedlatif1https://github.com/waleedlatif1
staginghttps://github.com/simstudioai/sim/tree/staging
feat/credit-usage-pagehttps://github.com/simstudioai/sim/tree/feat/credit-usage-page
Conversation 42 https://github.com/simstudioai/sim/pull/5405
Commits 17 https://github.com/simstudioai/sim/pull/5405/commits
Checks 17 https://github.com/simstudioai/sim/pull/5405/checks
Files changed https://github.com/simstudioai/sim/pull/5405/files
Please reload this pagehttps://github.com/simstudioai/sim/pull/5405/files
feat(billing): dedicated Credit usage page with date-range filter and CSV export https://github.com/simstudioai/sim/pull/5405/files#top
Show all changes 17 commits https://github.com/simstudioai/sim/pull/5405/files
fa8abc0 fix(billing): apportion per-row credit costs so they sum to the page … waleedlatif1 Jul 3, 2026 https://github.com/simstudioai/sim/pull/5405/commits/fa8abc0a4c2c0ee0eb348d88540941ba69340bd0
06a4c14 fix(billing): dim stale credit usage rows while a new period loads waleedlatif1 Jul 3, 2026 https://github.com/simstudioai/sim/pull/5405/commits/06a4c1420e416ee0a24101efb9c21f707139065b
eb26a01 fix(billing): show "<1 credit" for rows apportioned to 0 waleedlatif1 Jul 3, 2026 https://github.com/simstudioai/sim/pull/5405/commits/eb26a010e05c9da0c3a27fa93abbc2fff384ecf4
fa73ea2 fix(audit-logs): fix broken Custom range picker, trim time-range presets waleedlatif1 Jul 3, 2026 https://github.com/simstudioai/sim/pull/5405/commits/fa73ea21f18d060156e17f42b9077d3c09c08694
3c37391 feat(billing): dedicated Credit usage page with date-range filter and… waleedlatif1 Jul 3, 2026 https://github.com/simstudioai/sim/pull/5405/commits/3c373919c9bdf0a9b0baad088f93a854850df4b9
762b34d refactor(billing): move workflow-name enrichment into getUserUsageLog… waleedlatif1 Jul 3, 2026 https://github.com/simstudioai/sim/pull/5405/commits/762b34dbd847065701de242e65df23c873231d4a
46beb8a fix(billing): drop Dollar cost from the CSV export, strip inline comm… waleedlatif1 Jul 3, 2026 https://github.com/simstudioai/sim/pull/5405/commits/46beb8a9c93707dd1ae7cab3fcd3320e583aaac8
2871234 fix(billing): export honors partial custom date range, surfaces trunc… waleedlatif1 Jul 3, 2026 https://github.com/simstudioai/sim/pull/5405/commits/28712340fd1e5c9b4c60022e3cee6d78673a35b7
d1dcf6c fix(billing): remove the export's arbitrary row cap, fix a cursor pag… waleedlatif1 Jul 3, 2026 https://github.com/simstudioai/sim/pull/5405/commits/d1dcf6ced540a76d948663609d78f44d64fcc6a2
7f97f31 perf(billing): skip the redundant cursor lookup when the caller alrea… waleedlatif1 Jul 4, 2026 https://github.com/simstudioai/sim/pull/5405/commits/7f97f31ae8354f2edfcff5017bb023cbf75a2bb7
02c5f39 fix(billing): apportion credits over the whole filtered set, not per … waleedlatif1 Jul 4, 2026 https://github.com/simstudioai/sim/pull/5405/commits/02c5f393f18f88b1ffdfe1c1fbc0747842ad9afe
b91d2b7 fix(billing): make custom-range startDate/endDate nullable, not '' de… waleedlatif1 Jul 4, 2026 https://github.com/simstudioai/sim/pull/5405/commits/b91d2b7e49b25e20f14825cc6e7286734b502a3a
55f2bd5 feat(audit-logs): add CSV export, matching the Credit usage page pattern waleedlatif1 Jul 4, 2026 https://github.com/simstudioai/sim/pull/5405/commits/55f2bd5c3703e3d45e85786f2c5fb11554b5de50
bd67ebd fix(billing): skip wasted credit apportionment on the summary fetch, … waleedlatif1 Jul 4, 2026 https://github.com/simstudioai/sim/pull/5405/commits/bd67ebd226d7923c78d94d794503c58bff4ed288
447c404 fix(billing): deterministic apportionment order, block audit export d… waleedlatif1 Jul 4, 2026 https://github.com/simstudioai/sim/pull/5405/commits/447c404711a4d537fd0348ff7db554041e8568a5
ecf5505 fix(billing): distinguish a failed summary fetch from zero usage waleedlatif1 Jul 4, 2026 https://github.com/simstudioai/sim/pull/5405/commits/ecf550546c4fc18a655debc78220ce9fd28f0033
17a5a73 fix(billing): gate the credit-usage page server-side for enterprise a… waleedlatif1 Jul 4, 2026 https://github.com/simstudioai/sim/pull/5405/commits/17a5a733cd48958085610f015f7e89b89983a2e0
Clear filters https://github.com/simstudioai/sim/pull/5405/files
Please reload this pagehttps://github.com/simstudioai/sim/pull/5405/files
Please reload this pagehttps://github.com/simstudioai/sim/pull/5405/files
route.test.ts https://github.com/simstudioai/sim/pull/5405/files#diff-2274c95070c222be2020dab7e295d302e3d4b865f3360323729a01563567df53
route.ts https://github.com/simstudioai/sim/pull/5405/files#diff-5e98ceffcd027f140dbc0c3aaab70d6d696a1eac21084385d37f4d412058f61f
route.test.ts https://github.com/simstudioai/sim/pull/5405/files#diff-cd0c3143caaf0b8c2d5586d0d49f304cf9eeb6ba02d8a6da6565bb3dc6408223
route.ts https://github.com/simstudioai/sim/pull/5405/files#diff-a182c2e3195b913c91932182db594a419e4f8baebbd68b1294389a4415b1691e
route.test.ts https://github.com/simstudioai/sim/pull/5405/files#diff-c6daba81898b05fc6528f565b9b54f0e72df1c325b38c96eddca6c6d739d6bda
route.ts https://github.com/simstudioai/sim/pull/5405/files#diff-cf6594bc836e0467225a295652edaa1262db61c96877ad5e54f40cb20141a8b2
shared.test.ts https://github.com/simstudioai/sim/pull/5405/files#diff-a79a9f20439d4c1c361ff58212ec3ffd09b72bd316187af948d0b0c4c8c04f4c
shared.ts https://github.com/simstudioai/sim/pull/5405/files#diff-1d0439f068c89e20237b7b4d47ac60c028911bfca98f5bda0b06e619ca1c105c
source-labels.ts https://github.com/simstudioai/sim/pull/5405/files#diff-733aed03e23dc3a1b4d4c2d01c9f791638e6ab0902203c642a9ef0ac61200e3f
credit-usage-view.tsx https://github.com/simstudioai/sim/pull/5405/files#diff-f319ffb6ea27d8655c1c9e87d7414a22358c7ee06393ba9c9c306dedac9b3414
loading.tsx https://github.com/simstudioai/sim/pull/5405/files#diff-3c2b4b431443dfdaf7a3fc179dc1e797271b0db14ebe424189926be5809307ee
page.tsx https://github.com/simstudioai/sim/pull/5405/files#diff-b13ad821137ec97020ba21b5d0dd5689b254b7be9862e79daa09c3071e904a5e
search-params.ts https://github.com/simstudioai/sim/pull/5405/files#diff-a800b87fd0367e7bdb19b44270d40cf6b5ded2385657c9817608052df4bc3be3
billing.tsx https://github.com/simstudioai/sim/pull/5405/files#diff-5a770c74f88345385869bb952d7a941e36e835610ffde3adc76fba3d1890fc3e
credit-usage-section.tsx https://github.com/simstudioai/sim/pull/5405/files#diff-e59215ea28b0d3776fb7b9942afdac2a833ad551504bf715f5ec0fd196e77693
search-params.ts https://github.com/simstudioai/sim/pull/5405/files#diff-f94e30f03446cc4b3f24cf20ac141aa3b6c80107245aa3fc4c17dde06f5034e6
audit-logs.tsx https://github.com/simstudioai/sim/pull/5405/files#diff-edd0e08465ab24f8c11e8c139a7d64699e3bd9c7f1b3a93746d0dd49a89d7dae
usage-logs.ts https://github.com/simstudioai/sim/pull/5405/files#diff-de41c517ecfb67fab20addf714dbcd875417f886604f2e937e419d79a696aa2e
usage-log-keys.ts https://github.com/simstudioai/sim/pull/5405/files#diff-49b315271acb77f7aed384287e0679b922a770977d13419670f982ecef8f4a28
audit-logs.ts https://github.com/simstudioai/sim/pull/5405/files#diff-8f892872163a9565eec186e4c1c378131517faad208c3a80c98a83badfb76f72
user.ts https://github.com/simstudioai/sim/pull/5405/files#diff-095f7a2d1473a6ce47da4b69d1c8ded6cf538a9c9a9f8d2957dc5539d16b827c
usage-log.ts https://github.com/simstudioai/sim/pull/5405/files#diff-61e17bbb06140b8753417feb8b60df7a9170f3216b76d314f14d5210cb9e8431
conversion.ts https://github.com/simstudioai/sim/pull/5405/files#diff-a78dd2f0a11c28316a437ed2c6ddf40af3525e27435a72e6a3291511a75217f1
chip-select.tsx https://github.com/simstudioai/sim/pull/5405/files#diff-8ca4389ea32f9746ed016b616d9240ede1e3524b2045799f0dea18cacdebbb0e
check-api-validation-contracts.ts https://github.com/simstudioai/sim/pull/5405/files#diff-48ae6a4d0c1f820d5b644522d25742bb29af758bc8350f1a3cf3f8afa0bd00b0
apps/sim/app/api/audit-logs/export/route.test.tshttps://github.com/simstudioai/sim/pull/5405/files#diff-2274c95070c222be2020dab7e295d302e3d4b865f3360323729a01563567df53
View file https://github.com/simstudioai/sim/blob/17a5a733cd48958085610f015f7e89b89983a2e0/apps/sim/app/api/audit-logs/export/route.test.ts
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/simstudioai/sim/pull/5405/{{ revealButtonHref }}
apps/sim/app/api/audit-logs/export/route.tshttps://github.com/simstudioai/sim/pull/5405/files#diff-5e98ceffcd027f140dbc0c3aaab70d6d696a1eac21084385d37f4d412058f61f
View file https://github.com/simstudioai/sim/blob/17a5a733cd48958085610f015f7e89b89983a2e0/apps/sim/app/api/audit-logs/export/route.ts
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/simstudioai/sim/pull/5405/{{ revealButtonHref }}
Please reload this pagehttps://github.com/simstudioai/sim/pull/5405/files
Please reload this pagehttps://github.com/simstudioai/sim/pull/5405/files
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.