Skip to content

Commit dbd6249

Browse files
committed
feat(ai): add usage value controls and update Pro pin
1 parent 869b252 commit dbd6249

4 files changed

Lines changed: 55 additions & 13 deletions

File tree

‎src-node/package-lock.json‎

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎src/nls/root/strings.js‎

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2898,22 +2898,29 @@ define({
28982898
"AI_CHAT_USAGE_SPEND_NO_PRO_CHARGE": "You won’t be charged this amount by Phoenix Pro.",
28992899
"AI_CHAT_USAGE_OPTION_TURNS": "Show usage after every turn",
29002900
"AI_CHAT_USAGE_OPTION_DOLLARS": "Show $ cost",
2901+
"AI_CHAT_USAGE_SHOW_COST": "Show AI cost estimates",
2902+
"AI_CHAT_USAGE_HIDE_COST": "Hide AI cost estimates",
2903+
"AI_CHAT_USAGE_SHOW_COST_TITLE": "Show AI cost estimates?",
2904+
"AI_CHAT_USAGE_SHOW_COST_COVERED": "If you use a Claude or ChatGPT subscription, these costs are already covered by your subscription.",
2905+
"AI_CHAT_USAGE_SHOW_COST_VALUE": "Turning this on won’t add anything to your bill. It only shows the value of your usage at API prices.",
2906+
"AI_CHAT_USAGE_SHOW_COST_NOTE": "API keys and paid extra usage can still incur charges.",
2907+
"AI_CHAT_USAGE_SHOW_COST_CONFIRM": "Show $ value",
29012908
"AI_CHAT_USAGE_CARD_TITLE": "Usage",
29022909
"AI_CHAT_USAGE_RANGE_30": "{0} \u00b7 last 30 days",
29032910
"AI_CHAT_USAGE_DETAILS": "Details",
29042911
"AI_CHAT_USAGE_RELOAD": "Reload usage",
29052912
"AI_CHAT_USAGE_MONTHS_SHOWN": "{0} of {1} months",
29062913
"AI_CHAT_USAGE_LESS": "Less",
29072914
"AI_CHAT_USAGE_MORE": "More",
2908-
"AI_CHAT_USAGE_SPEND": "spend",
2915+
"AI_CHAT_USAGE_SPEND": "value",
29092916
"AI_CHAT_USAGE_TOKENS_LABEL": "tokens",
29102917
"AI_CHAT_USAGE_TURNS_LABEL": "turns",
29112918
"AI_CHAT_USAGE_ACTIVE_DAYS": "active days",
29122919
"AI_CHAT_USAGE_TODAY": "Today",
29132920
"AI_CHAT_USAGE_TOP_MODELS": "Top models",
29142921
"AI_CHAT_USAGE_SEE_MORE": "See more",
29152922
"AI_CHAT_USAGE_SEE_LESS": "See less",
2916-
"AI_CHAT_USAGE_BY_SPEND": "by spend",
2923+
"AI_CHAT_USAGE_BY_SPEND": "by value",
29172924
"AI_CHAT_USAGE_BY_TOKENS": "by tokens",
29182925
"AI_CHAT_USAGE_ACTIVITY": "Activity",
29192926
"AI_CHAT_USAGE_LAST_30_DAYS": "Last 30 days",

‎src/styles/Extn-AIChatPanel.less‎

Lines changed: 42 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6655,18 +6655,20 @@
66556655
.ai-usage-card-head {
66566656
display: flex;
66576657
align-items: center;
6658-
gap: 8px;
6658+
gap: 0;
66596659
margin-bottom: 10px;
66606660
min-width: 0;
66616661
}
66626662

66636663
.ai-usage-card-title {
6664+
margin-right: 8px;
66646665
font-size: @ai-text-body;
66656666
font-weight: 600;
66666667
}
66676668

66686669
/* The one header item that may give way in a narrow panel. */
66696670
.ai-usage-card-range {
6671+
margin-right: 8px;
66706672
font-size: @ai-text-meta;
66716673
color: @project-panel-text-2;
66726674
padding: 2px 6px;
@@ -6685,15 +6687,14 @@
66856687
}
66866688
}
66876689

6688-
/* Other Phoenix windows write the same ledger; this reads it again. */
6690+
.ai-usage-card-cost,
66896691
.ai-usage-card-reload {
6690-
margin-left: auto;
66916692
flex-shrink: 0;
66926693
display: inline-flex;
66936694
align-items: center;
66946695
justify-content: center;
6695-
width: 20px;
6696-
height: 20px;
6696+
width: 22px;
6697+
height: 22px;
66976698
border-radius: 4px;
66986699
font-size: 11px;
66996700
color: fade(@project-panel-text-2, 80%);
@@ -6704,11 +6705,32 @@
67046705
background: rgba(255, 255, 255, 0.06);
67056706
}
67066707

6707-
&.ai-usage-reloading i {
6708-
animation: ai-usage-spin 0.7s linear infinite;
6708+
&:focus-visible {
6709+
outline: 2px solid @project-panel-text-2;
6710+
outline-offset: 2px;
67096711
}
67106712
}
67116713

6714+
.ai-usage-card-cost {
6715+
margin-left: auto;
6716+
padding: 0;
6717+
border: 0;
6718+
background: transparent;
6719+
box-shadow: none;
6720+
font-family: inherit;
6721+
font-size: 15px;
6722+
font-weight: 600;
6723+
6724+
&:hover {
6725+
background: transparent;
6726+
}
6727+
}
6728+
6729+
/* Other Phoenix windows write the same ledger; this reads it again. */
6730+
.ai-usage-card-reload.ai-usage-reloading i {
6731+
animation: ai-usage-spin 0.7s linear infinite;
6732+
}
6733+
67126734
.ai-usage-card-toggle {
67136735
margin-left: 6px;
67146736
flex-shrink: 0;
@@ -7047,6 +7069,19 @@
70477069
}
70487070
}
70497071

7072+
.modal.ai-usage-cost-dialog {
7073+
width: 480px;
7074+
max-width: calc(100vw - 48px);
7075+
7076+
.modal-body {
7077+
font-size: 14px;
7078+
line-height: 1.6;
7079+
7080+
p { margin: 0 0 12px; }
7081+
.ai-usage-cost-note { margin-bottom: 0; font-size: 12px; opacity: 0.8; }
7082+
}
7083+
}
7084+
70507085
.ai-usage-delete-dialog {
70517086
width: 460px;
70527087
max-width: calc(100vw - 32px);

‎tracking-repos.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
22
"phoenixPro": {
3-
"commitID": "4af8116dd7ba98ddfd5dfc933e9fb83d976ff095"
3+
"commitID": "74dd024b104ab0edb4bdcdfed820a8c1bf9ef85a"
44
}
55
}

0 commit comments

Comments
 (0)