Skip to content

Commit cfd237b

Browse files
committed
Merge remote-tracking branch 'upstream/main'
2 parents 29adb00 + a012b38 commit cfd237b

34 files changed

Lines changed: 510 additions & 238 deletions

File tree

README.ja.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ Discord コミュニティへのご参加をお待ちしています。使用中
9393

9494
## 新規ユーザー向け
9595

96-
最新の ValueCell アプリケーション(MacOS または Windows 用)を GitHub の[リリースページ](https://github.com/ValueCell-ai/valuecell/releases)からダウンロードできます。また、公式ウェブサイト [https://valuecell.ai](https://valuecell.ai) からもダウンロードできます。
96+
最新の ValueCell アプリケーション(MacOS または Windows 用)を GitHub の[リリースページ](https://github.com/ValueCell-ai/valuecell/releases)からダウンロードできます。
9797

9898
インストール後、初回使用時に、お好みのモデルプロバイダーを設定してください。アプリケーション内の指示またはドキュメントを参照してください。
9999

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ Welcome to join our Discord community to share feedback and issues you encounter
9494

9595
## New Users
9696

97-
To get started quickly, download the latest ValueCell application for MacOS or Windows from the [Releases page](https://github.com/ValueCell-ai/valuecell/releases) on GitHub. You may also download the application from our official website: [https://valuecell.ai](https://valuecell.ai).
97+
To get started quickly, download the latest ValueCell application for MacOS or Windows from the [Releases page](https://github.com/ValueCell-ai/valuecell/releases) on GitHub.
9898

9999
After installation, please configure your preferred model provider before using ValueCell for the first time. Refer to the instructions in the application or documentation as needed.
100100

README.zh.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ ValueCell 是一个社区驱动的多智能体金融应用产品,我们的计
9696

9797
## 新用户
9898

99-
要快速开始,请从 GitHub 的[发布页面](https://github.com/ValueCell-ai/valuecell/releases)下载 MacOS 或 Windows 的最新 ValueCell 应用程序。您也可以从我们的官方网站 [https://valuecell.ai](https://valuecell.ai) 下载应用程序。
99+
要快速开始,请从 GitHub 的[发布页面](https://github.com/ValueCell-ai/valuecell/releases)下载 MacOS 或 Windows 的最新 ValueCell 应用程序。
100100

101101
安装后,初次使用 ValueCell 前请配置您首选的模型提供商。请参考应用程序内的说明或文档。
102102

README.zh_Hant.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ ValueCell 是一個社群驅動的多智能體金融應用產品,我們的計
9393

9494
## 新使用者
9595

96-
若要快速開始使用,請從 GitHub 的[發布頁面](https://github.com/ValueCell-ai/valuecell/releases)下載適用於 MacOS 或 Windows 的最新 ValueCell 應用程式。您也可以從我們的官方網站 [https://valuecell.ai](https://valuecell.ai) 下載應用程式。
96+
若要快速開始使用,請從 GitHub 的[發布頁面](https://github.com/ValueCell-ai/valuecell/releases)下載適用於 MacOS 或 Windows 的最新 ValueCell 應用程式。
9797

9898
安裝後,使用 ValueCell 前請先設定您偏好的模型供應商。請參閱應用程式內的指示或文件。
9999

frontend/src-tauri/tauri.conf.json

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"$schema": "https://schema.tauri.app/config/2",
33
"productName": "ValueCell",
4-
"version": "0.1.19",
4+
"version": "0.1.20",
55
"identifier": "com.valuecell.valuecellapp",
66
"build": {
77
"beforeDevCommand": "bun run dev:tauri",
@@ -10,14 +10,12 @@
1010
"frontendDist": "../build/client"
1111
},
1212
"app": {
13-
"windows": [
14-
{
15-
"title": "ValueCell",
16-
"minWidth": 1300,
17-
"minHeight": 780,
18-
"hiddenTitle": true
19-
}
20-
],
13+
"windows": [{
14+
"title": "ValueCell",
15+
"minWidth": 1300,
16+
"minHeight": 780,
17+
"hiddenTitle": true
18+
}],
2119
"security": {
2220
"csp": null
2321
}

frontend/src/api/system.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import { useMutation, useQuery, useQueryClient } from "@tanstack/react-query";
22
import { toast } from "sonner";
33
import { API_QUERY_KEYS, VALUECELL_BACKEND_URL } from "@/constants/api";
4+
import i18n from "@/i18n";
45
import { type ApiResponse, apiClient } from "@/lib/api-client";
56
import { useLanguage } from "@/store/settings-store";
67
import { useSystemStore } from "@/store/system-store";
@@ -111,7 +112,7 @@ export const usePublishStrategy = () => {
111112
);
112113
},
113114
onSuccess: () => {
114-
toast.success("Strategy published successfully");
115+
toast.success(i18n.t("strategy.toast.published"));
115116
queryClient.invalidateQueries({
116117
queryKey: API_QUERY_KEYS.SYSTEM.strategyList([]),
117118
});

frontend/src/app/agent/components/strategy-items/modals/create-strategy-modal.tsx

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { useStore } from "@tanstack/react-form";
22
import { AlertCircleIcon } from "lucide-react";
33
import type { FC, RefObject } from "react";
4-
import { memo, useImperativeHandle, useState } from "react";
4+
import { memo, useImperativeHandle, useMemo, useState } from "react";
55
import { useTranslation } from "react-i18next";
66
import { useGetModelProviderDetail } from "@/api/setting";
77
import {
@@ -29,9 +29,9 @@ import { TradingStrategyForm } from "@/components/valuecell/form/trading-strateg
2929
import { StepIndicator } from "@/components/valuecell/step-indicator";
3030
import { TRADING_SYMBOLS } from "@/constants/agent";
3131
import {
32-
aiModelSchema,
33-
exchangeSchema,
34-
tradingStrategySchema,
32+
createAiModelSchema,
33+
createExchangeSchema,
34+
createTradingStrategySchema,
3535
} from "@/constants/schema";
3636
import { useAppForm } from "@/hooks/use-form";
3737
import { tracker } from "@/lib/tracker";
@@ -50,6 +50,12 @@ const CreateStrategyModal: FC<CreateStrategyModalProps> = ({
5050
children,
5151
}) => {
5252
const { t } = useTranslation();
53+
const aiModelSchema = useMemo(() => createAiModelSchema(t), [t]);
54+
const exchangeSchema = useMemo(() => createExchangeSchema(t), [t]);
55+
const tradingStrategySchema = useMemo(
56+
() => createTradingStrategySchema(t),
57+
[t],
58+
);
5359
const [open, setOpen] = useState(false);
5460
const [currentStep, setCurrentStep] = useState(1);
5561
const [error, setError] = useState<string | null>(null);

frontend/src/app/agent/components/strategy-items/modals/share-portfolio-modal.tsx

Lines changed: 18 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import {
1111
useRef,
1212
useState,
1313
} from "react";
14+
import { useTranslation } from "react-i18next";
1415
import { toast } from "sonner";
1516
import { Button } from "@/components/ui/button";
1617
import { Dialog, DialogContent, DialogTitle } from "@/components/ui/dialog";
@@ -38,6 +39,7 @@ export interface SharePortfolioCardRef {
3839
const SharePortfolioModal: FC<{
3940
ref?: RefObject<SharePortfolioCardRef | null>;
4041
}> = ({ ref }) => {
42+
const { t } = useTranslation();
4143
const cardRef = useRef<HTMLDivElement>(null);
4244
const [isDownloading, setIsDownloading] = useState(false);
4345

@@ -84,18 +86,21 @@ const SharePortfolioModal: FC<{
8486
await writeFile(path, new Uint8Array(arrayBuffer));
8587

8688
setOpen(false);
87-
toast.success("Image downloaded successfully", {
89+
toast.success(t("sharePortfolio.toast.downloaded"), {
8890
action: {
89-
label: "open file",
91+
label: t("sharePortfolio.toast.openFile"),
9092
onClick: async () => {
9193
return await openPath(path);
9294
},
9395
},
9496
});
9597
} catch (err) {
96-
toast.error(`Failed to download image: ${JSON.stringify(err)}`, {
97-
duration: 6 * 1000,
98-
});
98+
toast.error(
99+
t("sharePortfolio.toast.downloadFailed", {
100+
error: JSON.stringify(err),
101+
}),
102+
{ duration: 6 * 1000 },
103+
);
99104
} finally {
100105
setIsDownloading(false);
101106
}
@@ -116,7 +121,9 @@ const SharePortfolioModal: FC<{
116121
className="h-[600px] w-[434px] overflow-hidden border-none bg-transparent p-0 shadow-none"
117122
showCloseButton={false}
118123
>
119-
<DialogTitle className="sr-only">Share Portfolio</DialogTitle>
124+
<DialogTitle className="sr-only">
125+
{t("sharePortfolio.title")}
126+
</DialogTitle>
120127

121128
{/* Card to be captured */}
122129
<div
@@ -166,10 +173,10 @@ const SharePortfolioModal: FC<{
166173
{formatChange(data.total_pnl, "", 2)}
167174
</span>
168175

169-
<p>Model</p>
176+
<p>{t("sharePortfolio.fields.model")}</p>
170177
<span>{data.llm_model_id}</span>
171178

172-
<p>Exchange</p>
179+
<p>{t("sharePortfolio.fields.exchange")}</p>
173180
<span className="ml-auto flex items-center gap-1">
174181
<PngIcon
175182
src={
@@ -182,7 +189,7 @@ const SharePortfolioModal: FC<{
182189
{data.exchange_id}
183190
</span>
184191

185-
<p>Strategy</p>
192+
<p>{t("sharePortfolio.fields.strategy")}</p>
186193
<span>{data.strategy_type}</span>
187194
</div>
188195

@@ -219,7 +226,7 @@ const SharePortfolioModal: FC<{
219226
className="h-12 flex-1 rounded-xl border-border bg-card font-medium text-base hover:bg-muted"
220227
onClick={() => setOpen(false)}
221228
>
222-
Cancel
229+
{t("strategy.action.cancel")}
223230
</Button>
224231

225232
<Button
@@ -232,7 +239,7 @@ const SharePortfolioModal: FC<{
232239
) : (
233240
<Download className="mr-2 size-5" />
234241
)}
235-
Download
242+
{t("sharePortfolio.action.download")}
236243
</Button>
237244
</div>
238245
</DialogContent>

frontend/src/app/agent/components/strategy-items/portfolio-positions-group.tsx

Lines changed: 41 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,10 @@
11
import { LineChart, Wallet } from "lucide-react";
2-
import { type FC, memo, useRef } from "react";
2+
import { type FC, memo } from "react";
33
import { useTranslation } from "react-i18next";
4-
import { useStrategyPerformance } from "@/api/strategy";
5-
import { usePublishStrategy } from "@/api/system";
4+
// import { useStrategyPerformance } from "@/api/strategy";
5+
// import { usePublishStrategy } from "@/api/system";
66
import { ValueCellAgentPng } from "@/assets/png";
7-
import { Send, Share } from "@/assets/svg";
87
import { Badge } from "@/components/ui/badge";
9-
import { Button } from "@/components/ui/button";
10-
import {
11-
DropdownMenu,
12-
DropdownMenuContent,
13-
DropdownMenuItem,
14-
DropdownMenuTrigger,
15-
} from "@/components/ui/dropdown-menu";
16-
import { Spinner } from "@/components/ui/spinner";
178
import {
189
Table,
1910
TableBody,
@@ -24,20 +15,19 @@ import {
2415
} from "@/components/ui/table";
2516
import MultiLineChart from "@/components/valuecell/charts/model-multi-line";
2617
import { PngIcon } from "@/components/valuecell/icon/png-icon";
27-
import SvgIcon from "@/components/valuecell/icon/svg-icon";
28-
import LoginModal from "@/components/valuecell/modal/login-modal";
29-
import { useTauriInfo } from "@/hooks/use-tauri-info";
18+
// import { useTauriInfo } from "@/hooks/use-tauri-info";
3019
import {
3120
formatChange,
3221
getChangeType,
3322
getCoinCapIcon,
3423
numberFixed,
3524
} from "@/lib/utils";
3625
import { useStockColors } from "@/store/settings-store";
37-
import { useIsLoggedIn, useSystemInfo } from "@/store/system-store";
26+
// import { useIsLoggedIn, useSystemInfo } from "@/store/system-store";
3827
import type { PortfolioSummary, Position, Strategy } from "@/types/strategy";
39-
import type { SharePortfolioCardRef } from "./modals/share-portfolio-modal";
40-
import SharePortfolioModal from "./modals/share-portfolio-modal";
28+
29+
// import type { SharePortfolioCardRef } from "./modals/share-portfolio-modal";
30+
// import SharePortfolioModal from "./modals/share-portfolio-modal";
4131

4232
interface PortfolioPositionsGroupProps {
4333
priceCurve: Array<Array<number | string>>;
@@ -104,50 +94,50 @@ const PortfolioPositionsGroup: FC<PortfolioPositionsGroupProps> = ({
10494
summary,
10595
priceCurve,
10696
positions,
107-
strategy,
97+
// strategy,
10898
}) => {
10999
const { t } = useTranslation();
110-
const sharePortfolioModalRef = useRef<SharePortfolioCardRef>(null);
100+
// const sharePortfolioModalRef = useRef<SharePortfolioCardRef>(null);
111101

112102
const stockColors = useStockColors();
113103
const changeType = getChangeType(summary?.total_pnl);
114-
const { name, avatar } = useSystemInfo();
115-
const isLogin = useIsLoggedIn();
116-
const { isTauriApp } = useTauriInfo();
104+
// const { name, avatar } = useSystemInfo();
105+
// const isLogin = useIsLoggedIn();
106+
// const { isTauriApp } = useTauriInfo();
117107

118108
const hasPositions = positions.length > 0;
119109
const hasPriceCurve = priceCurve.length > 0;
120110

121-
const { mutate: publishStrategy, isPending: isPublishing } =
122-
usePublishStrategy();
111+
// const { mutate: publishStrategy, isPending: isPublishing } =
112+
// usePublishStrategy();
123113

124-
const { refetch: refetchPerformance } = useStrategyPerformance(
125-
strategy.strategy_id,
126-
);
114+
// const { refetch: refetchPerformance } = useStrategyPerformance(
115+
// strategy.strategy_id,
116+
// );
127117

128-
const handlePublishToRankBoard = async () => {
129-
const { data } = await refetchPerformance();
130-
if (!data) return;
131-
const { exchange_id, ...rest } = data;
118+
// const handlePublishToRankBoard = async () => {
119+
// const { data } = await refetchPerformance();
120+
// if (!data) return;
121+
// const { exchange_id, ...rest } = data;
132122

133-
publishStrategy({
134-
...rest,
135-
exchange_id: exchange_id || "virtual",
136-
name,
137-
avatar,
138-
});
139-
};
123+
// publishStrategy({
124+
// ...rest,
125+
// exchange_id: exchange_id || "virtual",
126+
// name,
127+
// avatar,
128+
// });
129+
// };
140130

141-
const handleSharePortfolio = async () => {
142-
const { data } = await refetchPerformance();
143-
if (!data) return;
131+
// const handleSharePortfolio = async () => {
132+
// const { data } = await refetchPerformance();
133+
// if (!data) return;
144134

145-
sharePortfolioModalRef.current?.open({
146-
...data,
147-
total_pnl: summary?.total_pnl ?? 0,
148-
created_at: strategy.created_at,
149-
});
150-
};
135+
// sharePortfolioModalRef.current?.open({
136+
// ...data,
137+
// total_pnl: summary?.total_pnl ?? 0,
138+
// created_at: strategy.created_at,
139+
// });
140+
// };
151141

152142
return (
153143
<div className="scroll-container flex flex-1 flex-col gap-8 p-6">
@@ -157,6 +147,7 @@ const PortfolioPositionsGroup: FC<PortfolioPositionsGroupProps> = ({
157147
<h3 className="font-semibold text-base text-foreground">
158148
{t("strategy.portfolio.title")}
159149
</h3>
150+
{/* Publish/Share features - commented out (requires login)
160151
{isTauriApp &&
161152
(isLogin ? (
162153
<DropdownMenu>
@@ -192,6 +183,7 @@ const PortfolioPositionsGroup: FC<PortfolioPositionsGroupProps> = ({
192183
</Button>
193184
</LoginModal>
194185
))}
186+
*/}
195187
</div>
196188

197189
<div className="grid grid-cols-3 gap-4 text-nowrap">
@@ -311,7 +303,7 @@ const PortfolioPositionsGroup: FC<PortfolioPositionsGroupProps> = ({
311303
)}
312304
</div>
313305

314-
<SharePortfolioModal ref={sharePortfolioModalRef} />
306+
{/* <SharePortfolioModal ref={sharePortfolioModalRef} /> */}
315307
</div>
316308
);
317309
};

0 commit comments

Comments
 (0)