Repository navigation
feat: file view menu, file size in metadata, chart series cap, and metadata render fix - #57
Open
CritasWang wants to merge 13 commits into
Open
CritasWang wants to merge 13 commits into
CritasWang wants to merge 13 commits into
Conversation
…me on the chart axis - extract the per-file view switcher into FileViewNav so the three view pages share one button set: back first, then the other views in a fixed order, and the current view's own button last as the primary (blue) one. Before this the data preview page highlighted "chart" and the metadata page highlighted "data preview", i.e. the highlight pointed at a button that leaves the current page. - chart time axis: labels used to render HH:mm only, so a multi-day series showed a row of identical times (00:00, 00:00, ...). Labels now render the full "YYYY-MM-DD HH:mm:ss", the dataZoom slider uses the same formatter, and hideOverlap drops the labels that would collide at high tick density. Clicking a file already defaults to the data preview page, and the page title still names the current view in the top-left corner.
CritasWang
force-pushed
the
fix/view-nav-highlight-and-axis-date
branch
from
November 25, 2026 09:30
5915ac6 to
cb3e9af
Compare
- backend: TreeNode carries the file size in bytes (absent for directories, so the JSON stays free of nulls) and the tree endpoint reports it. - backend: rewrite the directory listing so every entry is stat-ed once up front (Files.readAttributes + a pre-sorted entry list) instead of calling Files.isDirectory inside the sort comparator, which cost O(n log n) syscalls per listing. Filtering, sorting (directories first, then name) and the lazy-loading split are unchanged. - frontend: render a right-aligned size badge next to each file in both the browsing tree and the search tree; the badge shows the on-disk size only, so it needs no per-file request or TsFile parsing.
…ables Opening a file with hundreds of tables (277eacd3a2864578_part_0.tsfile has 225) froze the UI on the metadata page. Two things combined: - TablesTable auto-expanded every table when the metadata arrived; - el-collapse-item keeps its slot content mounted and only hides it with v-show, so every expanded table built two el-tables right away. For 225 tables that is ~450 el-tables, 4,275 table rows and a ~6.9 MB initial DOM in one synchronous render. Now the panel content is rendered only while its panel is expanded (v-if), and only the first table is expanded by default. Collapsed panels cost a single header row, and a table's two el-tables are built when it is actually opened. Measured on that file with a production build: initial DOM 6.9 MB -> 0.9 MB, rendered table rows 4,275 -> 29, and expanding/collapsing a panel still renders and measures its tables correctly.
FileViewNav used to move the current view's button to the rightmost slot and make it the primary one, so the button row shifted on every page switch (data preview: back/metadata/chart/[data preview], chart: back/metadata/data preview/[chart], metadata: back/data preview/chart/[metadata]). Every view page now renders the same row in the same order -- back / metadata / chart visualization / data preview -- with data preview always the primary (blue) button on the right, because it is the page each file lands on. Clicking it while already there stays a no-op instead of raising a duplicate-navigation error.
- FileViewNav now renders link buttons instead of filled ones, so the view switcher no longer competes with the primary buttons in the page content. The fixed order stays back / metadata / chart / data preview, with data preview highlighted by the primary text colour rather than a filled background. - the chart page only requests the first MAX_CHART_SERIES (50) selected measurements, and ChartPanel reports how many were left out. Selecting 198 fields used to hit the "too many series" wall and draw nothing; now the first 50 are drawn with a warning that explains the cap. The constant moved to utils/chartLimits.ts so the view and the panel share one source.
TsFileMetadataDTO gains a fileSize field and MetadataService stats the file while building the summary, so a page header can show "file / size" without a second request or a directory listing round-trip.
- FileViewNav becomes a horizontal menu above the content: link-style items in a fixed order (back / data preview / chart / metadata) with the current view underlined. The three views drop their duplicate page title and show a single "file: xxx size: yyy" line instead, fed by the new metadata field. - clicking a file in the sidebar now keeps the current view: on the chart or metadata page it only swaps the file instead of jumping back to the data preview; pages outside the three views still land on the data preview. - the filter panels clear their whole state (table, devices, fields, time range, quick range, advanced conditions) when the fileId changes, and TablesTable re-expands the first table of the newly loaded file. - the chart draws only the first 50 returned series and reports how many were omitted. The API expands one series per device x measurement, so a single selected field can come back as hundreds of series; capping the selected fields alone did not avoid the "too many series" wall. The chart height offset follows the shorter header.
…ts on load The chart-mode filter panels picked the first N numeric fields by themselves and immediately ran the query. After switching files that produced a chart with conditions the user never chose, which read as "the previous file's conditions were carried over" — in fact the panel was only showing its own auto-selection. Both panels now load empty and only query on an explicit apply; the chart keeps its "no data yet" hint until measurements are selected. The unused default-selection helper and its series cap constant are gone with it.
…urements The chart-mode filter panels pick the file's numeric fields and query on load again, so opening a chart shows data immediately (and a file switch shows the new file's chart without extra clicks). The default selection is capped at MAX_CHART_SERIES (50) instead of the previous hard-coded 8, sharing the limit with the chart's series cap; the per-file reset added earlier still runs first, so the defaults always come from the newly loaded file's metadata.
Runtime: axios 1.13.4 -> 1.21.1 (13 advisories, incl. prototype-pollution and credential leak), vue-i18n 11.2.8 -> 11.4.24 (+@intlify), vue 3.5.27 -> 3.5.46, element-plus 2.14.8, echarts 6.1.0, vue-router 4.6.5. Build chain: vite 8.0.0-beta.13 -> 8.4.0-beta.2 (the `beta` dist-tag), vue-tsc 3.3.14, @vitejs/plugin-vue(-jsx), unplugin-auto-import/components, sass 1.108.2, postcss 8.5.33, autoprefixer, tailwindcss 3.4.19, eslint 10.15.0, oxlint 1.95.0, oxfmt 0.80.0. `pnpm audit` goes from 3 critical / 33 high / 31 moderate / 4 low to 0. The last few findings were transitive build-only packages whose parents had not widened their ranges yet, so pnpm-workspace.yaml pins them via overrides. pnpm-workspace.yaml also carries `allowBuilds: {'@parcel/watcher': true}` — pnpm 12 rejects that install script otherwise (it broke `build-dist.sh`'s pnpm install).
spring-boot-starter-parent 4.0.1 -> 4.0.10 (same minor, newest patch) pulls the patched Tomcat 11.0.x, Spring 7.0.x and Jackson 3.0.x; an OSV scan of the runtime classpath drops from 84 advisories across 15 artifacts to 0. snappy-java is transitive via org.apache.tsfile:tsfile 2.5.0 and still sat on 1.1.10.5 (3 advisories), so it is pinned to 1.1.10.12 through dependencyManagement. Also: caffeine 3.2.0 -> 3.3.1, spotless-maven-plugin 2.43.0 -> 3.12.0 (it now loads on JDK 25, previously it failed with a plugin classloading error), and google-java-format 1.22.0 -> 2.0.0. mvn test: 338 tests, 0 failures.
ASF only requires the github-actions ecosystem; npm and maven are supported and configured the same way as any GitHub repository (https://infra.apache.org/dependabot.html). Adding them means the frontend and backend dependency updates stop being a manual, once-in-a-while audit. Both entries follow the existing conventions: monthly, a 4-day cooldown so a release can settle, one grouped PR for routine bumps and one for security fixes.
The Spotless check could not even load before the plugin upgrade, so the sources had never been verified against the configured formatter. With spotless-maven-plugin 3.12.0 + google-java-format 2.0.0 the check runs again and reported 46 files, all of which are reformatted here. Formatting only (net -63 lines): import order, line wrapping and blank lines. No behaviour change; mvn spotless:check is now clean and mvn test still passes (338 tests, 0 failures).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changed
1. A top menu for the three file views
FileViewNavis now a horizontal menu above the content, with a fixed order:back / data preview / chart visualization / metadata. Items are link-style so they
no longer compete with the filled buttons in the page content,
backis separatedby a divider, and the current view is underlined in the primary colour.
The three views drop their duplicated page title (the menu already says where you
are) and show a single line instead:
file: xxx size: yyy. The size comes from anew
fileSizefield on the metadata response, so it costs no extra request.The menu is rendered by all three views, so switching views never moves the items.
2. Clicking a file keeps the current view
On the chart or metadata page, picking another file in the sidebar now swaps the
file and stays on that page (previously it always jumped to the data preview).
Pages outside the three views still land on the data preview. The filter panels
clear their whole state on a file change (table, devices, fields, time range, quick
range, advanced conditions), and the metadata tables tab re-expands the first table
of the newly loaded file.
The chart-mode panels no longer pre-select the first numeric fields and query on
load: they stay empty until "apply filter" is clicked, so a chart never shows
conditions the user did not choose (previously switching files looked like the
previous file's conditions had been carried over).
3. Chart time axis shows the full date and time
Labels now render
YYYY-MM-DD HH:mm:ssinstead ofHH:mm(a multi-day series usedto show a row of identical
00:00), thedataZoomslider uses the same formatter,and
hideOverlapdrops labels that would collide.4. The chart draws at most 50 series
The API expands one series per device x measurement, so a single selected field can
come back as hundreds of series (
nasa_cmapss_rulhas 1,416 devices). Capping theselected fields alone still hit the "too many series" wall. The chart page now
requests at most 50 fields and draws only the first 50 returned series, reporting
how many were omitted; the limit lives in
utils/chartLimits.tsso the view and thepanel share one source.
5. File size badges in the file tree
The sidebar tree shows the on-disk size of each file (
3.9 MB,537 B, …) in boththe browsing and search trees.
TreeNodegained asizefield omitted fordirectories, and
FileService's listing was rewritten to stat each entry exactlyonce (
Files.readAttributes+ a pre-sorted list) instead of callingFiles.isDirectoryinside the sort comparator (O(n log n) syscalls per listing).6. Metadata page no longer stalls on files with many tables
TablesTableauto-expanded every table, andel-collapse-itemkeeps its slotcontent mounted (hiding it with
v-show), so a file with 225 tables built ~450el-tableinstances, 4,275 rows and a ~6.9 MB DOM in one synchronous render. Panelcontent is now rendered only while expanded and only the first table starts
expanded: initial DOM 6.9 MB → 0.9 MB, rendered rows 4,275 → 24.
7. Dependency refresh and a clean audit
Frontend: axios 1.21.1, vue-i18n 11.4.24, vue 3.5.46, element-plus 2.14.8, echarts
6.1.0, plus the build chain (vite 8.4.0-beta.2, vue-tsc 3.3.14, sass 1.108.2,
postcss 8.5.33, eslint 10.15, oxlint 1.95, oxfmt 0.80).
pnpm auditgoes from 3critical / 33 high / 31 moderate / 4 low to 0; the last transitive build-only ones
are pinned through overrides in the new
pnpm-workspace.yaml, which also approves@parcel/watcher's install script (pnpm 12 refuses it otherwise, which used to breakbuild-dist.sh).Backend:
spring-boot-starter-parent4.0.1 -> 4.0.10 (patched Tomcat/Spring/Jackson),caffeine 3.3.1, snappy-java pinned to 1.1.10.12, spotless 3.12.0 (now loads under JDK
25), google-java-format 2.0.0. An OSV scan of the runtime classpath drops from 84
advisories across 15 artifacts to 0.
mvn test: 338 tests, 0 failures.The backend sources are now formatted with that formatter: with the plugin finally
loadable,
mvn spotless:checkreported 46 files, so they are reformatted in aformatting-only commit (no behaviour change) and
mvn verifyis green end to end(338 tests + spotless check).
Dependabot now also watches
npm(/frontend) andmaven(/backend); ASF mandates thegithub-actions ecosystem only, the other two are supported and configured the same
way, with the existing monthly schedule, cooldown and groups.
Verification
pnpm lint: 0 warnings / 0 errors;pnpm build(vue-tsc --noEmit+vite build): passesmvn test(whole backend suite): passes/api/metareturnsfileSize(e.g. 4080620 →3.9 MB).only the file changes; from the file list a click still opens the data preview.
reg_forecasting_v2.tsfile:00:00 / 00:00 …→2020-03-01 00:00:00 / 2020-05-01 00:00:00 / …, no overlapping text at 756px.nasa_cmapss_rul: one field → 200 series returned → 50 drawn with"showing the first 50 series (150 more not shown)", no "too many series" wall.
1.8 KB / 537 B / 3.9 MBbadges; 250-entry listing: 54.2 KB →57.7 KB payload, warm latency 36.7/31.4/38.1 ms → 13.6/7.9 ms.
277eacd3a2864578_part_0.tsfilemetadata page opens without stalling.