Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
54 changes: 35 additions & 19 deletions src/extensions/App.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
*/

import { useState, useEffect, useCallback } from '@wordpress/element';
import { TabPanel, Notice } from '@wordpress/components';
import { TabPanel, Notice, Button } from '@wordpress/components';
import { cog } from '@wordpress/icons';
import ChatContainer from './components/ChatContainer';
import AbilityBrowser from './components/AbilityBrowser';
import PluginAbilitiesPanel from './components/PluginAbilitiesPanel';
Expand All @@ -23,6 +24,7 @@
const [ modelReady, setModelReady ] = useState( false );
const [ webGPUError, setWebGPUError ] = useState( null );
const [ isExecuting, setIsExecuting ] = useState( false );
const [ showSettings, setShowSettings ] = useState( false );
// Track initialization phase: 'checking' during initial checks, 'loading' when auto-loading, null when done
const [ initPhase, setInitPhase ] = useState( 'checking' );
const [ initMessage, setInitMessage ] = useState(
Expand Down Expand Up @@ -216,11 +218,6 @@
title: 'Plugin Abilities',
className: 'wp-agentic-admin-tab',
},
{
name: 'settings',
title: 'Settings',
className: 'wp-agentic-admin-tab',
},
...( FEEDBACK_UPLOAD_ENABLED
? [
{
Expand Down Expand Up @@ -261,8 +258,6 @@
return <AbilityBrowser />;
case 'plugin-abilities':
return <PluginAbilitiesPanel />;
case 'settings':
return <SettingsTab />;
case 'feedback':
return <FeedbackTab />;
default:
Expand All @@ -273,17 +268,38 @@
return (
<div className="wp-agentic-admin-app">
<div className="wp-agentic-admin-main">
<TabPanel
className="wp-agentic-admin-tabs"
tabs={ tabs }
initialTabName="chat"
>
{ ( tab ) => (
<div className="wp-agentic-admin-tab-content">
{ renderTabContent( tab ) }
</div>
) }
</TabPanel>
<div className="wp-agentic-admin-tabs-wrapper">
<TabPanel
className="wp-agentic-admin-tabs"
tabs={ tabs }
initialTabName="chat"
onSelect={ () => setShowSettings( false ) }
>
{ ( tab ) => (
<div className="wp-agentic-admin-tab-content">
{ showSettings ? (
<SettingsTab />
) : (
renderTabContent( tab )
) }
</div>
) }
</TabPanel>
<Button
icon={ cog }
className={ `wp-agentic-admin-settings-toggle${
showSettings

Check failure on line 291 in src/extensions/App.jsx

View workflow job for this annotation

GitHub Actions / JS lint

Replace `⏎↹↹↹↹↹↹↹↹?·'·is-active'⏎↹↹↹↹↹↹↹↹` with `·?·'·is-active'·`
? ' is-active'
: ''
}` }
onClick={ () =>

Check failure on line 295 in src/extensions/App.jsx

View workflow job for this annotation

GitHub Actions / JS lint

Replace `⏎↹↹↹↹↹↹↹setShowSettings(·(·prev·)·=>·!·prev·)⏎↹↹↹↹↹↹` with `·setShowSettings(·(·prev·)·=>·!·prev·)·`
setShowSettings( ( prev ) => ! prev )
}
label="Settings"
>
Settings
</Button>
</div>
</div>

<ModelStatus
Expand Down
8 changes: 8 additions & 0 deletions src/extensions/components/SettingsTab.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -147,12 +147,20 @@

return (
<div className="wp-agentic-admin-settings-tab">
<div className="wp-agentic-admin-settings-tab__header">
<h3 className="wp-agentic-admin-settings-tab__title">
Settings
</h3>
<p className="wp-agentic-admin-settings-tab__intro">
Configure GPU, context windows, and model behavior.
</p>
</div>
<Card>
<CardHeader>
<h3 style={ { margin: 0 } }>GPU Information</h3>
</CardHeader>
<CardBody>
{ detecting ? (

Check warning on line 163 in src/extensions/components/SettingsTab.jsx

View workflow job for this annotation

GitHub Actions / JS lint

Do not nest ternary expressions
<p>Detecting GPU capabilities...</p>
) : gpuInfo ? (
<table className="wp-agentic-admin-settings-tab__gpu-table">
Expand Down
60 changes: 59 additions & 1 deletion src/extensions/styles/main.scss
Original file line number Diff line number Diff line change
Expand Up @@ -921,6 +921,45 @@
}

// Tabs
.wp-agentic-admin-tabs-wrapper {
display: flex;
flex-direction: column;
flex: 1;
min-height: 0;
position: relative;
}

.wp-agentic-admin-settings-toggle {
position: absolute;
top: 0;
right: 0;
z-index: 1;
height: 48px;
padding: 0 16px;
gap: 6px;
border: none;
border-radius: 0;
background: transparent;
color: #50575e;
font-weight: 500;
font-size: 13px;
cursor: pointer;
display: flex;
align-items: center;
justify-content: center;

&:hover,
&:focus {
color: #2271b1;
background: #f0f0f1;
}

&.is-active {
color: #2271b1;
box-shadow: inset 0 -3px 0 0 #2271b1;
}
}

.wp-agentic-admin-tabs {
margin-bottom: 0;
display: flex;
Expand All @@ -932,6 +971,7 @@
border-bottom: 1px solid #c3c4c7;
margin-bottom: 0;
flex-shrink: 0;
padding-right: 110px; // Space for the settings gear icon + label
}

.components-tab-panel__tabs-item {
Expand Down Expand Up @@ -3474,7 +3514,25 @@

/* Settings Tab */
.wp-agentic-admin-settings-tab {
padding: 16px;
padding: 20px;
overflow-y: auto;

&__header {
margin-bottom: 24px;
}

&__title {
margin: 0 0 10px !important;
font-size: 18px !important;
font-weight: 600;
color: #1d2327;
}

&__intro {
margin: 0;
color: #50575e;
line-height: 1.6;
}

.components-card {
margin-bottom: 16px;
Expand Down
Loading