Compare commits

...

8 Commits

Author SHA1 Message Date
GitHub Action
6c758d1400 fix(i18n): Auto update translations for PR #10090 2025-10-29 14:41:41 +00:00
icarus
a4b19f7650 docs(i18n): add missing terminal translation key 2025-10-29 22:40:46 +08:00
GitHub Action
97b3608786 fix(i18n): Auto update translations for PR #10090 2025-10-29 12:54:58 +00:00
icarus
793625d009 docs: add terminal implementation guide for electron applications
Add comprehensive documentation analyzing VS Code terminal implementation and providing two approaches:
1. Pure JavaScript solution (recommended) - no compilation required
2. node-pty solution - more complete but requires compilation

The guide covers architecture, implementation details, performance considerations, and security best practices for both approaches.
2025-10-29 20:54:13 +08:00
icarus
00ee90a857 feat(terminal): add placeholder for unimplemented terminal page 2025-10-29 20:54:13 +08:00
icarus
1200f9973c build: add @xterm/xterm dependency for terminal functionality 2025-10-29 20:54:13 +08:00
icarus
4f107e9305 feat(terminal): add terminal page with routing and navigation
- Add new terminal page component
- Include terminal route in router configuration
- Add terminal title to i18n labels
- Add terminal icon to tab component
2025-10-29 20:54:13 +08:00
icarus
eaf4bd18a3 feat(launchpad): add terminal entry to launchpad menu
Add new terminal option to the launchpad with corresponding icon and route. The terminal entry uses a dark gradient background to match its command-line interface theme.
2025-10-29 20:53:51 +08:00
18 changed files with 1145 additions and 2 deletions

File diff suppressed because it is too large Load Diff

View File

@@ -229,6 +229,7 @@
"@vitest/web-worker": "^3.2.4",
"@viz-js/lang-dot": "^1.0.5",
"@viz-js/viz": "^3.14.0",
"@xterm/xterm": "^5.5.0",
"@xyflow/react": "^12.4.4",
"ai": "^5.0.76",
"antd": "patch:antd@npm%3A5.27.0#~/.yarn/patches/antd-npm-5.27.0-aa91c36546.patch",

View File

@@ -20,6 +20,7 @@ import NotesPage from './pages/notes/NotesPage'
import PaintingsRoutePage from './pages/paintings/PaintingsRoutePage'
import SettingsPage from './pages/settings/SettingsPage'
import AssistantPresetsPage from './pages/store/assistants/presets/AssistantPresetsPage'
import { TerminalPage } from './pages/terminal/TerminalPage'
import TranslatePage from './pages/translate/TranslatePage'
const Router: FC = () => {
@@ -40,6 +41,7 @@ const Router: FC = () => {
<Route path="/apps" element={<MinAppsPage />} />
<Route path="/code" element={<CodeToolsPage />} />
<Route path="/settings/*" element={<SettingsPage />} />
<Route path="/terminal" element={<TerminalPage />} />
<Route path="/launchpad" element={<LaunchpadPage />} />
</Routes>
</ErrorBoundary>

View File

@@ -19,6 +19,7 @@ import { classNames } from '@renderer/utils'
import { ThemeMode } from '@shared/data/preference/preferenceTypes'
import type { LRUCache } from 'lru-cache'
import {
Code,
FileSearch,
Folder,
Hammer,
@@ -106,6 +107,8 @@ const getTabIcon = (
case 'settings':
return <Settings size={14} />
case 'code':
return <Code size={14} />
case 'terminal':
return <Terminal size={14} />
default:
return null

View File

@@ -143,7 +143,8 @@ const titleKeyMap = {
notes: 'title.notes',
paintings: 'title.paintings',
settings: 'title.settings',
translate: 'title.translate'
translate: 'title.translate',
terminal: 'title.terminal'
} as const
export const getTitleLabel = (key: string): string => {

View File

@@ -4615,6 +4615,7 @@
"paintings": "Paintings",
"settings": "Settings",
"store": "Assistant Library",
"terminal": "Terminal",
"translate": "Translate"
},
"trace": {

View File

@@ -4615,6 +4615,7 @@
"paintings": "绘画",
"settings": "设置",
"store": "助手库",
"terminal": "终端",
"translate": "翻译"
},
"trace": {

View File

@@ -4615,6 +4615,7 @@
"paintings": "繪畫",
"settings": "設定",
"store": "助手庫",
"terminal": "終端機",
"translate": "翻譯"
},
"trace": {

View File

@@ -4615,6 +4615,7 @@
"paintings": "Zeichnen",
"settings": "Einstellungen",
"store": "Assistenten-Bibliothek",
"terminal": "Terminal",
"translate": "Übersetzen"
},
"trace": {

View File

@@ -4615,6 +4615,7 @@
"paintings": "Ζωγραφική",
"settings": "Ρυθμίσεις",
"store": "Βιβλιοθήκη βοηθών",
"terminal": "Τερματικό",
"translate": "Μετάφραση"
},
"trace": {

View File

@@ -4615,6 +4615,7 @@
"paintings": "Pinturas",
"settings": "Configuración",
"store": "Biblioteca de asistentes",
"terminal": "Terminal",
"translate": "Traducir"
},
"trace": {

View File

@@ -4615,6 +4615,7 @@
"paintings": "Peintures",
"settings": "Paramètres",
"store": "Bibliothèque d'assistants",
"terminal": "Terminal",
"translate": "Traduire"
},
"trace": {

View File

@@ -4615,6 +4615,7 @@
"paintings": "ペインティング",
"settings": "設定",
"store": "アシスタントライブラリ",
"terminal": "ターミナル",
"translate": "翻訳"
},
"trace": {

View File

@@ -4615,6 +4615,7 @@
"paintings": "Pinturas",
"settings": "Configurações",
"store": "Biblioteca de assistentes",
"terminal": "Terminal",
"translate": "Traduzir"
},
"trace": {

View File

@@ -4615,6 +4615,7 @@
"paintings": "Рисунки",
"settings": "Настройки",
"store": "Библиотека помощников",
"terminal": "Терминал",
"translate": "Перевод"
},
"trace": {

View File

@@ -1,7 +1,7 @@
import App from '@renderer/components/MinApp/MinApp'
import { useMinapps } from '@renderer/hooks/useMinapps'
import { useSettings } from '@renderer/hooks/useSettings'
import { Code, FileSearch, Folder, Languages, LayoutGrid, NotepadText, Palette, Sparkle } from 'lucide-react'
import { Code, FileSearch, Folder, Languages, LayoutGrid, NotepadText, Palette, Sparkle, Terminal } from 'lucide-react'
import type { FC } from 'react'
import { useMemo } from 'react'
import { useTranslation } from 'react-i18next'
@@ -57,6 +57,12 @@ const LaunchpadPage: FC = () => {
path: '/code',
bgColor: 'linear-gradient(135deg, #1F2937, #374151)' // Code CLI高级暗黑色代表专业和技术
},
{
icon: <Terminal size={32} className="icon" />,
text: t('title.terminal'),
path: '/terminal',
bgColor: 'linear-gradient(135deg, #000000, #1F2937)' // Terminal纯黑渐变代表命令行界面
},
{
icon: <NotepadText size={32} className="icon" />,
text: t('title.notes'),

View File

@@ -0,0 +1,19 @@
import { Navbar, NavbarCenter } from '@renderer/components/app/Navbar'
import { FC } from 'react'
import { useTranslation } from 'react-i18next'
export const TerminalPage: FC = () => {
// const { pathname } = useLocation()
const { t } = useTranslation()
// const isRoute = (path: string): string => (pathname.startsWith(path) ? 'active' : '')
return (
<div>
<Navbar>
<NavbarCenter style={{ borderRight: 'none' }}>{t('title.terminal')}</NavbarCenter>
</Navbar>
<div>🥲 Not Implemented</div>
</div>
)
}

View File

@@ -17123,6 +17123,13 @@ __metadata:
languageName: node
linkType: hard
"@xterm/xterm@npm:^5.5.0":
version: 5.5.0
resolution: "@xterm/xterm@npm:5.5.0"
checksum: 10c0/358801feece58617d777b2783bec68dac1f52f736da3b0317f71a34f4e25431fb0b1920244f678b8d673f797145b4858c2a5ccb463a4a6df7c10c9093f1c9267
languageName: node
linkType: hard
"@xyflow/react@npm:^12.4.4":
version: 12.5.6
resolution: "@xyflow/react@npm:12.5.6"
@@ -17303,6 +17310,7 @@ __metadata:
"@vitest/web-worker": "npm:^3.2.4"
"@viz-js/lang-dot": "npm:^1.0.5"
"@viz-js/viz": "npm:^3.14.0"
"@xterm/xterm": "npm:^5.5.0"
"@xyflow/react": "npm:^12.4.4"
ai: "npm:^5.0.76"
antd: "patch:antd@npm%3A5.27.0#~/.yarn/patches/antd-npm-5.27.0-aa91c36546.patch"