Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file modified build/icon.icns
Binary file not shown.
Binary file modified build/icon.ico
Binary file not shown.
Binary file modified build/icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,6 @@
"better-sqlite3-multiple-ciphers": "12.4.1",
"cheerio": "^1.1.2",
"compare-versions": "^6.1.1",
"dayjs": "^1.11.18",
"diff": "^7.0.0",
"electron-log": "^5.4.3",
"electron-store": "^8.2.0",
Expand Down Expand Up @@ -174,6 +173,7 @@
"vue-virtual-scroller": "^2.0.0-beta.8",
"vuedraggable": "^4.1.0",
"yaml": "^2.8.1",
"dayjs": "^1.11.18",
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion | 🟠 Major

🧩 Analysis chain

dayjs is under devDependencies; verify runtime usage and move to dependencies if imported in app code.

If dayjs is used at runtime (main/preload/renderer), keeping it in devDependencies risks missing module errors after production prune/packaging. Prefer placing runtime libs in "dependencies".

Run this to confirm where dayjs is used:

If used at runtime, apply:

-    "dayjs": "^1.11.18",

and add it to "dependencies" (example placement):

   "dependencies": {
+    "dayjs": "^1.11.18",
     "@anthropic-ai/sdk": "^0.53.0",
     ...
   }

🏁 Script executed:

#!/bin/bash
# Find all imports/usages of dayjs with context
rg -nP -C2 --glob '!**/node_modules/**' '(import\s+.+\s+from\s+[\"\']dayjs[\"\']|require\(\s*[\"\']dayjs[\"\']\s*\))' --type=js --type=ts --type=tsx --type=vue

Length of output: 246


🏁 Script executed:

#!/bin/bash
# Corrected search for dayjs imports and requires across JS/TS/TSX/Vue files
rg -nP -C2 --glob '!**/node_modules/**' -g '*.js' -g '*.ts' -g '*.tsx' -g '*.vue' "(import\s+.+\s+from\s+['\"]dayjs['\"]|require\(\s*['\"]dayjs['\"]\s*\))"

Length of output: 457


Move dayjs to dependencies

dayjs is imported in src/renderer/src/components/settings/KnowledgeFileItem.vue and used at runtime; listing it under devDependencies risks it being pruned from production builds. Remove it from devDependencies and add it under dependencies in package.json:

--- package.json
@@ dependencies
+    "dayjs": "^1.11.18",
@@ devDependencies
-    "dayjs": "^1.11.18",
🤖 Prompt for AI Agents
In package.json around line 176, dayjs is currently listed under devDependencies
but is imported at runtime in
src/renderer/src/components/settings/KnowledgeFileItem.vue; remove the "dayjs":
"^1.11.18" entry from devDependencies and add the exact same entry under
dependencies (i.e. "dayjs": "^1.11.18"); after editing package.json update the
lockfile by running your package manager install (npm install or yarn) so the
production install includes dayjs.

"zod-to-json-schema": "^3.24.6"
},
"simple-git-hooks": {
Expand Down
Binary file modified resources/icon.ico
Binary file not shown.
Binary file modified resources/icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified resources/linux_tray.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified resources/win_tray.ico
Binary file not shown.
8 changes: 4 additions & 4 deletions src/main/presenter/tabPresenter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ export class TabPresenter implements ITabPresenter {
}
})

view.setBorderRadius(8)
view.setBorderRadius(0)
view.setBackgroundColor('#00ffffff')

// 加载内容
Expand Down Expand Up @@ -637,11 +637,11 @@ export class TabPresenter implements ITabPresenter {
const { width, height } = window.getContentBounds()

// 设置视图位置大小(留出顶部标签栏空间)
const TAB_BAR_HEIGHT = 40 // 标签栏高度,需要根据实际UI调整
const TAB_BAR_HEIGHT = 36 // 标签栏高度,需要根据实际UI调整
view.setBounds({
x: 4,
x: 0,
y: TAB_BAR_HEIGHT,
width: width - 8,
width: width,
height: height - TAB_BAR_HEIGHT - 4
})
}
Expand Down
2 changes: 1 addition & 1 deletion src/main/presenter/windowPresenter/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -954,7 +954,7 @@ export class WindowPresenter implements IWindowPresenter {

// 开发模式下可选开启 DevTools
if (is.dev) {
// shellWindow.webContents.openDevTools({ mode: 'detach' });
shellWindow.webContents.openDevTools({ mode: 'detach' })
}

console.log(`Shell window ${windowId} created successfully.`)
Expand Down
7 changes: 1 addition & 6 deletions src/renderer/shell/App.vue
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
<template>
<div
class="w-screen h-screen"
:class="[isMacOS ? 'bg-transparent' : themeStore.isDark ? 'bg-zinc-900' : 'bg-zinc-200']"
>
<div class="w-screen h-screen" :class="[isMacOS ? 'bg-transparent' : 'bg-card/50']">
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Inconsistent token usage: use new bg-bg-card token.

The class bg-card/50 references the old --card token, but the PR introduces a new --bg-card token (defined in style.css lines 117/175). Other components in this PR (e.g., AppBarTabItem.vue line 6) use bg-bg-card to reference the new token.

Apply this diff to use the new token:

-  <div class="w-screen h-screen" :class="[isMacOS ? 'bg-transparent' : 'bg-card/50']">
+  <div class="w-screen h-screen" :class="[isMacOS ? 'bg-transparent' : 'bg-bg-card/50']">
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
<div class="w-screen h-screen" :class="[isMacOS ? 'bg-transparent' : 'bg-card/50']">
<div class="w-screen h-screen" :class="[isMacOS ? 'bg-transparent' : 'bg-bg-card/50']">
🤖 Prompt for AI Agents
In src/renderer/shell/App.vue around line 2, the conditional class uses the old
token `bg-card/50`; update it to use the new token by replacing `bg-card/50`
with `bg-bg-card/50` so the ternary becomes (isMacOS ? 'bg-transparent' :
'bg-bg-card/50'), matching the new --bg-card token used elsewhere.

<AppBar />
<main class="content-container">
<!-- WebContentsView will be rendered here by the main process -->
Expand All @@ -14,9 +11,7 @@
import AppBar from './components/AppBar.vue'
import { ref, onMounted } from 'vue'
import { usePresenter } from '@/composables/usePresenter'
import { useThemeStore } from '@/stores/theme'
const isMacOS = ref(false)
const themeStore = useThemeStore()
const devicePresenter = usePresenter('devicePresenter')
// Shell component setup
onMounted(() => {
Expand Down
12 changes: 6 additions & 6 deletions src/renderer/shell/components/AppBar.vue
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<template>
<div class="flex flex-row h-10" :dir="langStore.dir">
<div class="flex flex-row h-9" :dir="langStore.dir">
<div
class="h-10 shrink-0 w-0 flex-1 flex select-none text-center text-sm font-medium flex-row items-center justify-start window-drag-region"
:class="['', isMacOS ? (isFullscreened ? 'pl-2 pr-2' : 'pl-20 pr-2') : 'px-2']"
class="h-9 shrink-0 w-0 flex-1 flex select-none text-center text-sm font-medium flex-row items-center justify-start window-drag-region"
:class="['', isMacOS ? (isFullscreened ? 'pr-2' : 'pl-20 pr-2') : '']"
>
Comment thread
zerob13 marked this conversation as resolved.
<!-- App title/content in center -->
<Button
Expand All @@ -23,12 +23,12 @@
</Button>
<div
ref="tabContainerWrapper"
class="h-full flex flex-row items-center justify-start overflow-y-hidden overflow-x-auto scrollbar-hide"
class="h-full self-stretch inline-flex flex-row items-center justify-start overflow-y-hidden overflow-x-auto scrollbar-hide"
@scroll="onTabContainerWrapperScroll"
>
<div
ref="tabContainer"
class="h-full flex flex-row items-center justify-start gap-1 relative"
class="h-full flex flex-row items-center justify-start relative"
@dragover="onTabContainerDragOver"
@drop="onTabContainerDrop"
>
Expand Down Expand Up @@ -91,7 +91,7 @@
</Button> -->
</div>

<div v-if="!isMacOS" class="flex h-10">
<div v-if="!isMacOS" class="flex h-9">
<button
class="inline-flex items-center justify-center h-full w-12 hover:bg-zinc-500/20"
@click="minimizeWindow"
Expand Down
10 changes: 3 additions & 7 deletions src/renderer/shell/components/app-bar/AppBarTabItem.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,8 @@
<div
ref="tabItem"
draggable="true"
class="shrink-0 text-xs font-medium pl-2 pr-1 h-7 mt-0.5 rounded-md flex items-center justify-between transition-all duration-200 group"
:class="[
active
? 'bg-white dark:bg-white/10 shadow-sm dark:shadow-[inset_0_0px_1px_0_rgba(255,255,255,0.3)]'
: 'bg-transparent text-secondary-foreground hover:bg-black/20 active:bg-zinc-900/20'
]"
class="shrink-0 text-xs font-medium px-3 h-9 flex items-center justify-between transition-all duration-200 group border-l border-r"
:class="[active ? 'bg-bg-card' : '']"
@dragstart="onDragStart"
@click="onClick"
>
Expand All @@ -16,7 +12,7 @@
</div>
<button
class="ml-2 opacity-0 transition-opacity duration-200 rounded-full hover:bg-zinc-500/20 p-0.5"
:class="[size > 1 ? 'group-hover:opacity-100 ' : 'pointer-events-none cursor-default']"
:class="[size > 1 ? 'group-hover:opacity-100' : 'pointer-events-none cursor-default']"
@click.stop="onClose"
>
<Icon icon="lucide:x" class="w-3 h-3" />
Expand Down
2 changes: 1 addition & 1 deletion src/renderer/src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,7 @@ onBeforeUnmount(() => {
</script>

<template>
<div class="flex flex-col h-screen bg-container">
<div class="flex flex-col h-screen bg-bg-card">
<div class="flex flex-row h-0 grow relative overflow-hidden px-px py-px" :dir="langStore.dir">
<!-- Main content area -->

Expand Down
Binary file modified src/renderer/src/assets/logo-dark.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified src/renderer/src/assets/logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading