Conversation
| </div> | ||
| </div> | ||
| <div className="flex items-center gap-2 flex-shrink-0"> | ||
| <div className={ 'flex items-center gap-2 flex-shrink-0' }> |
There was a problem hiding this comment.
NIT - t seems it's leftover
| <div className={ 'flex items-center gap-2 flex-shrink-0' }> | |
| <div className="flex items-center gap-2 flex-shrink-0"> |
| @@ -0,0 +1,54 @@ | |||
| /** | |||
There was a problem hiding this comment.
We have many redundant comments or info in some comments, for example:
Required:/Optional:- it's just a duplication of info which we already have with type definitions- Or for example
/** Skill name */is redundant comment, sinenameproperty insideAvailableSkillis self-explanatory.
So I would remove some comments and adjusted other.
| export const DEFAULT_SKILLS_REPO = 'WordPress/agent-skills'; | ||
|
|
||
| /** Default branch to download from */ | ||
| export const DEFAULT_BRANCH = 'trunk'; |
There was a problem hiding this comment.
NIT - I would keep the name more specific instead of a generic name
| export const DEFAULT_BRANCH = 'trunk'; | |
| export const DEFAULT_SKILLS_REPO_BRANCH = 'trunk'; |
| <> | ||
| <span className="inline-flex items-center gap-1 text-[11px] text-green-700 bg-green-50 px-2 py-0.5 rounded-full"> | ||
| <Icon icon={ check } size={ 12 } /> | ||
| { __( 'Installed' ) } |
| disabled={ isInstalling } | ||
| className="text-xs py-1 px-2" | ||
| > | ||
| { isInstalling ? __( 'Installing...' ) : __( 'Install' ) } |
There was a problem hiding this comment.
Small bug - when you quickly click on the "Install" button and then immediately click on another "Install" button, the disabled state and "Installing" text disappear for the previous item, which was in progress.
| const [ installingPath, setInstallingPath ] = useState< string | null >( null ); | ||
|
|
||
| const installedNames = useMemo( | ||
| () => new Set( installedSkills.map( ( s ) => s.name ) ), |
There was a problem hiding this comment.
Just out of curiosity - is there some reason for using Set?
There was a problem hiding this comment.
Also, map + Set is cheap for normal list sizes and the same for filter inside uninstalledSkills, so I see it just as unnecessary lines of code, but it's completely up to you, just sharing my thoughts.
| } | ||
|
|
||
| export async function listAvailableSkills( | ||
| repo: string = DEFAULT_SKILLS_REPO, |
There was a problem hiding this comment.
I see that we use the repo property everywhere. I don't see an opportunity to provide a custom repo in UI, so I wonder - do we expect to provide an opportunity for different/custom repos? If no, then I would go with removing this property in all places, to keep code simple, at this point. The same with branch.
| disabled={ isInstalling } | ||
| className="text-[11px] !py-0 !px-0 normal-case !font-medium" | ||
| > | ||
| { isInstalling ? __( 'Installing...' ) : __( 'Install All' ) } |
There was a problem hiding this comment.
When we click "Install All' - let's disable all Install buttons.
@nightnei Let's hold off with this PR for now. I think we will implement #2741 first as the base for the backend and then rebase this one to the UI based on the discussion here #2741 (comment) I will mark this as draft for now to avoid confusion. |


Related issues
How AI was used in this PR
I used it to get the basic idea and implementation from https://github.com/Automattic/studio/pull/2511/changes#diff-c69fa338d4e3c20084125a9fa7186cf40116a7460210922cfd4b4021935f4c18
Proposed Changes
This PR adds
Skillstab to theAI Settingsmodal which allows to install and manage diffeent skills.Testing Instructions
npm startAgents Suitefeature in the topbar menu underElectron > Feature FlagsAssistanttabAI SettingsmodalSkillstab such as installing and removing skills and confirm it works as expectedPre-merge Checklist