Skip to content

There can be more than Notion and Miro. AFFiNE(pronounced [ə‘fain]) is a next-gen knowledge base that brings planning, sorting and creating all together. Privacy first, open-source, customizable and ready to use.

feat: add placeholder for OPENAI_API_KEY input (#3486)

Chi Zhangc8b2728e27da
diff --git a/apps/core/src/components/affine/setting-modal/general-setting/plugins/index.tsx b/apps/core/src/components/affine/setting-modal/general-setting/plugins/index.tsx
index bcbc2cc90c..9442a6624a 100644
--- a/apps/core/src/components/affine/setting-modal/general-setting/plugins/index.tsx
+++ b/apps/core/src/components/affine/setting-modal/general-setting/plugins/index.tsx
@@ -8,6 +8,8 @@ import { useAtomValue } from 'jotai';
import type { FC, ReactNode } from 'react';
import { useRef } from 'react';
+import { pluginItem } from './style.css';
+
const PluginSettingWrapper: FC<{
id: string;
title?: ReactNode;
@@ -45,7 +47,9 @@ export const Plugins = () => {
data-testid="plugins-title"
/>
{allowedPlugins.map(plugin => (
- <PluginSettingWrapper key={plugin} id={plugin} title={plugin} />
+ <div className={pluginItem} key={plugin}>
+ <PluginSettingWrapper key={plugin} id={plugin} title={plugin} />
+ </div>
))}
</>
);
diff --git a/apps/core/src/components/affine/setting-modal/general-setting/plugins/style.css.ts b/apps/core/src/components/affine/setting-modal/general-setting/plugins/style.css.ts
index d48509003e..36bf3031cd 100644
--- a/apps/core/src/components/affine/setting-modal/general-setting/plugins/style.css.ts
+++ b/apps/core/src/components/affine/setting-modal/general-setting/plugins/style.css.ts
@@ -7,3 +7,10 @@ export const settingWrapper = style({
minWidth: '150px',
maxWidth: '250px',
});
+
+export const pluginItem = style({
+ borderBottom: '1px solid var(--affine-border-color)',
+ transition: '0.3s',
+ padding: '24px 8px',
+ fontSize: 'var(--affine-font-sm)',
+});
diff --git a/plugins/copilot/src/UI/debug-content.tsx b/plugins/copilot/src/UI/debug-content.tsx
index a5a3e80d7e..8a01282c2b 100644
--- a/plugins/copilot/src/UI/debug-content.tsx
+++ b/plugins/copilot/src/UI/debug-content.tsx
@@ -11,6 +11,8 @@ export const DebugContent = (): ReactElement => {
<div>
<FlexWrapper justifyContent="space-between">
<Input
+ width={280}
+ height={32}
defaultValue={key ?? undefined}
onChange={useCallback(
(newValue: string) => {
@@ -18,6 +20,7 @@ export const DebugContent = (): ReactElement => {
},
[setKey]
)}
+ placeholder="Enter your API_KEY here"
/>
<Button
size="large"