* feat(llm-pricing): add model pricing foundation (route, permission, page shell)
* feat(llm-pricing): add listing page and table
* chore(llm-pricing): drop search + source filters from list request
The list API does not honour the q (search) and source params yet, so
the controls did nothing. Remove the search input and source dropdown
along with the params we sent, and trim useModelPricingFilters to the
URL-backed page state that pagination still needs. Currency dropdown,
tabs, table and pagination are unchanged. Filters will return once the
backend supports them.
* refactor(llm-pricing): extract getRelativeTime helper in utils
Pull the relative-time formatting out of getRelativeLastSeen into a
small local getRelativeTime helper. Kept feature-local (not in the
shared utils/timeUtils) so the LLM pricing module owns its own dayjs
config; the local relativeTime extend stays for test self-sufficiency.
* refactor(llm-pricing): drop dead NaN guard in formatPricePerMillion
Pricing fields are typed as required numbers and JSON can't carry NaN,
so Number.isNaN was unreachable. Keep the null/undefined guard as API
defensiveness (toFixed on a missing value would crash the row). Also
trims the now-redundant dayjs.extend comment.
* refactor(llm-pricing): centralize constants and shared types
Extract PAGE_SIZE, PAGE_KEY, COLUMN_COUNT and CURRENCY_OPTIONS into a
new constants.ts, and move the ModelPricingFilters contract into
types.ts. Component prop interfaces stay colocated with their
components, matching the convention in the drawer PR.
* refactor(llm-pricing): use nuqs for list pagination URL state
Replace the hand-rolled useHistory + URLSearchParams plumbing in
useModelPricingFilters with nuqs useQueryState, matching the convention
used by the dashboards, alerts and k8s list pages. Behaviour is
unchanged: parseAsInteger.withDefault(1) keeps ?page=1 out of the URL
and history:'replace' avoids polluting the back-stack.
* refactor(llm-pricing): inline pagination, drop useModelPricingFilters
The hook had shrunk to a one-line nuqs wrapper after search/source were
removed, so inline the useQueryState call into the container and remove
the hook file plus the now-unused ModelPricingFilters type. When the
filters return (once the API honours them) they can move back into a
dedicated hook.
* feat(llm-pricing): disable currency selector (USD-only for now)
Only USD is priced today, so render the currency SelectSimple in a
disabled state pinned to USD. A disabled select can't fire onChange, so
the currency useState is dead — drop it (and the now-unused useState
import).
* refactor(llm-pricing): render model costs inside its tab + tab URL param
The listing was rendered outside the Tabs, so the tab was decorative.
Move all model-cost content (currency control, list query, table,
pagination, footer) into a ModelCostsTab component rendered as the
'Model costs' tab's children, and drive the active tab from a 'tab' URL
query param (nuqs). The container is now just the page shell. Unpriced
models stays a disabled placeholder for a later PR.
* style(llm-pricing): target @signozhq table slots, drop dead antd/leftover rules
The component uses @signozhq/ui Table/Tabs (Radix-based), not antd, so the
.ant-table-* and .ant-tabs-nav selectors never matched — the intended
uppercase/muted header styling wasn't applied. Retarget header/cell rules to
[data-slot='table-head'|'table-cell'] (no !important needed). Also remove dead
rules left over from the removed search/source/add UI (.filters-bar__search,
__source, __add, .page-header__actions) and the unused .source-badge--auto/
--override modifiers.
* fix(llm-pricing): constrain currency dropdown width, drop tab URL param
- Currency SelectSimple stretched to fill the filters bar; give it a fixed
160px width (min-width couldn't cap the trigger).
- Model costs is the only enabled tab for now, so use Tabs defaultValue
instead of a URL-backed param. Removes the nuqs tab state plus the now-unused
TAB_KEYS/TAB_QUERY_KEY constants and TabKey type.
* chore: self review changes
* fix: add skeleton loading
* refactor: self review changes
* refactor: initial prop
* fix: update styling
* fix: add comments in utils
* feat(llm-pricing): add model cost drawer and wire into listing page
* fix(llm-pricing): restrict pricing management to admins
Align the frontend write gate with the backend, which protects the
LLM pricing create/update/delete endpoints with AdminAccess (admin
only). Previously manage_llm_pricing allowed EDITOR/AUTHOR, so those
roles saw the Add/Save affordances but their writes were rejected with
a 403. Also removes the AUTHOR entry, which could never reach the page
(the route gate excludes it).
* fix(llm-pricing): read-only drawer shows View title, hides source picker
Non-managers open the drawer in view mode (write APIs are Admin-only), so:
- the heading reads "View model cost" instead of "Edit model cost"
- the Source (auto vs. override) picker is hidden, since switching source is
a manager-only action with nothing actionable for a viewer.
* refactor: form in edit / add modal
* chore: update color tokens
* fix: add error handling
* chore: update more self review changes
* chore: self review changes
* chore: self review changes
* fix: minor grammer thing
* fix: route thing
* refactor: migrate to css moduel
* refactor: migrate to css module
* refactor: migrate to css module
* refactor: migrate to tanstack table
* docs: clarify price precision comment
* chore: remove comment
* feat(llm-attribute-mapping): add attribute mapping foundation (route, permission, page shell)
* fix: css styling
* refactor: css module
* chore: remove comment
* fix: disable isDirty in case of llm pricing
* refactor: number
* feat: add search , dropdown and flag
* feat: feature flag on entire route and add mode costs tabs
* fix: add isFetchingFeatureFlags
* chore: update flag
* refactor: shell
* fix: add key to route
* feat: add flags
* chore: additional refactor
* chore: add commet in utis
* chore: self review changes
* refactor: types and other things
* refactor: types and other things
* chore: add disable on source id
* empty commit
* chore: empty commit
* fix: add demo side nav on sidenav
* chore: remove demo side nav
* refactor: update routes
* chore: remove usd selector for now
* fix: layout shift
* refactor: styles
* refactor: typography component
* refactor: more changes
* refactor: typograhy
* refactor(llm-pricing): break model-cost drawer into per-component files + tokens
Apply the CSS-module/component conventions to the drawer that came from
drawer-3:
- Move the drawer under ModelCostTabPanel/components/ModelCostDrawer/ to mirror
the ModelCostsTable structure
- Split the single 395-LOC ModelCostDrawer.module.scss into per-component
co-located modules; cross-component selectors live in shared.module.scss and
are pulled in via CSS-modules `composes`
- shared.module.scss is a composes target (parsed as plain CSS), so it is kept
flat with block comments — no SCSS nesting or // comments
- Use --text-vanilla-* (not --bg-vanilla-*) for text colors, matching the
listing code
* refactor: more changes
* refactor: styling and components
* refactor: styling and components
* chore: add a tooltip on hover
* feat: add delete confirm modal
* fix: update title
* refactor: css variables
* refactor: use signoz button and minor css update
* chore: sync table
* chore: remove extra comment
* chore: use typograpgy test in table config
* fix: minior issues
* fix: llm pricing listing
* refactor: remove extra classes
* refactor: side nav changes
* fix: update missing styles
* chore: update edit and delete options
* chore: remove extra comment
* chore: revert env changes
* chore: add enable check
* chore: remove divider
* refactor: use delete confirm dialog
* chore: remove scss file
* feat: move ui to easily accessable tabs
* feat: update test cases
* chore: update text
* chore: self review changes
* chore: self review refactor
* chore: self review changes
* chore: remove worktree
* chore: revert env.ts
* chore: add attribute mapping foundation
* refactor: basic components
* chore: update env.ts
* chore: update tests
* chore: self review changes
* chore: update test cases
* chore: remove extra comments
* refactor(llm-pricing): share toast copy via constants
* chore: use constants
* chore: redclared constants
---------
Co-authored-by: Gaurav Tewari <tewarig@users.noreply.github.com>
2026-07-08 14:12:49 +00:00
11 changed files with 179 additions and 3 deletions
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.