Skip to content

Commit

Permalink
fix(jb images): remove "add image" button from jetbrains. (#211)
Browse files Browse the repository at this point in the history
* fix(jb images): remove "add image" button from jetbrains.

* fix(jb images): make `images` a configurable feature.
  • Loading branch information
MarcMcIntosh committed Nov 27, 2024
1 parent 64e7d18 commit 116a7e3
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/components/ChatForm/ChatForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,7 @@ export const ChatForm: React.FC<ChatFormProps> = ({
onClick={onClose}
/>
)}
<AttachFileButton />
{config.features?.images !== false && <AttachFileButton />}
{/* TODO: Reserved space for microphone button coming later on */}
<PaperPlaneButton
disabled={isStreaming || !isOnline}
Expand Down
8 changes: 7 additions & 1 deletion src/features/Config/configSlice.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ export type Config = {
statistics?: boolean;
vecdb?: boolean;
ast?: boolean;
images?: boolean;
};
keyBindings?: {
completeManual?: string;
Expand All @@ -32,6 +33,7 @@ const initialState: Config = {
statistics: true,
vecdb: true,
ast: true,
images: true,
},
themeProps: {
appearance: "dark",
Expand All @@ -49,7 +51,11 @@ export const reducer = createReducer<Config>(initialState, (builder) => {
// TODO: toggle darkmode for web host?
builder.addCase(updateConfig, (state, action) => {
state.dev = action.payload.dev ?? state.dev;
state.features = action.payload.features ?? state.features;

state.features = action.payload.features
? { ...state.features, ...action.payload.features }
: state.features;

state.host = action.payload.host ?? state.host;
state.lspUrl = action.payload.lspUrl ?? state.lspUrl;
state.tabbed = action.payload.tabbed ?? state.tabbed;
Expand Down

0 comments on commit 116a7e3

Please sign in to comment.