feat ux improvements on control plane settings (#1924)
This commit is contained in:
parent
2c13776c06
commit
0ff5efcd5a
6 changed files with 37 additions and 11 deletions
|
|
@ -78,7 +78,7 @@
|
|||
"continue.enableContinueForTeams": {
|
||||
"type": "boolean",
|
||||
"default": false,
|
||||
"markdownDescription": "Enable Continue for teams beta features (requires window reload)"
|
||||
"markdownDescription": "_(Requires window reload)_ Enable Continue for teams beta features. To sign in, click the person icon in the bottom right of the sidebar."
|
||||
},
|
||||
"continue.showInlineTip": {
|
||||
"type": "boolean",
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@ import {
|
|||
import { ProfileDescription } from "core/config/ConfigHandler";
|
||||
import { Fragment, useContext, useEffect, useState } from "react";
|
||||
import ReactDOM from "react-dom";
|
||||
import { useSelector } from "react-redux";
|
||||
import { useDispatch, useSelector } from "react-redux";
|
||||
import styled from "styled-components";
|
||||
import {
|
||||
defaultBorderRadius,
|
||||
|
|
@ -24,6 +24,7 @@ import { useWebviewListener } from "../hooks/useWebviewListener";
|
|||
import { RootState } from "../redux/store";
|
||||
import { getFontSize } from "../util";
|
||||
import HeaderButtonWithText from "./HeaderButtonWithText";
|
||||
import { setLastControlServerBetaEnabledStatus } from "../redux/slices/miscSlice";
|
||||
|
||||
const StyledListbox = styled(Listbox)`
|
||||
background-color: ${vscBackground};
|
||||
|
|
@ -127,6 +128,11 @@ function ProfileSwitcher(props: {}) {
|
|||
const { session, logout, login } = useAuth();
|
||||
const [profiles, setProfiles] = useState<ProfileDescription[]>([]);
|
||||
|
||||
const dispatch = useDispatch();
|
||||
const lastControlServerBetaEnabledStatus = useSelector(
|
||||
(state: RootState) => state.misc.lastControlServerBetaEnabledStatus,
|
||||
);
|
||||
|
||||
const selectedProfileId = useSelector(
|
||||
(store: RootState) => store.state.selectedProfileId,
|
||||
);
|
||||
|
|
@ -135,8 +141,16 @@ function ProfileSwitcher(props: {}) {
|
|||
useState(false);
|
||||
|
||||
useEffect(() => {
|
||||
ideMessenger.ide.getIdeSettings().then((settings) => {
|
||||
setControlServerBetaEnabled(settings.enableControlServerBeta);
|
||||
ideMessenger.ide.getIdeSettings().then(({ enableControlServerBeta }) => {
|
||||
const shouldShowPopup =
|
||||
!lastControlServerBetaEnabledStatus && enableControlServerBeta;
|
||||
|
||||
if (shouldShowPopup) {
|
||||
ideMessenger.ide.infoPopup("Continue for Teams enabled");
|
||||
}
|
||||
|
||||
setControlServerBetaEnabled(enableControlServerBeta);
|
||||
dispatch(setLastControlServerBetaEnabledStatus(enableControlServerBeta));
|
||||
});
|
||||
}, []);
|
||||
|
||||
|
|
|
|||
|
|
@ -37,7 +37,7 @@ interface StepContainerProps {
|
|||
isFirst: boolean;
|
||||
isLast: boolean;
|
||||
index: number;
|
||||
subtext?: string;
|
||||
modelTitle?: string;
|
||||
}
|
||||
|
||||
const ContentDiv = styled.div<{ isUserInput: boolean; fontSize?: number }>`
|
||||
|
|
@ -132,10 +132,10 @@ function StepContainer(props: StepContainerProps) {
|
|||
fontSize: getFontSize() - 3,
|
||||
}}
|
||||
>
|
||||
{props.subtext && (
|
||||
{props.modelTitle && (
|
||||
<div className="flex items-center">
|
||||
<CubeIcon className="w-3 h-4 mr-1 flex-shrink-0" />
|
||||
{props.subtext}
|
||||
{props.modelTitle}
|
||||
<div
|
||||
style={{
|
||||
backgroundColor: vscButtonBackground,
|
||||
|
|
|
|||
|
|
@ -26,6 +26,7 @@ import {
|
|||
import ConfirmationDialog from "../dialogs/ConfirmationDialog";
|
||||
|
||||
const StyledListboxButton = styled(Listbox.Button)`
|
||||
font-family: inherit;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 2px;
|
||||
|
|
@ -216,10 +217,10 @@ function ModelSelect() {
|
|||
className="h-[18px] overflow-hidden"
|
||||
style={{ padding: 0 }}
|
||||
>
|
||||
<div className="hover:underline">
|
||||
<span className="hover:underline">
|
||||
{modelSelectTitle(defaultModel) || "Select model"}{" "}
|
||||
<ChevronDownIcon className="h-2.5 w-2.5" aria-hidden="true" />
|
||||
</div>
|
||||
</span>
|
||||
</StyledListboxButton>
|
||||
<StyledListboxOptions>
|
||||
{options.map((option, idx) => (
|
||||
|
|
|
|||
|
|
@ -483,7 +483,7 @@ function GUI() {
|
|||
onDelete={() => {
|
||||
dispatch(deleteMessage(index));
|
||||
}}
|
||||
subtext={
|
||||
modelTitle={
|
||||
item.promptLogs?.[0]?.completionOptions?.model ??
|
||||
""
|
||||
}
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@ export const miscSlice = createSlice({
|
|||
initialState: {
|
||||
takenAction: false,
|
||||
serverStatusMessage: "Continue Server Starting",
|
||||
lastControlServerBetaEnabledStatus: false,
|
||||
},
|
||||
reducers: {
|
||||
setTakenActionTrue: (state) => {
|
||||
|
|
@ -13,8 +14,18 @@ export const miscSlice = createSlice({
|
|||
setServerStatusMessage: (state, action: PayloadAction<string>) => {
|
||||
state.serverStatusMessage = action.payload;
|
||||
},
|
||||
setLastControlServerBetaEnabledStatus: (
|
||||
state,
|
||||
action: PayloadAction<boolean>,
|
||||
) => {
|
||||
state.lastControlServerBetaEnabledStatus = action.payload;
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
export const { setTakenActionTrue, setServerStatusMessage } = miscSlice.actions;
|
||||
export const {
|
||||
setTakenActionTrue,
|
||||
setServerStatusMessage,
|
||||
setLastControlServerBetaEnabledStatus,
|
||||
} = miscSlice.actions;
|
||||
export default miscSlice.reducer;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue