mirror of
https://github.com/compiler-explorer/compiler-explorer.git
synced 2025-12-27 09:23:52 -05:00
Update claude explain configuration (#8069)
This commit is contained in:
@@ -73,6 +73,8 @@ function setupClaudeExplainEnvironment() {
|
||||
// Set up configuration
|
||||
cy.visit('/', {
|
||||
onBeforeLoad: (win: any) => {
|
||||
// TODO remove this when we make claude explain generally available.
|
||||
win.localStorage.setItem('claudeExplainTest', 'enabled');
|
||||
stubConsoleOutput(win);
|
||||
win.compilerExplorerOptions = win.compilerExplorerOptions || {};
|
||||
win.compilerExplorerOptions.explainApiEndpoint = 'http://test.localhost/fake-api/explain';
|
||||
|
||||
@@ -18,6 +18,7 @@ rescanCompilerSecs=3600
|
||||
sentryDsn=https://8e4614f649ad4e3faf3e7e8827b935f9@sentry.io/102028
|
||||
motdUrl=/motd/motd-prod.json
|
||||
pageloadUrl=https://lambda.compiler-explorer.com/pageload
|
||||
explainApiEndpoint=https://api.compiler-explorer.com/explain
|
||||
storageSolution=s3
|
||||
healthCheckFilePath=/efs/.health
|
||||
showSponsors=true
|
||||
|
||||
@@ -3,6 +3,3 @@ httpRoot=/beta
|
||||
storageSolution=s3
|
||||
motdUrl=/motd/motd-beta.json
|
||||
sentryEnvironment=beta
|
||||
|
||||
# Claude Explain API endpoint, for beta
|
||||
explainApiEndpoint=https://api.compiler-explorer.com/explain
|
||||
|
||||
@@ -52,6 +52,7 @@ import * as Components from '../components.js';
|
||||
import {createDragSource} from '../components.js';
|
||||
import {Hub} from '../hub.js';
|
||||
import * as LibUtils from '../lib-utils.js';
|
||||
import {localStorage} from '../local.js';
|
||||
import * as monacoConfig from '../monaco-config.js';
|
||||
import {LanguageLibs} from '../options.interfaces.js';
|
||||
import {options} from '../options.js';
|
||||
@@ -971,7 +972,8 @@ export class Compiler extends MonacoPane<monaco.editor.IStandaloneCodeEditor, Co
|
||||
this.initToolButtons();
|
||||
|
||||
// Hide Claude Explain button if no API endpoint is configured
|
||||
if (!options.explainApiEndpoint) {
|
||||
// Or, temporarily, unless the user has manually opted in. TODO fix up the hack in UI tests too when we turn on.
|
||||
if (!options.explainApiEndpoint || localStorage.get('claudeExplainTest', '') !== 'enabled') {
|
||||
this.explainButton.hide();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user