Repository navigation
Conversation
- Multi-stage build: dependencies and the production bundle are built in a separate stage; the runtime image only contains dist/, production node_modules and the start script, owned by root and read-only for the app user (only runtime-config.js stays writable) - Run as a dedicated non-root user whose UID/GID can be overridden with USER_UID/USER_GID build args (e.g. for rootless Podman --userns=keep-id); the base image's built-in "node" user is removed to free UID/GID 1000 - node:24-trixie-slim base, pinned apt packages, npm ci - Copy patches/ before installing so patch-package applies them - Copy only the files the build needs instead of the whole context, and keep .env out of the build context - Force LF endings for shell scripts and the Dockerfile so images built from a Windows checkout get a working entrypoint - Lint the Dockerfile with hadolint in the Docker publish workflow
- Add prettier 3 (.prettierrc.json, .prettierignore) with npm run format / format:check, and eslint-config-prettier so ESLint only checks code quality while prettier owns formatting (drop the max-len/indent rules) - Rename .eslintrc.js to .eslintrc.cjs so it keeps loading as CommonJS - Ignore the generated MAVLink binding in src/libs/ for ESLint - Normalize line endings to LF via .gitattributes - Ignore .env (local Cesium token)
Mechanical change only: `npm run format` (prettier 3, tabWidth 4). No code changes.
- package.json: "type": "module"; set NODE_ENV in the dev/build scripts so it is defined before the hoisted config imports read it - build/ and config/: import/export instead of require/module.exports; createRequire for the resolve.fallback polyfills, real filesystem paths (fileURLToPath) for the output directory, default exports for the env configs, package.json read without import assertions, dev server base port restored to 8080 - webpack: keep resolving extensionless imports (fullySpecified: false) - src: replace the remaining require() calls in the parser worker, the MAVLink parser/binding and the plot components with imports - babel.config.cjs stays CommonJS for tools that load it synchronously; name its exported function - .postcssrc.js and scripts/generate-runtime-config.js as ES modules - Remove the unused build/check-versions.js
- Expression helpers are attached to globalThis instead of window - Math.hypot for vector magnitudes, merged Matrix3.fromEuler pushes, integer literals instead of 1.0-style floats - Keep isNaN's coercing semantics where values may be strings (Number.isNaN(Number(x))), fix the globalThisThis typos in lowpass() and interpolate_table() that broke lowpass/expected_mag/expected_earth_field - Keep the file-level camelcase disable: the snake_case helper names are part of the plot expression API
- Arrow functions instead of the _this alias, element.remove(), Number.parseInt/parseFloat, includes(), Date.now(), \d/\w in regexes - Drop a dead regex match whose result was immediately overwritten - Plot setup header wrapped in its own list; darker text for contrast - Keep isNaN's coercing semantics with Number.isNaN(Number(x)): preset colors given as hex strings no longer turn into undefined - Keys stay on the elements inside <template v-for> (Vue 2 rejects keys on <template>) - Rule-specific eslint-disable comments for the Plotly option names, intentional == comparisons and the expression compiler
- Read dropped/selected files with file.arrayBuffer() instead of FileReader; set the log type before reading and show an error status if the file cannot be read - for...of over DataTransferItemList, element.remove(), globalThis, Number.parseInt - Message menu: each type header wrapped in its own list; keys stay on the elements inside <template v-for> (Vue 2 rejects keys on <template>) and the per-type collapse keeps its own key - Keep isNaN's coercing semantics with Number.isNaN(Number(x)) - Remove a scoped .arrow:before rule that matched no element
- globalThis, Number.parseInt, includes(), at(-1), new Array(), Set for the valid GCS types, for...of loops, explicit .js extensions on local imports - PARAM_VALUE: skip a value only when it repeats the last one seen for that parameter (the old check never matched), so repeated parameter dumps no longer show up as parameter changes - Fix the PARAM_VALUE name sanitizing regex in the DataFlash extractor - Flight modes: compare the for...in key as a string - Browser targets: drop IE 11 (it never worked: replaceAll/flatMap are used without polyfills) and dead browsers
- Bathymetry, model and trajectory plotting split into small helpers (grid/hull preparation, depth colors, contours, sampled position and orientation properties, model entity, trajectory segments/primitives) - Wait for the globe tiles to finish loading (public tilesLoaded / tileLoadProgressEvent API, 10 s timeout) instead of a fixed 2 s delay before hiding the loading overlay - Model scale read through a CallbackProperty for the main and comparison vehicles; the scale setting is validated so non-numeric or non-positive input falls back to 1 (submarines keep the 6.86x factor) - Orientation samples outside the GPS range use the nearest trajectory end as reference position - Bathymetry also accepts instanced RFND (RFND[0]), gives up after a timeout and reports failures instead of leaving an unhandled rejection - Contour lines drawn between the neighbouring cells that cross a level - Color coding select labelled with aria-label - globalThis, Number.parseFloat/isNaN, arrow functions, merged pushes
- Header, base message and all 293 message types are ES classes; message types extend mavlink20.message (and call super()) instead of assigning a prototype, which is not allowed on classes - MAVLink20Processor extends EventEmitter instead of util.inherits - Drop the file-level eslint-disable block (the file is ignored by ESLint) Decoding was checked against the previous build: every message type of the sample and ArduCopter autotest tlogs decodes to the same samples.
- Jest 29 with jsdom, babel-jest 29 and @vue/vue2-jest (Jest 24 could not load an ES module config and was paired with babel-jest 28) - ES module Jest config with a real filesystem rootDir; setupFilesAfterEnv replaces the removed setupTestFrameworkScriptFile/mapCoverage options - Specs import the DataFlash parser from the JsDataflashParser submodule (the old parsers/dataflashParser.js no longer exists) and use the current extractor API: attitude and trajectory need an explicit source - Events are asserted for logs that contain EV messages (the old condition could never be true) - Test logs come from $TEST_LOG_DIR, <tmp>/testlogs or test/testlogfiles, matching .bin and .BIN; without logs the suites are skipped instead of failing - package-lock.json follows package.json's 4-space indentation
- e2e runner, spec and custom assertion as ES modules; the runner imports the dev config's default export and cross-spawn instead of require() - Nightwatch config stays CommonJS as nightwatch.conf.cjs - CI workflows build with Node 24 (actions/setup-node@v4); the build scripts need Node >= 20.11 (import.meta.dirname), recorded in engines
- index.html inline scripts use globalThis - parse_mavgraph.py: \w in the message regex, trailing whitespace removed - Remove src/assets/mavlink.js: an unused copy of the MAVLink v1 binding (only src/libs/mavlink.js is imported) - jsconfig.json for editor IntelliSense (ES2024, bundler resolution, @/ alias to src/)
The ES module conversion renamed babel.config.js to babel.config.cjs, so the build stage could not copy it. Verified with podman build/run: the image builds, runs as the non-root user and serves the app.
Guidance for Claude Code: commands, the ES module/prettier conventions, tests and their log files, and the app architecture (worker parsing, global store, extractors, event bus, plot expressions). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
webpack 5 asset modules processed the assets a second time after url-loader/file-loader, so CSS url() references (e.g. font files) pointed at emitted copies of the loader's JavaScript output instead of the real asset. Mark the loader rules as javascript/auto, and export plain strings for fonts, which are only referenced from CSS. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
paths resolve relative to jsconfig.json without it; TypeScript 7 removes baseUrl.
- 3D terrain is loaded from /quantized/ whenever it is served, also offline; plot.ardupilot.org's tileset is only a fallback when online - Flights where the terrain has no detailed data (offline without a tileset, or outside its area) are placed with their takeoff on the visible ground; the height offset stays adjustable in the 3D settings - Mission waypoints use the same height offset as the trajectory - Offline viewer uses Cesium's bundled Natural Earth II imagery (the removed imageryProvider option made it fall back to Cesium ion) - Font Awesome is bundled instead of loaded from a CDN - serve.json serves the gzipped .terrain tiles of a mounted tileset with Content-Encoding: gzip (npm start and the Docker image) - README: building and mounting a terrain tileset for offline use - Info panel: the color coding select sits outside the legend table, which gets a screen-reader-only header Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Same behaviour (poll every 100 ms, reject after 9 s), written as a polling promise so it no longer trips SonarLint's await-in-loop rule.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
JsDataflashParser registers its own standalone worker "message" handler when imported, so every message was handled twice: each file was parsed a second time as DataFlash (also tlogs, which first reported an empty message list and "done" long before the real result), and every later loadType threw "Cannot read properties of undefined (reading 'loadType')". Register the worker's handler first, from a module imported before the parsers, and stop each message there. Also ignore loadType before a file is parsed instead of throwing.
Plotting a message the log does not contain left the full-screen loading overlay on forever (plot() returned early without clearing plotLoading) and the MAVLink parser threw an uncaught error in the worker. Clear the loading state and log the worker error as a warning; the user still gets the "Could not load messageType" alert.
The component registered its loadType/trimFile listeners on every creation and never removed them. It is recreated each time the sidebar shows its home tab, so requests were posted to the worker once per earlier creation, and on-demand loading only kept working after the tab switch because of those leftover listeners. The worker is page-wide, so register the forwarding once.
The icon's click handler referenced an undefined `field` and threw on every click; the click then bubbled to the list item, which toggles the plot. Let the item handle it.
Closing the 3D view (or loading another log) destroyed the component but not
the Cesium viewer: each opening leaked a viewer and its WebGL context, kept a
1 s globe opacity interval and rangeChanged/setzoom listeners running, and
$off("hoveredTime") without a handler removed every component's hoveredTime
listener (plot cursor, attitude, message viewer, RC inputs).
Destroy the viewer, clear the interval and remove only this component's
listeners. Setup that is still waiting for terrain or tiles stops when the
component is gone (this was the "Cannot read properties of undefined
(reading 'append')" error), delayed callbacks return once the viewer is
destroyed, and toolbar/timeline lookups use this viewer's own elements.
A second log in the same page (sent by an embedding page) was read with the first log's data extractor (a tlog extractor finds nothing in a DataFlash log) and kept the first log's flight modes, events, mission, parameters, text messages, mode colors and cached plot data. Pick the extractor per log, clear everything derived from a log before a new one is parsed (resetLogState, used by every parse), recompute the mode color coder's modes per log, and register the embed message listener once instead of once per file manager creation.
maxmimumDistance was a typo, so Cesium kept its 5 km default instead of the intended 10 km shadow distance.
- lowpass(value, key, factor) treated any numeric key as the factor, so the bundled IMU presets lowpass(IMU[0].AccZ,0,0.9) were not filtered at all and lowpass(IMU[1].AccZ,1,0.9) was a flat line. Follow pymavlink: one filter state per key; lowpass(value, factor) still works as a shorthand - Filter state (lowpass/delta) is reset before each expression is evaluated, so plots don't share state and a re-plot starts fresh - altitude()/altitude2() ignored the ground pressure/temperature passed by the caller and could use an undefined temperature (NaN); use the caller's values and fall back to GND_ABS_PRESS/GND_TEMP like pymavlink
Upstream replaced Cesium ion with self-hosted terrain and keyless imagery, so nothing reads the token any more. Remove the runtime-config.js generator, its <script> in index.html, the Docker entrypoint that ran it, the token in the deploy workflows, the leftover banner style and the README instructions. The runtime image no longer has any file writable by the app user; files copied from the build context are made read-only explicitly (a Windows build context has no Unix modes, so they were world-writable).
The suite could not run: it needed a chromedriver package that was not installed, an external Selenium 3 server, and python3/pkill to serve dist/. Nightwatch 3 starts the browser driver itself; the runner serves dist/ with serve on port 8089 (cross-platform) and npm run e2e builds first. Headless Chrome by default, edgeHeadless for machines with only Edge. selenium-webdriver is overridden to 4.51: the 4.27 pinned by Nightwatch downloads Edge drivers from msedgedriver.azureedge.net, which is gone.
Drops development console.log dumps from DeviceIDViewer (devids, per-device decode), EkfHelperTool (messages, time_boot_ms), and MagFitTool (corr, params, getting compass params, data/corrections, bounds, optimizing, optimization result, no message). EkfHelperTool template: removes the unlabeled solutionValue / closestIndex readout above the flag table — the table below already shows every flag and its value. Kept: real error paths (geo-ip failure, singular matrix, skipped compass fields, skipped bad data, no compass data) and the waitForMessages timeout warnings.
computeData() superseded it — both compassData and compassMessageNames are now built in one loop that filters COMPASS_MESSAGE_CANDIDATES against the expected field list. getCompassData() had no callers left and still carried the pre-refactor behaviour (every loaded candidate regardless of fields), so removing it also removes a latent crash source for sampledCompassData.
stylelint.config.js: selector-class-pattern and selector-id-pattern now share one pattern that accepts camelCase, snake_case and BEM (one or two - or _ separators between alphanumeric groups), so .uav-widget__resize, .uav-widget--no-resize and .param-check__box are valid. Also disables no-descending-specificity (documented why) and pins media-feature-range-notation to prefix for Safari < 16.4. widget.css, ParamViewer.vue, TxInputsViewer.vue: shorthand reductions (10px 0 0 0 -> 10px 0 0, 20px 0 20px 0 -> 20px 0, 24px 16px 16px 16px -> 24px 16px 16px), merge overflow-y/overflow-x into overflow: auto hidden, and drop -webkit-appearance (unprefixed since Safari 15.4).
Introduces docs/reorg-plan.md with the full reorg plan: - §1-§2: motivation and locked decisions (Option A, feature slices). - §3: target tree. - §4: facts confirmed by reorg-context.txt. - §5: risk register — every hardcoded path per step. - §6: migration steps (1, 1b, 2, 3, 4a-4d, 5, 6, 7), each with rg pre-check, verification gate and rollback. - §7-§9: verification protocol, rollback, out of scope. - §10: current state. - Appendix A: path reference inventory for CLAUDE.md, eslint.config.js and test/unit/specs/. - Appendix B: verification gates, condensed. - Appendix C: same-commit rule restated.
Pure relocation, no behavior change: - src/eventHub.js -> shared/lib/eventHub.js - src/libs/mavlink.js -> shared/lib/mavlink.js - src/mavextra/*.js -> shared/lib/mavextra/ - src/components/widgets/interpolator.js -> shared/lib/interpolator.js Imports switched to the @/shared/lib/... alias. Two widgets (AttitudeWidget, TxInputsViewer) imported interpolator.js relatively (./interpolator.js) and were caught by npm run build, not by the initial rg sweep — fixed in this commit. eslint.config.js: generated-binding ignore narrows from src/libs/ to src/shared/lib/mavlink.js — ignoring the whole folder would also skip mavextra/, eventHub and interpolator, which are hand-written. CLAUDE.md: three references updated.
The five files in src/tools/ that are neither extractors (step 4c), plot helpers (step 4b) nor parsers (step 4c): - src/tools/cssColor.js -> shared/lib/cssColor.js - src/tools/datetools.js -> shared/lib/datetools.js - src/tools/download.js -> shared/lib/download.js - src/tools/flightTime.js -> shared/lib/flightTime.js - src/tools/paramseeker.js -> shared/lib/paramseeker.js Eleven import sites switched to @/shared/lib/... (Plotly, PlotlyPopup, CesiumViewer, Home, Sidebar, SideBarFileManager, ParamViewer, MagFitTool, dataflashDataExtractor, mavlinkDataExtractor, and test/unit/specs/flightTime.spec.js). One sibling import in dataflashDataExtractor.js (./datetools.js) was not matched by the bulk rewrite and was caught by npm run build — fixed in this commit. CLAUDE.md: tools/flightTime.js -> shared/lib/flightTime.js. src/tools/ now holds only the extractors, plot helpers and parsers that steps 4b and 4c move.
Adds eslint-plugin-no-relative-import-paths with allowSameFolder, rootDir: "src" and prefix: "@". Cross-directory imports must use the @/ alias; sibling imports (./Collapse.vue) stay relative. Ran px eslint --fix src/ — 19 files rewritten, all mechanical rewrites of ../X imports to @/X. This is the change that would have caught the two dangling ./interpolator.js imports in step 1 on the same commit they were introduced, instead of at build time. The rule stays active: future ../X imports will fail npm run lint.
- src/components/Globals.js -> shared/stores/index.js (reactive store)
- src/components/ui/{Collapse.vue,collapseToggle.js,Modal.vue} -> shared/ui/
- src/components/widgets/TreeMenu.vue -> shared/ui/TreeMenu.vue
- src/components/widgets/flightIndicators/AttitudeIndicator.vue + img/ -> shared/ui/
- src/assets/parse_mavgraph.py -> scripts/parse_mavgraph.py
All import sites switched to @/shared/... The bulk rewrite missed three
sibling-import forms (./Globals.js, ./ui/Collapse.vue, and the
extensionless ./Globals) that were caught by npm run build; fixed in
this commit.
src/components/widgets/ now holds only the seven real widgets plus
useWidget.js (interpolator.js moved in step 1).
CLAUDE.md: shared/stores/index.js and scripts/parse_mavgraph.py paths
updated.
- src/components/widgets/{AttitudeWidget,DeviceIDViewer,EkfHelperTool,
MagFitTool,MessageViewer,ParamViewer,TxInputsViewer}.vue
-> features/widgets/instances/
- src/components/widgets/useWidget.js -> features/widgets/core/useWidget.js
- src/styles/widget.css -> features/widgets/core/widget.css
src/components/widgets/ now holds only CesiumSettingsWidget.vue
(step 4a moves it to features/scene/components/CesiumSettingsPanel.vue).
Home.vue widget imports updated. Each widget's useWidget import
rewritten to @/features/widgets/core/useWidget.js. main.js widget.css
import rewritten.
CLAUDE.md: components/widgets/ and widgets/useWidget.js path references
updated.
…cene/ - src/components/CesiumViewer.vue -> features/scene/components/ - src/components/widgets/CesiumSettingsWidget.vue -> features/scene/components/CesiumSettingsPanel.vue (renamed: it's an embedded overlay panel, not a floating widget) - src/components/cesiumExtra/*.js -> features/scene/lib/ CesiumViewer.vue: import and tag renamed to CesiumSettingsPanel, cesiumExtra imports rewritten to @/features/scene/lib/ (lint:fix did the last pass, since the first rewrite produced ../lib/ which the relative-import rule rejects). CesiumSettingsPanel.vue: component name field updated to match the file. CLAUDE.md: components/cesiumExtra/ -> features/scene/lib/.
- src/components/{Plotly,PlotlyPopup,PlotSetup,ExpressionEditor}.vue
-> features/plot/components/
- src/tools/{plotCsv,plotTimeAxis}.js -> features/plot/lib/
Import sites updated (Home.vue, Sidebar.vue, router/index.js,
Plotly.vue, PlotlyPopup.vue, and the three spec files that exercise
them).
eslint.config.js: Plotly.vue override path updated — this keeps
sonarjs/code-eval and no-new-func off for the file that compiles
user-entered plot expressions, which is the reason that override
exists.
CLAUDE.md: tools/plotTimeAxis.js -> features/plot/lib/plotTimeAxis.js.
…loader/
- src/components/SideBarFileManager.vue,
src/components/SideBarFileManagerProgressBar.vue
-> features/loader/components/
- src/tools/parsers/* (5 JS files + JsDataflashParser submodule)
-> features/loader/parsers/
- src/tools/{dataflash,mavlink,dji}DataExtractor.js
-> features/loader/extractors/
JsDataflashParser moved with git mv plus a .gitmodules path update;
git submodule status confirms the new location
(src/features/loader/parsers/JsDataflashParser).
SideBarFileManager.vue line 60: worker URL changed from
../tools/parsers/parser.worker.js to ../parsers/parser.worker.js.
Vite resolves it at build time; npm run build verifies.
Import sites updated (Sidebar.vue, Home.vue, CesiumViewer.vue,
mavlinklogs.spec.js, dataflashlogs.spec.js).
eslint.config.js: submodule ignore path and worker glob path updated.
.markdownlint-cli2.jsonc: submodule ignore path updated to match.
CLAUDE.md: SideBarFileManager.vue, parser.worker.js and the extractor
paths updated.
src/tools/ is now empty and removed. The parser/extractor specs skip
without TEST_LOG_DIR, as before.
- src/components/Sidebar.vue -> features/sidebar/components/Sidebar.vue - src/components/SideBarMessageMenu.vue -> features/sidebar/components/SideBarMessageMenu.vue Sidebar.vue's import of SideBarMessageMenu.vue stays relative (both now live in the same folder, which no-relative-import-paths permits via allowSameFolder). Home.vue Sidebar import updated.
- src/App.vue -> src/app/App.vue - src/main.js -> src/app/main.js - src/router/index.js -> src/app/router/index.js - src/components/Home.vue -> src/app/Layout.vue (renamed: it's the top-level layout, not the "home" page) index.html: script entry updated to /src/app/main.js. router/index.js: Home.vue import becomes Layout.vue. main.js's ./App.vue and ./router imports stay relative — both files moved to src/app/ with it, which no-relative-import-paths allows via allowSameFolder. CLAUDE.md: index.html entry path, Home.vue -> Layout.vue and router/index.js path updated. src/components/ is empty after this commit.
…dency - scripts/parse_mavgraph.py -> scripts/mavgraph/parse_mavgraph.py - scripts/mavgraph/requirements.txt (beautifulsoup4) The file imports bs4 but no requirements.txt existed — it only ran if the caller happened to have bs4 installed. Same shape as scripts/terrain/, which already has its own README + requirements. CLAUDE.md: ruff command updated (scripts/mavgraph/), plus a dependency note alongside the terrain one.
- src/assets/*.glb -> assets/models/
- src/assets/*.{png,jpg,svg} -> assets/images/
- src/assets/*.xml -> assets/xml/
- src/assets/*.tlog -> assets/samples/
- src/assets/logmetadata/ stays as its own sibling folder
(five related XMLs, imports unchanged)
Import sites updated (SideBarFileManager.vue, CesiumViewer.vue,
SideBarMessageMenu.vue, Sidebar.vue).
vite.config.js assetsInclude ("**/*.glb", "**/*.tlog") is a glob and
needs no change.
CLAUDE.md: the "../assets/x.png" example becomes "../assets/images/x.png";
the preset graph paths point at assets/xml/.
Three assets (mapbox.png, Cesium_Air.glb, quad.glb) have no static
imports — moved by extension along with the rest. Either unused or
referenced at runtime; nothing statically imports them.
- TODO.md: split section marked done, paths updated. - docs/widgets.md: widget add-procedure path and CSS location updated, Pending 2 marked done. - docs/reorg-plan.md: status flipped to complete.
…ntime list leapSecondsTAI was eight sequential if-returns, one per IERS bulletin. Same data, modeled as control flow, and flagged by SonarJS for cognitive complexity it didn't actually have. - Table-driven lookup (binary search over the parsed list, fallback table for the pre-fetch case). - gpsTimeToUtc extracted from extractStartTime; the GPS->UTC conversion is one function with one job. - extractStartTime uses findIndex instead of for+if, returns undefined on no match (same as before). - public/leap-seconds.list (IANA copy) fetched at startup via initLeapSeconds(); main.js mounts the app inside .finally() so a failed fetch still mounts with the fallback table. - Warns if the fetched list is past its #@ expiry date. Behavior unchanged for any log from 1996 onward: fallback table and fetched table agree on every offset.
- Adds Reorganization and Date/time sections (both done, were not tracked). - Consolidates the widget-standardization items into one section. - Retargets the widget-registry item at src/app/Layout.vue (7 widgets). - Marks the orphaned-ids sweep done. - Housekeeping reflects the current commit count and the audit revert. - Phase 5 cognitive-complexity item notes the leap-second if-chain is cleared.
The painted handles and their drag hit zones were independent: 20x20 in widget.css, 40 and 25 hardcoded in useWidget.js. Growing the visible handle silently shrank the effective grab area. useWidget.js now reads --uav-handle-size from the widget at mount and multiplies it by 1.5 for both move and resize. At the current 20px that gives a 30px hit zone on each corner. Changing the CSS var grows the painted handle and its hit zone together.
Closes the widget-standardization section. - New test/unit/specs/layoutWidgets.spec.js reads Layout.vue and asserts each of the seven widget tags carries @close. Prevents the failure mode that bit TxInputsViewer (shipped without @close, close button was a silent no-op) without forcing a v-for + :is registry. - TODO.md: registry item marked closed-not-doing.
sqrt() of a negative field (e.g. sqrt(XKF2[0].VWN), wind north is a tailwind component and often negative) produced NaN at every sample. typeof NaN === 'number', so the existing 'not a number' guard let it through, the trace became all-NaN, and Plotly 2.14.2 threw 'C.trim is not a function' from inside its axis formatter. Number.isFinite distinguishes real numbers from NaN/Infinity; those now become null (Plotly's gap marker), so sqrt(negative) plots as an empty series instead of crashing. Same class catches log(-1), 0/0, 1/0.
evaluateExpression compiled the rewritten expression with new Function(a, return + expr), i.e. arbitrary JavaScript on user input. The eslint.config.js exemption for Plotly.vue existed only to silence that rule; SonarQube flagged it independently. Replaces the code-eval with a jsep parse plus an AST walker that whitelists operators, Math methods (getSafeFunctions, via Object.getOwnPropertyNames since Math methods are non-enumerable), the Math and Number namespaces, named constants, mavextra helpers from globalThis minus a denylist (fetch, eval, alert, ...), and blocked properties (constructor, __proto__, prototype, caller, callee, arguments) checked for static, literal computed, and dynamic access. Unknown names throw at compile time; the old compileExpression string-rewriter is gone, and so is the code-eval / no-new-func exemption in eslint.config.js. Adds plot-expression aliases: ln/arcsin/arccos/arctan to Math.log/asin/acos/atan, so MAVExplorer-style expressions work. No behavior change for existing expressions. fetch/eval/alert/document are now impossible in a plot expression. 11 tests cover arithmetic, message resolution, instanced messages, aliases, constants, and three rejection cases.
- ColorPicker.vue: native <button> swatches replace the <select> whose <option> colors Windows' menu renderer discarded; a per-plot custom color is available via <input type='color'>
- PlotSetup.vue: dark-theme buttons, selects and the axis toggle to 4px / 2rem / #1a1e24; axis becomes a click-to-cycle button; styles scoped to stop the i { margin: 5px } and select rules leaking app-wide
- ExpressionEditor.vue: associate the visually-hidden label with its input via for/id
- Sidebar.vue: white-thumb scrollbar scoped to .nav-side-menu so the widget scrollbar (App.vue #paneContent, dark) is unchanged
…global leakage - Collapse.vue emits collapse-state(name, open) on show-watcher tick and at mount; collapseToggle.js maintains a Map<name, Set<element>>, applies .is-open to the wrapper, aria-expanded to the focusable child, cleans up on unmount and name change - PlotSetup.vue, SideBarMessageMenu.vue, TreeMenu.vue: fa-caret-down replaced by (fa-caret-right + fa-caret-down) pair toggled by .is-open; rotating a filled caret visually displaced it, two static glyphs are centered by construction - ExpressionEditor.vue: white surface with dark text, amber glow focus (#d47f00 border + 4px halo); 'background-color: #fff' had been mangled to '#141924' by a substring-replace on 'color: #fff' - SideBarMessageMenu.vue: type rows are flex (label, description 1fr, caret); field rows are grid (auto 1fr 1.5rem) so the trash slot is always reserved and toggling a plot does not shift the description; descriptions hide via @container (max-width: 280px); filter box matches sidebar tier - TreeMenu.vue moved shared/ui -> features/sidebar/components (single consumer); scoped .section i override neutralises Sidebar.vue's global li a i width/padding rule - docs/ui-standard.md: two-tier control system (sidebar 32px, widget 24px), 4px radius, amber focus glow, surfaces (dark buttons / white inputs), hover, transitions, caret rule - TODO.md: sidebar style-scope audit backlogged
- PlotSetup: remove .fa-trash and li.plotsetup .fa-trash float rules — both inert since li.plotsetup became flex (float has no effect on flex items) - TreeMenu: blank lines before caret swap rules per stylelint rule-empty-line-before
- widget.css: shared .uav-widget button / input[type=text] / select rules (24px, 4px radius, #263547 buttons borderless, white inputs), hover #3a4f6b, active #162442, disabled #b8c0cc, focus inset 2px amber ring on buttons / amber glow on bordered controls - MagFitTool, ParamViewer: local button/input/select overrides stripped; widget-specific rules kept - PlotSetup, ColorPicker: outline 2px #d47f00 replaced by inset ring on .axis-toggle, .add-expression, .save-preset, .color-picker-trigger, .color-picker-item - docs/ui-standard.md: Implementation map section - CLAUDE.md: UI controls rule rewritten as two-tier, pointing at ui-standard.md - TODO.md: EKF helper red/green background item under Improvements
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.
TODO.