feat: add feature name to microdollar usage rows#369
Open
kiloconnect[bot] wants to merge 1 commit intomainfrom
Open
feat: add feature name to microdollar usage rows#369kiloconnect[bot] wants to merge 1 commit intomainfrom
kiloconnect[bot] wants to merge 1 commit intomainfrom
Conversation
Join the feature lookup table via microdollar_usage_metadata to expose the feature name (e.g. vscode-extension, jetbrains-extension, cli, etc.) in usage rows for both user-level and organization-level usage endpoints. Changes: - User usage API (GET /api/profile/usage): LEFT JOIN metadata + feature tables, add feature to select/groupBy - Org usage details router (get endpoint): LEFT JOIN metadata + feature tables, add feature to select/groupBy/response schema - UsageDetailByDay type: add optional feature field - User usage page: add Feature column to table - Org usage table hook: add Feature column to table and expanded rows - CSV export: add Feature column
Contributor
Author
Code Review SummaryStatus: 1 Issue Found | Recommendation: Address before merge Overview
Other Observations (not in diff)Issues found in unchanged code that cannot receive inline comments:
Files Reviewed (6 files)
|
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
Add the
featurename (e.g.vscode-extension,jetbrains-extension,cli,slack,kilo-claw,cloud-agent,code-review, etc.) to the usage rows exposed to users, for both organization-level and user-level usage.The
feature_idalready exists inmicrodollar_usage_metadata, linking to thefeaturelookup table. This PR joins through that relationship to surface the feature name in the API responses and usage tables.Changes
Backend
src/app/api/profile/usage/route.ts— User-level usage API: LEFT JOINmicrodollar_usage_metadata+featuretables, addfeatureto select fields and GROUP BYsrc/routers/organizations/organization-usage-details-router.ts— Org-level usagegetendpoint: LEFT JOINmicrodollar_usage_metadata+featuretables, addfeatureto select/groupBy/response schemaTypes
src/lib/organizations/organization-types.ts— Add optionalfeaturefield toUsageDetailByDayFrontend
src/app/(app)/usage/page.tsx— Add Feature column to user-level usage tablesrc/components/organizations/usage-details/hooks/useUsageTableData.tsx— Add Feature column to org usage table (parent + expanded child rows)src/components/organizations/usage-details/utils/csvExport.ts— Add Feature column to CSV exportTesting
pnpm typecheckpasses cleanlyBuilt for Brendan by Kilo for Slack