-
Notifications
You must be signed in to change notification settings - Fork 646
feat(gui): show public combo model name with one-click copy #1164
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: dev
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| /** Placeholder shown before the draft id/alias can form a public model id. */ | ||
| export const PUBLIC_MODEL_PREVIEW_PLACEHOLDER = "…"; | ||
|
|
||
| /** True when the preview value is a real public model id clients can request. */ | ||
| export function canCopyPublicModelId(model: string): boolean { | ||
| return model.trim().length > 0 && model !== PUBLIC_MODEL_PREVIEW_PLACEHOLDER; | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -1749,6 +1749,9 @@ export const en = { | |
| "cws.allCombos": "All combos", | ||
| "cws.copyModel": "Copy id", | ||
| "cws.copied": "Copied", | ||
| "cws.copiedPublicModel": "Copied", | ||
| "cws.copyPublicModel": "Copy", | ||
| "cws.copyUnavailable": "Clipboard unavailable", | ||
| "cws.tab.config": "Config", | ||
| "cws.tab.about": "About", | ||
| "cws.strategy": "Strategy", | ||
|
|
@@ -1757,12 +1760,13 @@ export const en = { | |
| "cws.strategy.failoverHint": "Try targets in order. If the first fails with a retryable error (rate limit, outage, subscription gate), hop to the next.", | ||
| "cws.strategy.roundRobinHint": "Deterministically balance traffic by weight. Keep each selected target for a batch of successful requests, then advance.", | ||
| "cws.field.id": "Combo id", | ||
| "cws.field.idHint": "Clients will request {model}", | ||
| "cws.field.idInternalHint": "Internal combo id. You can change it after creation.", | ||
| "cws.field.idHintEdit": "Renaming moves the combo to a new id. Clients request {model}.", | ||
| "cws.field.idHint": "Clients request: {model}", | ||
| "cws.field.idInternalHint": "Internal id for this combo. When no public model name is set, clients use combo/<id>.", | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Changing this source string leaves the existing empty-workspace test asserting the old helper copy ( AGENTS.md reference: gui/AGENTS.md:L42-L50 Useful? React with 👍 / 👎. |
||
| "cws.field.idHintEdit": "Changing the id renames the combo. When no public model name is set, clients use combo/<id>.", | ||
| "cws.field.alias": "Public model name", | ||
| "cws.field.aliasPlaceholder": "deepseek-v4-flash or vendor/model", | ||
| "cws.field.aliasHint": "Optional. Use a bare name with no prefix, a custom prefix like vendor/model, or leave blank to use combo/<id>.", | ||
| "cws.field.aliasHint": "Optional override for the name clients request. Use a bare name, a custom prefix like vendor/model, or leave blank for combo/<id>.", | ||
| "cws.field.publicModelPreview": "Clients request: {model}", | ||
|
Comment on lines
+1763
to
+1769
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win 🧩 Analysis chain🏁 Script executed: #!/bin/bash
# Description: Confirm cws.field.idHint has no remaining callers in the GUI source before deleting it everywhere.
rg -n '"cws\.field\.idHint"' gui/src
rg -nP 't\(\s*"cws\.field\.idHint"' gui/srcRepository: lidge-jun/opencodex Length of output: 587 🏁 Script executed: #!/bin/bash
set -euo pipefail
echo "== i18n locale files =="
git ls-files 'gui/src/i18n/*.ts' | sort
echo
echo "== duplicate-text candidates around cws.field keys in each locale =="
python3 - <<'PY'
import os, pathlib, re
files = sorted(pathlib.Path('gui/src/i18n').glob('*.ts'))
for pat in ['en', 'de', 'ja', 'ko', 'ru', 'zh']:
for f in files:
if f.stem != pat:
continue
txt = f.read_text(encoding='utf-8')
keys = ['cws.field.idHint','cws.field.publicModelPreview','cws.field.idInternalHint','cws.field.idHintEdit','cws.field.alias','cws.field.aliasPlaceholder','cws.field.aliasHint']
print(f"\n{f}")
for key, line in [(key, txt.splitlines()[i].strip()) for i, line in enumerate(txt.splitlines(), 1) if key in line and 'cws.field.' in line][:7]:
pass
# print lines containing target keys and nearby keys for context
for i, line in enumerate(txt.splitlines(), 1):
if any(k in line for k in keys):
print(f"{i:<4} {line}")
PY
echo
echo "== call sites for cws.field.idHint via common UI i18n helpers =="
rg -n '(\buseI18n|useTranslation|i18n\.)\(([^)]*idHint|[^)]*publicModelPreview|[^)]*idInternalHint|[^)]*idHintEdit)[^)]*|t\(\s*["\047]cws\.field\.(idHint|publicModelPreview|idInternalHint|idHintEdit|alias)(["\047])' gui/src || true
echo
echo "== broader idHint/publicModelPreview text matches (excludes i18n definitions) =="
rg -n --glob '!gui/src/i18n/*.ts' 'idHint|publicModelPreview|Clients request: \{model\}|Clients 要求|クライアントのリクエスト|클라이언트 요청|Клиенты запрашивают' gui/src || trueRepository: lidge-jun/opencodex Length of output: 582 🏁 Script executed: #!/bin/bash
set -euo pipefail
echo "== i18n locale files =="
git ls-files 'gui/src/i18n/*.ts' | sort
echo
echo "== target cws.field keys in each locale =="
for f in gui/src/i18n/en.ts gui/src/i18n/de.ts gui/src/i18n/ja.ts gui/src/i18n/ko.ts gui/src/i18n/ru.ts gui/src/i18n/zh.ts; do
echo "-- $f --"
git -C "$(dirname "$f")" grep -n -e '"cws\.field\.idHint"' -e '"cws\.field\.publicModelPreview"' -e '"cws\.field\.idInternalHint"' -e '"cws\.field\.idHintEdit"' "$f" || true
done
echo
echo "== call sites for cws.field.idHint in GUI source (excluding i18n locale definitions) =="
rg -n --glob '!gui/src/i18n/*.ts' 'cws\.field\.idHint|cws\.field\.publicModelPreview|cws\.field\.idInternalHint|cws\.field\.idHintEdit|t\(' gui/src || true
echo
echo "== static text matches outside i18n locale definitions =="
rg -n --glob '!gui/src/i18n/*.ts' 'Clients request: \{model\}|Clients fordern an: \{model\}|クライアントのリクエスト: \{model\}|클라이언트 요청: \{model\}|Клиенты запрашивают: \{model\}|客户端请求:\{model\}|Clients request|publicModelPreview' gui/src || trueRepository: lidge-jun/opencodex Length of output: 50376 🏁 Script executed: #!/bin/bash
set -euo pipefail
echo "== cws.field target key definitions by locale =="
for f in gui/src/i18n/en.ts gui/src/i18n/de.ts gui/src/i18n/ja.ts gui/src/i18n/ko.ts gui/src/i18n/ru.ts gui/src/i18n/zh.ts; do
echo "-- $f --"
rg -n '"cws\.field\.(idHint|publicModelPreview|idInternalHint|idHintEdit)"' "$f" || true
done
echo
echo "== GUI source references to target cws.field keys outside i18n locale files =="
rg -n --glob '!gui/src/i18n/*.ts' 'cws\.field\.(idHint|publicModelPreview|idInternalHint|idHintEdit)\b' gui/src || true
echo
echo "== GUI source direct text match for publicModelPreview equivalent outside i18n locale files =="
rg -n --glob '!gui/src/i^8n/*.ts' 'Clients request: \{model\}|Clients fordern an: \{model\}|Клиенты запрашивают: \{model\}|クライアントのリクエスト: \{model\}|클라이언트 요청: \{model\}|客户端请求:\{model\}' gui/src || trueRepository: lidge-jun/opencodex Length of output: 3859 Remove the unused 📍 Affects 6 files
🤖 Prompt for AI Agents |
||
| "cws.field.stickyLimit": "Sticky successes before rotate", | ||
| "cws.field.stickyLimitHint": "Retain the selected target for this many successful requests before the weighted selector advances.", | ||
| "cws.field.defaultEffort": "Default reasoning", | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win
Extract the shared ellipsis placeholder into a named constant.
canCopyon Line 271 hardcodesmodel !== "…"to detect the placeholder value. The same"…"literal is duplicated ingui/src/components/combo-workspace-add-modal.tsx(Line 143) andgui/src/components/combo-workspace-detail-panel.tsx(Line 217). Correctness ofcanCopydepends on all three literals staying byte-for-byte identical (for example, a future edit that swaps"…"for"..."in one call site silently breaks the copy button in that view).Export a shared constant from
combo-workspace-controls.tsx(orcombo-workspace-data.ts) and import it at all three sites, so the placeholder has one source of truth.♻️ Proposed refactor
🤖 Prompt for AI Agents