Skip to content

fix: migrate to el-select-v2 virtualized selects and fix filename display on refresh - #35

Open
CritasWang wants to merge 1 commit into
apache:mainfrom
CritasWang:fix/select-v2-and-filename-display
Open

fix: migrate to el-select-v2 virtualized selects and fix filename display on refresh#35
CritasWang wants to merge 1 commit into
apache:mainfrom
CritasWang:fix/select-v2-and-filename-display

Conversation

@CritasWang

@CritasWang CritasWang commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

Summary

Three fixes in this PR:

1. Migrate filter selects to virtualized el-select-v2 (performance fix for #33 follow-up)

Problem: TableFilterPanel and TreeFilterPanel used el-select with v-for-rendered <el-option> elements. When a TsFile has hundreds or thousands of devices/measurements, every option becomes a real DOM node, causing severe layout jank — especially when coupled with v-loading's overlay DOM flip between loading/content states.

Fix:

  • Replaced all el-select + <el-option> with ElSelectV2 (Element Plus's virtualized select component), which only renders ~10 visible DOM nodes regardless of option count
  • Replaced v-loading (which creates/destroys a full-cover overlay div, triggering reflows) with a thin CSS-only animated progress bar at the top of each filter panel

2. Fix filename display turning into garbage/junk after page refresh

Problem: Uploaded files get a UUID-format fileId (e.g. a1b2c3d4e5f6). After a browser refresh, currentFileName is lost from memory, and displayFileName falls back to decodeFileId(fileId) — which tries to base64-decode a UUID hex string, producing garbled characters.

Fix:

  • Persist currentFileName to localStorage via restoreCurrentFile(), called at setup time (before watchers fire)
  • Add UUID-format detection (/^[0-9a-fA-F]{8,32}$/) to skip base64 decode for upload IDs
  • Support both Unix (/) and Windows (\) path separators in basename extraction

3. Clean up leftover onMounted in chart view

Removed a dangling onMounted(() => fileStore.restoreCurrentFile()) from the chart view (the call now happens in setup()).

…play on refresh

- Replace el-select with ElSelectV2 (virtualized) in TableFilterPanel and TreeFilterPanel
  to eliminate DOM node explosion and layout jank with large option lists
- Replace v-loading overlay with a thin CSS-only progress bar to avoid
  DOM creation/destruction during metadata loading
- Persist currentFileName to localStorage so the page header subtitle
  survives a browser refresh instead of falling back to decoding the
  fileId as base64 (which produces garbage for UUID-format IDs)
- Support both Unix and Windows path separators in displayFileName
  basename extraction
- Add UUID-format fileId detection to skip base64 decode attempt
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant