Commit Graph
6151 Commits
Author SHA1 Message Date
t0ng7u 8b25539e18 feat(web): add text size theme axis and font license attribution
- New data-theme-text axis (sm/default/lg/xl/2xl) that overrides only the
  --text-* type ramp, composing with density and presets; config drawer
  section with per-tier "Aa" previews, cookie persistence, i18n for all
  seven locales
- Add one-line font licensing note under the font picker linking Public
  Sans, Lora, and JetBrains Mono sources and the SIL OFL 1.1 license text
2026-07-12 19:03:11 +08:00
t0ng7u 384928c49a feat(web): add badge size theme axis and polish mobile log cards and skeletons
- New data-theme-badge axis (default/lg/xl, site default lg) with config
  drawer section, cookie persistence, and unlayered CSS overrides; unpin
  h-5! on model badge so the setting takes effect
- Right-align and unify type ramp of compound cells inside mobile log
  card rows via in-data-[slot=data-table-card-value] variants
- Fix skeleton overflow on narrow screens at call sites (min-w-0,
  shrink-0, max-w-full) and mirror real toolbar/stat layouts
- Show theme settings trigger on mobile header
2026-07-12 18:28:07 +08:00
t0ng7u ed134bbd2b refactor(web): rework usage-logs date range picker and unify status row styling
- Replace native datetime-local inputs with a shadcn Calendar range picker:
  preset rail (today/7d/this~last week/30d/this~last month), dual-month
  desktop view, themed time inputs, fresh-range reselect, no outside days
- Default log time range now covers the whole current day (00:00-23:59:59)
- Fix range highlight invisible inside popovers (muted -> accent) and mark
  today by primary text instead of a fill that mimicked selection
- Extract shared calendar locale map (adds zh-TW) for all date pickers
- Generalize disabled-row treatment into status row palettes (error/info/
  warning) and apply them to usage-logs desktop rows and mobile cards
- Split "Earned this month" from "This month" i18n key to stop the check-in
  card translation leaking into date presets
2026-07-12 16:49:22 +08:00
t0ng7u 7c3e2cc66f refactor(web): inline retry chain and polish model mapping popover in usage logs
Show the retry chain as compact grey inline text next to the channel
badge (middle-collapsed beyond three hops, full chain in the tooltip)
instead of hiding it behind a popover icon. Move the model-mapping route
marker inside the badge's trailing icon slot, size the mapping popover
to its content, and make both model names copyable. Group ratio now
hides together with the group name when sensitive info is masked.
2026-07-12 15:53:15 +08:00
t0ng7u 135628a5cb refactor(web): move timing column next to stream column in usage logs 2026-07-12 15:34:26 +08:00
t0ng7u 31b6832314 refactor(web): make identity tints theme-aware and restore colorful default preset
Derive --color-identity-* tokens from theme palette variables (chart and
status hues) instead of fixed oklch hues, so group names, channel ids and
model badges re-tint automatically when a color preset overrides the
palette. The monochrome simple-large preset collapses identity tints to
the foreground via --identity-color-mix: 0%.

Also port main's blue default palette (light/dark), preview the default
preset as a rainbow swatch, and show the token group as a tinted
GroupBadge on the usage-logs page.
2026-07-12 15:30:25 +08:00
t0ng7u fdcd86c851 fix(web): repair UI-refactor regressions via design-system layer
Rework the earlier dropdown onSelect bridge: keep components/ui pristine
and use Base UI's native closeOnClick={false} + onClick at the nine menu
item call sites instead. Move product policies dropped by the refactor
into the design-system adapters: Button restores nativeButton detection
for render={<Link/>}, Select restores the mobile inline (no portal)
popup and the select-item-text wrapping slot.

Also restore behaviors lost in the refactor: page-size preference falls
back to and mirrors the legacy classic-theme key, background refresh
blocks interaction with stale rows again, pricing table rows are
keyboard accessible, and the pricing card grid resets to page 1 when
filters change.
2026-07-12 03:23:42 +08:00
t0ng7u baf668c48d fix(web): restore DropdownMenuItem onSelect bridge and add missing Internal ID locale key
The design-system consolidation refactor dropped the onSelect-to-onClick
bridge for Base UI menu items, silently breaking menu actions such as
'Delete All Disabled' on the channels page, and removed the 'Internal ID'
translation key still used by the task details dialog.
2026-07-12 02:58:56 +08:00
t0ng7u bff42764f4 Merge remote-tracking branch 'origin/main' into refactor/ui 2026-07-12 00:24:45 +08:00
同語 7c28993f6b fix: list only channel models in unset price models tab (#6126)
Merge pull request #6126 from feitianbubu/fix/unset-tab-channel-models-only
2026-07-12 00:24:17 +08:00
t0ng7u 98b87a9273 refactor(web): redesign auth pages with flat layout and unified xl controls 2026-07-12 00:08:18 +08:00
feitianbubu 93e936f701 fix: list only channel models in unset price models tab 2026-07-11 23:41:11 +08:00
t0ng7u ef1ed0d48c Merge remote-tracking branch 'origin/main' into refactor/ui 2026-07-11 23:07:05 +08:00
t0ng7u 149fe5705d fix(web): round usage stats badge to 2 decimals for large amounts 2026-07-11 23:06:57 +08:00
CaIon bde9b2f448 fix: harden unset price models tab batch copy, feedback, and memo equality
Persist committed editor drafts to the source model during batch copy so
targets never carry pricing the source would lose, surface loading/error
states for the enabled-models query, and compare saved* props in the
visual editor memo so rows leave the unset list reliably after save.
v1.0.0-rc.21
2026-07-11 22:57:22 +08:00
t0ng7u 1a065224ac merge: adopt main unset-price models tab, keep refactor/ui responsive button sizing 2026-07-11 22:52:46 +08:00
t0ng7u d7642769e9 merge: adopt main model search status/sync filters, keep refactor/ui models columns 2026-07-11 22:50:11 +08:00
feitianbubu 8283df169e feat: add unset price models tab to model pricing settings (#6124)
* feat: add unset price models tab to model pricing settings

* feat: add unset price models tab translations
2026-07-11 22:48:02 +08:00
t0ng7u 7262b032c7 merge: adopt main cache billing fixes, keep refactor/ui sidebar badge styling 2026-07-11 22:42:19 +08:00
t0ng7u d373b24e4e style(web): apply bun format fixes 2026-07-11 22:40:43 +08:00
t0ng7u 0cf8f58421 fix(web): replace skeleton pulse with smooth GPU-friendly scan shimmer 2026-07-11 22:38:24 +08:00
CaIon 7a2b9d86e8 feat: enhance model search functionality with status and sync filters 2026-07-11 22:36:09 +08:00
CaIon 92d3c9d18f fix: bound uncached remainder by prompt-max(cached,write) and forward compact prompt_cache_key 2026-07-11 22:18:26 +08:00
t0ng7u 26144aa1d6 fix(web): truncate long task IDs so they stay inside their column
The task-log and MJ task ID cells used a w-max wrapper, so long IDs
(and the platform/action subtitle) overflowed the column and rendered
under the adjacent Cost column. Constrain the cell to the column width
and let the badge label ellipsize; the copy button still copies the
full ID.
2026-07-11 22:12:20 +08:00
t0ng7u fe6e0c8ee8 merge: adopt cache_write_tokens billing from main
Merge origin/main (48068ce92). The backend billing feature merged
cleanly; the single frontend conflict was a grid ratio tweak to the
old-design mobile log card, which does not exist in our generic
card layout, so our version is kept.
2026-07-11 21:50:23 +08:00
CaIon 48068ce923 feat: bill OpenAI cache_write_tokens at cache-creation price with zero clamp
Parse OpenAI's native cache_write_tokens (chat prompt_tokens_details /
responses input_tokens_details), bill it at the cache-creation ratio, and
clamp the uncached prompt remainder at zero since cached + cache-write can
exceed prompt_tokens. Propagate the field through chat/responses/claude
format conversions and tiered expression billing (cc variable).
2026-07-11 21:18:49 +08:00
t0ng7u dc0c45713b merge: adopt text protocol conversion feature onto refactor/ui design
Merge origin/main (c36418c86, text protocol conversion and advanced
custom routing). Backend and most frontend changes merged cleanly;
conflicts resolved with refactor/ui as the design source of truth:

- advanced-custom-editor-dialog: keep main new routing/conversion
  feature body, but use our design-system Button/Input imports and
  plain button styling; add the Badge import the new body needs
- details-dialog: adopt main isUsageBillingPathLocal helper for the
  billing path row, keep our muted icon styling
- i18n: union-merge of the new protocol-conversion keys across all
  locales
2026-07-11 20:58:42 +08:00
Calcium-Ion c36418c863 feat: enhance text protocol conversion and advanced custom routing (#5825)
* refactor: consolidate relay protocol converters

* refactor relayconvert text converters

* feat: refine relay converters and advanced custom routing

* refactor: enhance logging and add thought signature handling for Gemini requests

* refactor: enhance channel cache and pricing endpoint handling for advanced custom models

* feat: preserve billing usage semantics

* feat: add protocol-aware billing usage

* Delete useless files

* chore: update action versions in workflow files

* chore: update Docker action versions in workflow files

* fix: harden billing usage settlement and hot-path route matching

- estimate Gemini completion tokens locally when billable usageMetadata is
  prompt-only but output content was received (e.g. client aborts the stream
  before the final chunk), and rebuild the attached billing_usage as estimated
  so settlement does not bill zero output tokens
- guard NewClaudeMessagesBillingUsage against all-zero ClaudeUsage, matching
  the OpenAI/Gemini constructors, so a zero billing_usage cannot override a
  non-zero top-level usage during settlement
- cache compiled advanced-custom route model regexes; they run on the request
  hot path and were recompiled per request
- move the effectiveBillingUsage remap to PostTextConsumeQuota only, and
  document that calculateTextQuotaSummary expects remapped usage
- document the updatePricingLock -> channelSyncLock lock ordering that
  InitChannelCache/CacheUpdateChannel rely on, and the aux-struct pitfall in
  GeminiChatResponse.UnmarshalJSON
2026-07-11 20:44:12 +08:00
t0ng7u 010d56d7e4 merge: absorb main StatusBadge margin tweak without applying it
1250fb2eb adds -ml-1.5 padding compensation to the old-design logs Time
badge; our plain StatusBadge has no horizontal padding so the offset
does not apply. Style follows refactor/ui.
2026-07-11 20:33:36 +08:00
t0ng7u d19b6196a5 fix: keep our copy-state styling and port stale-instance button hiding
Amends the merge resolution: drop the duplicated copy icon/tooltip block
that main reintroduced in ApiKeyCell (ours already declares it with the
text-success token), and port the functional change from main e40061965
that hides the Delete all stale button entirely when no stale instances
exist instead of rendering it disabled.
2026-07-11 20:30:15 +08:00
t0ng7u 9232444feb merge: adopt main functional additions onto refactor/ui design system
Merge origin/main while keeping this branch as the source of truth for
UI/UX. The design-system revert (337169e0a) and StatusBadge padding
revert (1b1b23d1d) from main were absorbed without applying them; only
functional additions were ported and re-styled with our primitives:

- usage-logs: Stream/Timing column split with new TimingMetricsCell and
  StreamTpsCell (first-token latency + duration readout, t/s line),
  admin All/Only Mine view scope (useLogsViewScope), and a mobile
  filter-panel collapse toggle in DataTableFilterPanel
- keys: relative timestamps with absolute-time tooltip and stale-access
  highlight via ApiKeyTimestampCell (auto-refreshing now ticker), and
  copy button that resolves the real key on demand
- pricing: ModelBillingModeBadge distinguishing dynamic pricing from
  token/per-request billing in the Type column
- i18n: First token translations for all locales

Rejected from main: icon-badge tones, overview accent theme colors,
bespoke mobile lists (redemptions/keys), and all other styling that
conflicts with the refactor/ui design language.
2026-07-11 20:28:20 +08:00
CaIon 1250fb2eb5 fix: adjust margin for StatusBadge component in logs columns 2026-07-11 20:23:15 +08:00
t0ng7u 99ada22a83 merge: absorb main UI reverts without applying them
Records 337169e0a (revert of the design-system refactor) and 1b1b23d1d
(revert of StatusBadge padding) as merged while keeping the refactor/ui
tree unchanged. This branch is the source of truth for UI/UX design;
functional additions from main are merged separately.
2026-07-11 19:57:02 +08:00
CaIon e400619656 feat: enhance stale instance handling and update theme colors 2026-07-11 19:37:34 +08:00
t0ng7uandCursor c20682f66e fix(web): densify table rows and soften user avatars
Keep truncated cells single-line across data tables, compact oversized quota figures, and replace loud avatar gradients with identity-tint styling that matches badges.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-11 19:36:32 +08:00
CaIon 162f87925c feat: update theme colors 2026-07-11 19:25:04 +08:00
t0ng7u 2a9e35c93b feat(web): bundle web fonts and refine low-emphasis text colors
- Replace self-hosted @font-face declarations (font-display: optional) with
  direct Fontsource imports (swap), so the UI always settles on bundled
  fonts instead of staying on system fonts after first paint
- Add JetBrains Mono (@fontsource-variable/jetbrains-mono) as the built-in
  monospace face: it backs --font-mono, .font-mono utilities, and code/pre
- Add a "mono" option to the theme font axis (CSS token, ThemeFont type,
  resolver, and config drawer with live preview); default body font stays
  Public Sans, Anthropic preset keeps Lora serif
- Lighten --subtle-foreground/--faint-foreground in light mode to 60%/40%
  translucent mixes of muted-foreground so secondary metadata (log
  sub-labels, placeholders) reads properly grey; declare once since the
  var() reference resolves per light/dark mode on <html>
2026-07-11 18:39:03 +08:00
t0ng7u 7a1e94917f ♻️ refactor(web): make JetBrains Mono the default face and refine identity-colored UI
Switch the default theme typography to JetBrains Mono, wire identity colors through pricing/data views, and polish related layout/i18n.
2026-07-11 18:21:45 +08:00
CaIon 6bbddb1046 feat(timing): add timing metrics display for stream logs and enhance localization 2026-07-11 15:32:35 +08:00
CaIon 1b1b23d1d0 revert: restore StatusBadge horizontal padding
Revert 6869cd94b (perf(web): align table badge spacing).
Restores px padding on status badges so usage-log timing/duration
pills are not flush against the edges.
2026-07-11 15:04:12 +08:00
CaIon 337169e0a4 revert: undo t0ng7u UI design-system refactor
Revert the following commits:
- 308e3e347 feat(web): polish themed data views and add task log details
- b2a890e75 fix: Fontsource asset resolution across workspace layouts
- 9d1ca545e refactor(web): refine data-table cards and pricing page layout
- 0918bdb49 refactor(web): consolidate design-system primitives and responsive data views
- 262ab9312 style(web): unify design system across default frontend
2026-07-11 14:51:54 +08:00
t0ng7u ad900bbba7 Merge remote-tracking branch 'origin/main' 2026-07-11 14:30:16 +08:00
t0ng7u 308e3e347a feat(web): polish themed data views and add task log details 2026-07-11 14:30:06 +08:00
CaIon 269e4ff390 feat(image): enhance image stream handling with client disconnect logic and billing adjustments 2026-07-11 13:14:22 +08:00
CaIon d9595831bf fix(billing): improve quota handling and error reporting for pre-consume operations 2026-07-11 13:14:22 +08:00
CaIon 621927f710 fix(billing): reject saturated pre-consume quota 2026-07-11 13:14:21 +08:00
t0ng7u b2a890e755 🐛 fix: Fontsource asset resolution across workspace layouts 2026-07-11 13:02:59 +08:00
Seefs dad57a6bb8 fix: sync codex field (#6018) 2026-07-11 11:04:15 +08:00
dependabot[bot] 00f1cbb6df chore(deps): bump golang.org/x/crypto from 0.51.0 to 0.52.0 (#6096)
Bumps [golang.org/x/crypto](https://github.com/golang/crypto) from 0.51.0 to 0.52.0.
- [Commits](https://github.com/golang/crypto/compare/v0.51.0...v0.52.0)

---
updated-dependencies:
- dependency-name: golang.org/x/crypto
  dependency-version: 0.52.0
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-07-11 10:53:05 +08:00
ca971413e9 fix(web): allow user-activated top navigation for custom home iframe (#5955)
The custom home page URL iframe only allows allow-forms/allow-popups/
allow-popups-to-escape-sandbox/allow-scripts, without allow-top-navigation*.
As a result, target="_top" nav/menu links inside the (admin-configured,
trusted) embedded page cannot navigate the top-level window on desktop
browsers, while some mobile browsers still allow it via allow-popups —
causing inconsistent behavior rather than an intended restriction.

Add allow-top-navigation-by-user-activation so user-clicked top-level
links work consistently across devices. This token only permits
user-activated top navigation and does NOT grant same-origin access,
so it avoids the security concern of allow-same-origin.

Co-authored-by: 贺. <kuang@M1.local>
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-11 10:52:17 +08:00