Skip to content

Commit 515260c

Browse files
authored
feat: calculator extension add description (#623)
* feat: calculator extension add description * docs: update changelog
1 parent 118de0e commit 515260c

8 files changed

Lines changed: 30 additions & 9 deletions

File tree

docs/content.en/docs/release-notes/_index.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ Information about release notes of Coco Server is provided here.
1515

1616
- feat: ai overview support is enabled with shortcut #597
1717
- feat: add key monitoring during reset #615
18+
- feat: calculator extension add description #623
1819

1920
### 🐛 Bug fix
2021

src/components/Settings/Extensions/components/Details/AiOverview/index.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ const AiOverview = () => {
5252
setAssistant={setAiOverviewAssistant}
5353
/>
5454

55-
<div className="text-sm">
55+
<>
5656
<div className="mt-6 text-[#333] dark:text-white/90">
5757
AI Overview Trigger
5858
</div>
@@ -83,7 +83,7 @@ const AiOverview = () => {
8383
);
8484
})}
8585
</div>
86-
</div>
86+
</>
8787
</>
8888
);
8989
};

src/components/Settings/Extensions/components/Details/Applications/index.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ const Applications = () => {
7474
};
7575

7676
return (
77-
<div className="text-sm">
77+
<>
7878
<div className="text-[#999]">
7979
<p className="font-bold mb-2">
8080
{t("settings.extensions.application.details.searchScope")}
@@ -119,7 +119,7 @@ const Applications = () => {
119119
);
120120
})}
121121
</ul>
122-
</div>
122+
</>
123123
);
124124
};
125125

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
import { useTranslation } from "react-i18next";
2+
3+
const Calculator = () => {
4+
const { t } = useTranslation();
5+
6+
return (
7+
<div className="text-[#999]">
8+
{t("settings.extensions.calculator.description")}
9+
</div>
10+
);
11+
};
12+
13+
export default Calculator;

src/components/Settings/Extensions/components/Details/SharedAi/index.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ const SharedAi: FC<SharedAiProps> = (props) => {
107107
};
108108

109109
return (
110-
<div className="text-sm">
110+
<>
111111
<div className="text-[#999]">{renderDescription()}</div>
112112

113113
<div className="mt-6 text-[#333] dark:text-white/90">LinkedAssistant</div>
@@ -138,7 +138,7 @@ const SharedAi: FC<SharedAiProps> = (props) => {
138138
</div>
139139
);
140140
})}
141-
</div>
141+
</>
142142
);
143143
};
144144

src/components/Settings/Extensions/components/Details/index.tsx

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import Application from "./Application";
66
import { useExtensionsStore } from "@/stores/extensionsStore";
77
import SharedAi from "./SharedAi";
88
import AiOverview from "./AiOverview";
9+
import Calculator from "./Calculator";
910

1011
const Details = () => {
1112
const { rootState } = useContext(ExtensionsContext);
@@ -51,6 +52,10 @@ const Details = () => {
5152
if (id === "AIOverview") {
5253
return <AiOverview />;
5354
}
55+
56+
if (id === "Calculator") {
57+
return <Calculator />;
58+
}
5459
};
5560

5661
return (
@@ -59,7 +64,7 @@ const Details = () => {
5964
{rootState.activeExtension?.title}
6065
</h2>
6166

62-
<div className="pr-4 pb-4">{renderContent()}</div>
67+
<div className="pr-4 pb-4 text-sm">{renderContent()}</div>
6368
</div>
6469
);
6570
};

src/locales/en/translation.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -231,7 +231,8 @@
231231
}
232232
},
233233
"calculator": {
234-
"title": "Calculator"
234+
"title": "Calculator",
235+
"description": "A calculator you can quickly invoke in the search bar, supporting basic math operations."
235236
}
236237
}
237238
},

src/locales/zh/translation.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -231,7 +231,8 @@
231231
}
232232
},
233233
"calculator": {
234-
"title": "计算器"
234+
"title": "计算器",
235+
"description": "在搜索框中快速调用的计算工具,支持基本数学运算。"
235236
}
236237
}
237238
},

0 commit comments

Comments
 (0)