Compare commits

...

2 Commits

Author SHA1 Message Date
baa42fa625 feat: add build version display to all views
Add build version indicator to verify code updates:

1. Create BuildVersion.vue component:
   - Displays in top-right corner (fixed position)
   - Format: YYYYMMDDHHMMSS-gitHash
   - Example: 20260725133504-39ce37e

2. Update vite.config.ts:
   - Inject __BUILD_VERSION__ global variable
   - Generated from build time + git commit hash

3. Add to App.vue:
   - Shown on all views automatically
   - Z-index: 9999 (always visible)

4. Add vite-env.d.ts:
   - TypeScript declarations for __BUILD_VERSION__

Purpose:
- User can verify if browser loaded latest code
- Easy to confirm updates are deployed
- No need to check source code

Location: Top-right corner, fixed position
Format: Monospace font, small text, subtle styling
2026-07-25 13:35:41 +08:00
39ce37e69c fix: remove premature updateClusterAfterMerge call in merge loop
Critical bug fix:
- updateClusterAfterMerge() was called after EACH trace merge
- This caused source group to be deleted after first trace
- Remaining traces had no group to merge into

Problem flow:
1. Merge trace #1 from Group B → Group A
2. updateClusterAfterMerge(B, A) deletes Group B
3. Try to merge trace #2 from Group B → Group B is gone!
4. Result: All source groups deleted after first trace

Solution:
- Remove updateClusterAfterMerge() from loop
- Let all traces merge successfully
- Reload cluster data at the end (Line 1813)
- Core API handles the merge, we just refresh UI

Impact:
- Merge now works correctly for all traces in a group
- No premature deletion of source groups
- UI refreshes after all operations complete
2026-07-25 13:29:47 +08:00
4 changed files with 41 additions and 1 deletions

View File

@@ -0,0 +1,22 @@
<template>
<div class="build-version">{{ version }}</div>
</template>
<script setup lang="ts">
const version = __BUILD_VERSION__
</script>
<style scoped>
.build-version {
position: fixed;
top: 8px;
right: 8px;
font-size: 10px;
color: var(--text-secondary, #9aa0a6);
background: var(--bg-secondary, rgba(0,0,0,0.1));
padding: 2px 6px;
border-radius: 3px;
z-index: 9999;
font-family: monospace;
}
</style>

View File

@@ -1796,7 +1796,6 @@ async function executeMerge(targetGroupId: string) {
target_id: targetTraceId
})
successCount++
updateClusterAfterMerge(g.identity_uuid, targetGroupId)
} catch (e) {
console.error('Merge trace failed:', srcTraceId, e)
failCount++

11
src/vite-env.d.ts vendored Normal file
View File

@@ -0,0 +1,11 @@
/// <reference types="vite/client" />
declare const __BUILD_VERSION__: string
interface ImportMetaEnv {
readonly VITE_APP_TITLE: string
}
interface ImportMeta {
readonly env: ImportMetaEnv
}

View File

@@ -1,9 +1,17 @@
import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import { resolve } from 'path'
import { execSync } from 'child_process'
const gitHash = execSync('git log --format="%h" -1', { encoding: 'utf-8' }).trim()
const buildTime = new Date().toISOString().slice(0, 19).replace(/[-:T]/g, '')
const buildVersion = `${buildTime}-${gitHash}`
export default defineConfig({
plugins: [vue()],
define: {
__BUILD_VERSION__: JSON.stringify(buildVersion)
},
resolve: {
alias: {
'@': resolve(__dirname, 'src')