fix(usage): show edited connection names consistently across views
Prefer edited name over provider email/displayName in Providers and Quota Tracker; surface the provider-sourced email/display as secondary text. Keeps fallbacks for legacy or unnamed connections. Closes #1699 Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
1 parent
4078f36ced
commit
df37bb3468
3 files changed
+33
-9
No files matched your search
@@ -21,11 +21,10 @@ export const QUOTA_SORT_OPTIONS = [
|
||||
|
||||
// ─── Pure helpers ─────────────────────────────────────────────────────────────
|
||||
export function getConnectionLabel(connection) {
|
||||
const isEmail = (value) =>
|
||||
typeof value === "string" && /^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(value);
|
||||
if (isEmail(connection.email)) return connection.email;
|
||||
if (isEmail(connection.name)) return connection.name;
|
||||
return connection.name;
|
||||
return connection.name?.trim()
|
||||
|| connection.email?.trim()
|
||||
|| connection.displayName?.trim()
|
||||
|| null;
|
||||
}
|
||||
|
||||
export function getConnectionQuotaRemaining(connection, quotaData) {
|
||||
|
||||
Reference in new issue
Block a user