Skip to content

Commit fd9e87b

Browse files
committed
Update Arena chatbot integration with new selectors, model support, and wildcard URL pattern
1 parent 5e125b5 commit fd9e87b

6 files changed

Lines changed: 36 additions & 17 deletions

File tree

‎apps/browser/src/content-scripts/send-prompt-content-script/chatbots/arena.ts‎

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -41,11 +41,11 @@ export const arena: Chatbot = {
4141
footer,
4242
get_chat_turn: (f) =>
4343
f
44-
.closest('div[role="group"]')
44+
.closest('.bg-surface-primary')
4545
?.querySelector('div.prose') as HTMLElement,
4646
perform_copy: (f) => {
4747
const copy_button = f.querySelector(
48-
'button:nth-child(2)'
48+
'button:has([d="M15 9V4.6C15 4.26863 14.7314 4 14.4 4H4.6C4.26863 4 4 4.26863 4 4.6V14.4C4 14.7314 4.26863 15 4.6 15H9"])'
4949
) as HTMLElement
5050
if (!copy_button) {
5151
report_initialization_error({
@@ -62,10 +62,9 @@ export const arena: Chatbot = {
6262

6363
observe_for_responses({
6464
chatbot_name: 'Arena',
65-
is_generating: () =>
66-
!!document.querySelector('canvas[data-sentry-component="Loading"]'),
65+
is_generating: () => !!document.querySelector('ol.animate-spin'),
6766
footer_selector:
68-
'div[aria-roledescription="slide"] > div > div > div[role="presentation"]',
67+
'ol .bg-surface-primary > div:last-child > div.text-text-primary',
6968
add_buttons
7069
})
7170
}

‎apps/browser/src/manifest.json‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"name": "Autofill for Code Web Chat",
55
"short_name": "CWC",
66
"description": "Got tired with copy and paste? Enable prompt autofill!",
7-
"version": "1.99.0",
7+
"version": "1.100.0",
88
"homepage_url": "https://github.com/robertpiosik/CodeWebChat",
99
"icons": {
1010
"16": "icons/icon-16.png",
@@ -34,7 +34,7 @@
3434
"https://github.com/copilot/*",
3535
"https://grok.com/*",
3636
"https://huggingface.co/chat/",
37-
"https://arena.ai/",
37+
"https://arena.ai/*",
3838
"https://www.kimi.com/",
3939
"https://chat.mistral.ai/*",
4040
"http://openwebui/",

‎apps/editor/src/services/websocket-manager.ts‎

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -396,6 +396,12 @@ export class WebSocketManager {
396396
} else {
397397
url = 'http://openwebui/'
398398
}
399+
} else if (preset.chatbot == 'Arena') {
400+
if (preset.model) {
401+
url = `https://arena.ai/?mode=direct&model=${preset.model}`
402+
} else {
403+
url = chatbot.url
404+
}
399405
} else if (preset.chatbot == 'Gemini' && gemini_user_id) {
400406
url = `https://gemini.google.com/u/${gemini_user_id}/app`
401407
} else if (chatbot.supports_url_override && preset.newUrl) {
@@ -489,6 +495,12 @@ export class WebSocketManager {
489495
} else {
490496
url = 'http://openwebui/'
491497
}
498+
} else if (params.preset.chatbot == 'Arena') {
499+
if (params.preset.model) {
500+
url = `https://arena.ai/?mode=direct&model=${params.preset.model}`
501+
} else {
502+
url = chatbot.url
503+
}
492504
} else if (
493505
params.preset.chatbot == 'Gemini' &&
494506
gemini_user_number !== undefined &&

‎packages/shared/src/constants/chatbots.ts‎

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,12 +43,12 @@ export const CHATBOTS = {
4343
'gemini-3-pro-preview': {
4444
label: 'Gemini 3 Pro Preview',
4545
disabled_options: ['disable-thinking'],
46-
supported_reasoning_efforts: ['high', 'low']
46+
supported_reasoning_efforts: ['Low', 'High']
4747
},
4848
'gemini-3-flash-preview': {
4949
label: 'Gemini 3 Flash Preview',
5050
disabled_options: ['disable-thinking'],
51-
supported_reasoning_efforts: ['high', 'Medium', 'Low', 'Minimal']
51+
supported_reasoning_efforts: ['Minimal', 'Low', 'Medium', 'High']
5252
},
5353
'gemini-2.5-pro': {
5454
label: 'Gemini 2.5 Pro',
@@ -60,7 +60,8 @@ export const CHATBOTS = {
6060
}
6161
} as Chatbot,
6262
Arena: {
63-
url: 'https://arena.ai/'
63+
url: 'https://arena.ai/',
64+
supports_user_provided_model: true
6465
} as Chatbot,
6566
ChatGPT: {
6667
url: 'https://chatgpt.com/',
@@ -175,7 +176,14 @@ export const CHATBOTS = {
175176
supports_custom_top_p: true,
176177
supports_system_instructions: true,
177178
supports_reasoning_effort: true,
178-
supported_reasoning_efforts: ['high', 'medium', 'low', 'minimal'],
179+
supported_reasoning_efforts: [
180+
'None',
181+
'Minimal',
182+
'Low',
183+
'Medium',
184+
'High',
185+
'XHigh'
186+
],
179187
default_system_instructions: "You're a helpful coding assistant.",
180188
supported_options: {
181189
'disable-reasoning': 'Disable reasoning (for hybrid models)'

‎packages/shared/src/constants/dictionary.ts‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ export const dictionary = {
1414
) =>
1515
`All checked files in "${folder_name}" are unchanged since commit ${commit_hash}.`,
1616
NO_INTELLIGENT_UPDATE_CONFIGURATIONS_FOUND:
17-
'No "Intelligent Update" configurations found. Please add one in the settings.',
17+
'No "Intelligent Update" configurations found. Please add one in settings.',
1818
NO_SAFE_FILE_PATHS_REMAINING:
1919
'No safe file paths remaining. Operation cancelled.',
2020
NO_ACTIVE_EDITOR_FOUND: 'No active editor found.',
@@ -39,17 +39,17 @@ export const dictionary = {
3939
NO_MATCHING_FILES_FOUND_FOR_CLIPBOARD_PATHS:
4040
'No matching files found in workspace for the paths in clipboard.',
4141
NO_CODE_AT_CURSOR_CONFIGURATIONS_FOUND:
42-
'No "Code Completions" configurations found. Please add one in the settings.',
42+
'No "Code Completions" configurations found. Please add one in settings.',
4343
NO_PRUNE_CONTEXT_CONFIGURATIONS_FOUND:
44-
'No "Prune Context" configurations found. Please add one in the settings.',
44+
'No "Prune Context" configurations found. Please add one in settings.',
4545
NO_RECENT_CHANGES_TO_UNDO:
4646
'No recent changes found to undo or changes were already undone.',
4747
CONTEXT_COPIED_TO_CLIPBOARD: 'Context copied to clipboard.',
4848
CONTEXT_FROM_OPEN_EDITORS_COPIED_TO_CLIPBOARD:
4949
'Context from open editors copied to clipboard.',
5050
NO_SAVED_CONTEXTS_FOUND: 'No saved contexts found.',
5151
NO_COMMIT_MESSAGES_CONFIGURATIONS_FOUND:
52-
'No "Commit Messages" configurations found. Please add one in the settings.',
52+
'No "Commit Messages" configurations found. Please add one in settings.',
5353
NO_FILES_SELECTED_FOR_COMMIT_MESSAGE_GENERATION:
5454
'No files selected for commit message generation.',
5555
COMMIT_MESSAGE_GENERATION_CANCELLED: 'Commit message generation cancelled.',
@@ -75,7 +75,7 @@ export const dictionary = {
7575
NO_DEFAULT_INTELLIGENT_UPDATE_CONFIGURATION:
7676
'No default "Intelligent Update" configuration found. Please set one as default in the settings.',
7777
NO_EDIT_CONTEXT_CONFIGURATIONS_FOUND:
78-
'No "Edit Context" configurations found. Please add one in the settings.',
78+
'No "Edit Context" configurations found. Please add one in settings.',
7979
DELETED_CONTEXT_FROM_ALL_ROOTS: 'Deleted context.',
8080
NO_HISTORY_FOR_PROMPT_TYPE:
8181
'No history to show for the current prompt type.',

‎packages/ui/src/components/editor/panel/modals/AutoClosingModal/AutoClosingModal.stories.tsx‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ export const Default = () => {
1717
title="Initialized in the connected browser"
1818
duration={3000}
1919
on_close={handle_close}
20-
icon="success"
20+
type="success"
2121
/>
2222
) : null
2323
}

0 commit comments

Comments
 (0)