This commit is contained in:
2026-07-07 00:21:53 +08:00
parent 8ad8af7e6b
commit b1d318ae52
7 changed files with 55 additions and 20 deletions

View File

@@ -0,0 +1,14 @@
{
"topic_20260706-145507_076a32df5f4276b5": {
"stage": 3,
"userTurns": 3,
"basisHash": "5e4fde8c4e60c795",
"updatedAt": 1783351770990
},
"topic_20260706-153317_238f65a7a470703c": {
"stage": 1,
"userTurns": 1,
"basisHash": "8f279ebcb96d036b",
"updatedAt": 1783352872251
}
}

View File

@@ -1,4 +1,6 @@
{
"topic_20260630-144952_fd0584fe8f266d6a": 1782830992641,
"topic_20260703-022850_50330b4eb93f116d": 1783045730616
"topic_20260703-022850_50330b4eb93f116d": 1783045730616,
"topic_20260706-145507_076a32df5f4276b5": 1783349707873,
"topic_20260706-153317_238f65a7a470703c": 1783351997029
}

View File

@@ -26,5 +26,8 @@
"topic_20260703-081048_20d0dd6e24fe0eca": "auto",
"topic_20260703-090137_2a285dcd68326d53": "auto",
"topic_20260703-093407_89b9baa209988cbb": "auto",
"topic_20260706-025751_d46402fb217a34e9": "auto"
"topic_20260706-025751_d46402fb217a34e9": "auto",
"topic_20260706-142728_07221245f16f20ec": "auto",
"topic_20260706-145507_076a32df5f4276b5": "auto",
"topic_20260706-153317_238f65a7a470703c": "auto"
}

View File

@@ -26,5 +26,8 @@
"topic_20260703-081048_20d0dd6e24fe0eca": "在渲染的时候有几个问题需要修改,第一…",
"topic_20260703-090137_2a285dcd68326d53": "帮我检查一下这个页面为什么渲染不出来…",
"topic_20260703-093407_89b9baa209988cbb": "帮我检查一下这个页面为什么渲染不出来…",
"topic_20260706-025751_d46402fb217a34e9": "这个页面现在是用cm6实现的预览功能…"
"topic_20260706-025751_d46402fb217a34e9": "这个页面现在是用cm6实现的预览功能…",
"topic_20260706-142728_07221245f16f20ec": "已粘贴文本 #1 · 26 行] …",
"topic_20260706-145507_076a32df5f4276b5": "当用户选中了侧边栏中的文件的时候,这…",
"topic_20260706-153317_238f65a7a470703c": "文件被选中的高亮颜色不太搭配现在的主…"
}

View File

@@ -5,3 +5,7 @@ This template should help get you started developing with Vue 3 and TypeScript i
## Recommended IDE Setup
- [VS Code](https://code.visualstudio.com/) + [Vue - Official](https://marketplace.visualstudio.com/items?itemName=Vue.volar) + [Tauri](https://marketplace.visualstudio.com/items?itemName=tauri-apps.tauri-vscode) + [rust-analyzer](https://marketplace.visualstudio.com/items?itemName=rust-lang.rust-analyzer)
$env:HTTPS_PROXY="http://127.0.0.1:10808"

View File

@@ -149,6 +149,7 @@ const showSettings = ref(false);
v-if="rootEntry"
:entry="rootEntry"
:depth="0"
:currentFilePath="currentFilePath"
@toggle-folder="(path: string) => emit('toggleFolder', path)"
@open-file="(path: string) => emit('openFile', path)"
/>

View File

@@ -4,7 +4,7 @@ export default { name: "TreeEntry" };
</script>
<script setup lang="ts">
import { ref, watch } from "vue";
import { computed, ref, watch } from "vue";
interface DirEntry {
name: string;
@@ -16,6 +16,7 @@ interface DirEntry {
const props = defineProps<{
entry: DirEntry;
depth: number;
currentFilePath?: string | null;
}>();
const emit = defineEmits<{
@@ -35,13 +36,15 @@ watch(
},
);
const isActive = computed(() => {
return props.currentFilePath != null && props.currentFilePath === props.entry.path;
});
function onClick() {
if (props.entry.is_dir) {
if (props.entry.children === undefined) {
// Not loaded yet — ask parent to load
emit("toggleFolder", props.entry.path);
} else {
// Already loaded — toggle visibility
expanded.value = !expanded.value;
}
} else {
@@ -51,10 +54,9 @@ function onClick() {
</script>
<template>
<div>
<!-- Folder -->
<template v-if="entry.is_dir">
<!-- Folder label -->
<div
v-if="entry.is_dir"
class="flex items-center gap-1 px-2 py-1 rounded-md text-sm text-[#5c574e] hover:bg-[#ede8de] cursor-pointer select-none"
:style="{ paddingLeft: `${depth * 16 + 8}px` }"
@click="onClick"
@@ -68,26 +70,32 @@ function onClick() {
</div>
<!-- Children (recursive) -->
<template v-if="entry.is_dir && expanded && entry.children">
<template v-if="expanded && entry.children">
<TreeEntry
v-for="child in entry.children"
:key="child.path"
:entry="child"
:depth="depth + 1"
:currentFilePath="currentFilePath"
@toggle-folder="(path: string) => emit('toggleFolder', path)"
@open-file="(path: string) => emit('openFile', path)"
/>
</template>
</template>
<!-- File -->
<div
v-else-if="!entry.is_dir"
class="flex items-center gap-1.5 px-2 py-1 rounded-md text-sm text-[#8c877d] hover:bg-[#ede8de] hover:text-[#38342e] cursor-pointer"
:style="{ paddingLeft: `${depth * 16 + 8}px` }"
@click="onClick"
>
<i class="ri-file-line text-sm text-[#bf6a3b]/60 shrink-0"></i>
<span class="truncate">{{ entry.name }}</span>
</div>
<!-- File -->
<div
v-else
:class="[
'flex items-center gap-1.5 px-2 py-1 rounded-md text-sm cursor-pointer transition-colors',
isActive
? 'bg-[#ede8de] text-[#bf6a3b] font-medium'
: 'text-[#8c877d] hover:bg-[#ede8de] hover:text-[#38342e]',
]"
:style="{ paddingLeft: `${depth * 16 + 8}px` }"
@click="onClick"
>
<i class="ri-file-line text-sm text-[#bf6a3b]/60 shrink-0"></i>
<span class="truncate">{{ entry.name }}</span>
</div>
</template>