Skip to content

Commit 62078b6

Browse files
committed
Update UI utilities to consistently display context keywords like "Changes" and "Saved context" with a colon and space separator
1 parent 2e07a08 commit 62078b6

4 files changed

Lines changed: 13 additions & 10 deletions

File tree

‎packages/ui/src/components/editor/panel/ChatInput/utils/get-display-text.ts‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,11 @@ export const get_display_text = (
2121
return match
2222
}
2323
if (changes_keyword) {
24-
return 'Changes'
24+
const branch_name = changes_keyword.substring('#Changes:'.length)
25+
return `Changes: ${branch_name}`
2526
}
2627
if (saved_context_keyword) {
27-
return `Saved context ${context_name}`
28+
return `Saved context: ${context_name}`
2829
}
2930
return match
3031
}

‎packages/ui/src/components/editor/panel/ChatInput/utils/get-highlighted-text.tsx‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ export const get_highlighted_text = (params: {
7171
context_name
7272
)}"><span class="${styles['keyword__icon']}"></span><span class="${
7373
styles['keyword__text']
74-
}">Saved context ${escape_html(context_name)}</span></span>`
74+
}">Saved context: ${escape_html(context_name)}</span></span>`
7575
}
7676
return process_text_part_for_files(part, params.context_file_paths)
7777
})
@@ -103,7 +103,7 @@ export const get_highlighted_text = (params: {
103103
styles['keyword__icon']
104104
}"></span><span class="${
105105
styles['keyword__text']
106-
}">Changes</span></span>`
106+
}">Changes: ${escape_html(branch_name)}</span></span>`
107107
}
108108
const saved_context_match = part.match(
109109
/^#SavedContext:(WorkspaceState|JSON)\s+"([^"]+)"$/
@@ -122,7 +122,7 @@ export const get_highlighted_text = (params: {
122122
styles['keyword__icon']
123123
}"></span><span class="${
124124
styles['keyword__text']
125-
}">Saved context ${escape_html(context_name)}</span></span>`
125+
}">Saved context: ${escape_html(context_name)}</span></span>`
126126
}
127127

128128
return process_text_part_for_files(part, params.context_file_paths)

‎packages/ui/src/components/editor/panel/ChatInput/utils/position-mapping.ts‎

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,13 +26,14 @@ export const map_display_pos_to_raw_pos = (
2626
display_match_length = filename.length
2727
is_replacement_match = true
2828
} else if (changes_keyword) {
29-
display_match_length = 'Changes'.length
29+
const branch_name = changes_keyword.substring('#Changes:'.length)
30+
display_match_length = `Changes: ${branch_name}`.length
3031
is_replacement_match = true
3132
} else if (selection_keyword) {
3233
display_match_length = 'Selection'.length
3334
is_replacement_match = true
3435
} else if (saved_context_keyword) {
35-
display_match_length = `Saved context ${context_name}`.length
36+
display_match_length = `Saved context: ${context_name}`.length
3637
is_replacement_match = true
3738
}
3839

@@ -96,13 +97,14 @@ export const map_raw_pos_to_display_pos = (
9697
display_match_length = filename.length
9798
is_replacement_match = true
9899
} else if (changes_keyword) {
99-
display_match_length = 'Changes'.length
100+
const branch_name = changes_keyword.substring('#Changes:'.length)
101+
display_match_length = `Changes: ${branch_name}`.length
100102
is_replacement_match = true
101103
} else if (selection_keyword) {
102104
display_match_length = 'Selection'.length
103105
is_replacement_match = true
104106
} else if (saved_context_keyword) {
105-
display_match_length = `Saved context ${context_name}`.length
107+
display_match_length = `Saved context: ${context_name}`.length
106108
is_replacement_match = true
107109
}
108110

‎packages/vscode/package.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "gemini-coder",
33
"displayName": "Code Web Chat",
44
"description": "AI coding without agents (CWC)",
5-
"version": "1.539.0",
5+
"version": "1.540.0",
66
"scripts": {
77
"build": "npx vsce package --no-dependencies",
88
"vscode:prepublish": "rimraf out && npm run compile",

0 commit comments

Comments
 (0)