Skip to content

Commit e088f5d

Browse files
authored
fix: active shadow setting (#354)
* chore: active shadow setting * chore: add isTauri * chore: web build * docs: update notes
1 parent 024dc31 commit e088f5d

20 files changed

Lines changed: 71 additions & 26 deletions

File tree

.env

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
COCO_SERVER_URL=https://coco.infini.cloud #http://localhost:9000
1+
COCO_SERVER_URL=http://localhost:9000 https://coco.infini.cloud #http://localhost:9000
22

3-
COCO_WEBSOCKET_URL=wss://coco.infini.cloud/ws #ws://localhost:9000/ws
3+
COCO_WEBSOCKET_URL=ws://localhost:9000/ws wss://coco.infini.cloud/ws #ws://localhost:9000/ws

.vscode/settings.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
"dtolnay",
1212
"dyld",
1313
"elif",
14+
"errmsg",
1415
"fullscreen",
1516
"headlessui",
1617
"Icdbb",

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,12 @@ Information about release notes of Coco Server is provided here.
1717
- feat: add shortcuts to most icon buttons #334
1818
- feat: add font icon for search list #342
1919
- feat: add a border to the main window in Windows 10 #343
20+
- feat: mobile terminal adaptation about style #348
2021

2122
### Bug fix
2223

2324
- fix: fixed the problem of not being able to search in secondary directories #338
25+
- fix: active shadow setting #354
2426

2527
### Improvements
2628

@@ -38,7 +40,6 @@ Information about release notes of Coco Server is provided here.
3840

3941
- feat: support multi websocket connections #314
4042
- feat: add support for embeddable web widget #277
41-
- feat: mobile terminal adaptation about style #348
4243

4344
### Bug fix
4445

src-tauri/capabilities/default.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
"core:window:allow-set-focus",
3030
"core:window:allow-set-always-on-top",
3131
"core:window:deny-internal-toggle-maximize",
32+
"core:window:allow-set-shadow",
3233
"core:app:allow-set-app-theme",
3334
"shell:default",
3435
"http:default",

src/api/axiosRequest.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -50,10 +50,9 @@ export const Get = <T>(
5050
// console.log("baseURL", appStore.state?.endpoint_http)
5151

5252
let baseURL = appStore.state?.endpoint_http;
53-
const isDev = import.meta.env.DEV;
5453

5554
axios
56-
.get(isDev ? url : baseURL + url, { params })
55+
.get(baseURL + url, { params })
5756
.then((result) => {
5857
let res: FcResponse<T>;
5958
if (clearFn !== undefined) {
@@ -79,10 +78,9 @@ export const Post = <T>(
7978
// console.log("baseURL", appStore.state?.endpoint_http)
8079

8180
let baseURL = appStore.state?.endpoint_http;
82-
const isDev = import.meta.env.DEV;
8381

8482
axios
85-
.post(isDev ? url : baseURL + url, data, {
83+
.post(baseURL + url, data, {
8684
params,
8785
headers,
8886
} as any)

src/components/Assistant/Chat.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ const ChatAI = memo(
5858
clearChatPage,
5959
isChatPage = false,
6060
getFileUrl,
61-
showChatHistory = true,
61+
showChatHistory,
6262
},
6363
ref
6464
) => {
@@ -166,7 +166,8 @@ const ChatAI = memo(
166166
isDeepThinkActive,
167167
sourceDataIds,
168168
changeInput,
169-
websocketSessionId
169+
websocketSessionId,
170+
showChatHistory
170171
);
171172

172173
const { dealMsg, messageTimeoutRef } = useMessageHandler(

src/components/ChatMessage/FetchSource.tsx

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import { useTranslation } from "react-i18next";
1010
import { OpenURLWithBrowser } from "@/utils/index";
1111
import type { IChunkData } from "@/components/Assistant/types";
1212
import RetrieveIcon from "@/icons/Retrieve";
13+
import { useAppStore } from "@/stores/appStore";
1314

1415
interface FetchSourceProps {
1516
Detail?: any;
@@ -34,8 +35,14 @@ interface ISourceData {
3435
url: string;
3536
}
3637

37-
export const FetchSource = ({ Detail, ChunkData, loading }: FetchSourceProps) => {
38+
export const FetchSource = ({
39+
Detail,
40+
ChunkData,
41+
loading,
42+
}: FetchSourceProps) => {
3843
const { t } = useTranslation();
44+
const isTauri = useAppStore((state) => state.isTauri);
45+
3946
const [isSourceExpanded, setIsSourceExpanded] = useState(false);
4047

4148
const [total, setTotal] = useState(0);
@@ -51,7 +58,7 @@ export const FetchSource = ({ Detail, ChunkData, loading }: FetchSourceProps) =>
5158
useEffect(() => {
5259
if (!ChunkData?.message_chunk) return;
5360

54-
if (!loading) {
61+
if (!loading) {
5562
try {
5663
const match = ChunkData.message_chunk.match(
5764
// /\u003cPayload total=(\d+)\u003e/
@@ -130,7 +137,11 @@ export const FetchSource = ({ Detail, ChunkData, loading }: FetchSourceProps) =>
130137
{item.title || item.category}
131138
</div>
132139
</div>
133-
<div className="hidden md:flex w-[25%] items-center justify-end gap-2">
140+
<div
141+
className={`${
142+
isTauri ? "flex" : "hidden md:flex"
143+
} w-[25%] items-center justify-end gap-2`}
144+
>
134145
<span className="text-xs text-[#999999] dark:text-[#999999] truncate">
135146
{item.source?.name}
136147
</span>

src/components/Common/UI/Footer.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,9 @@ export default function Footer({
9999
<Copyright />
100100
)}
101101

102-
<div className="hidden md:flex items-center gap-3">
102+
<div
103+
className={`${isTauri ? "flex" : "hidden md:flex"} items-center gap-3`}
104+
>
103105
<div className="gap-1 flex items-center text-[#666] dark:text-[#666] text-xs">
104106
<span className="mr-1.5">{t("search.footer.select")}:</span>
105107
<kbd className="coco-modal-footer-commands-key pr-1">

src/components/Common/UI/NoResults.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,12 @@ import { useTranslation } from "react-i18next";
44
import { isMac } from "@/utils/platform";
55
import { useShortcutsStore } from "@/stores/shortcutsStore";
66
import noDataImg from "@/assets/coconut-tree.png";
7+
import { useAppStore } from "@/stores/appStore";
78

89
export const NoResults = () => {
910
const { t } = useTranslation();
1011

12+
const isTauri = useAppStore((state) => state.isTauri);
1113
const modeSwitch = useShortcutsStore((state) => state.modeSwitch);
1214

1315
return (
@@ -19,7 +21,7 @@ export const NoResults = () => {
1921
<div className="mt-4 text-sm text-[#999] dark:text-[#666]">
2022
{t("search.main.noResults")}
2123
</div>
22-
<div className="hidden md:flex mt-10 text-sm text-[#333] dark:text-[#D8D8D8]">
24+
<div className={`${isTauri ? 'flex' : 'hidden md:flex'} mt-10 text-sm text-[#333] dark:text-[#D8D8D8]`}>
2325
{t("search.main.askCoco")}
2426
{isMac ? (
2527
<span className="ml-3 w-5 h-5 rounded-[6px] border border-[#D8D8D8] flex justify-center items-center">

src/components/Search/ListRight.tsx

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import TypeIcon from "@/components/Common/Icons/TypeIcon";
22
import RichIcon from "@/components/Common/Icons/RichIcon";
3+
import { useAppStore } from "@/stores/appStore";
34

45
interface ListRightProps {
56
item: any;
@@ -16,8 +17,14 @@ export default function ListRight({
1617
currentIndex,
1718
goToTwoPage,
1819
}: ListRightProps) {
20+
const isTauri = useAppStore((state) => state.isTauri);
21+
1922
return (
20-
<div className="hidden md:flex flex-1 text-right min-w-[160px] h-full pl-5 text-[12px] gap-2 items-center justify-end relative">
23+
<div
24+
className={`${
25+
isTauri ? "flex" : "hidden md:flex"
26+
} flex-1 text-right min-w-[160px] h-full pl-5 text-[12px] gap-2 items-center justify-end relative`}
27+
>
2128
{item?.rich_categories ? null : (
2229
<div
2330
className="w-4 h-4 cursor-pointer"

0 commit comments

Comments
 (0)