From 287f05d0249a4961618ae723dfe03f62e2a0c0f8 Mon Sep 17 00:00:00 2001 From: Tomek Zebrowski Date: Mon, 24 Aug 2026 21:53:48 +0200 Subject: [PATCH] feat: pick WOT filter signals by vehicle tag The WOT quick-filter always isolated the 175tbi channel set and preselected every signal in the log. On a 2.0gme file that meant filtering ~80 unrelated channels (oil level, fuel level, ...) to then isolate names that ECU never reports. MathDefinition gains autoEnableSignalsByTag, keyed on LoadedFile.tags (seeded from the Drive appProperties a file was loaded with). The WOT formula now maps '175tbi' to the existing list and '2.0gme' to its own, with the 175tbi set kept as the tag-agnostic default so untagged logs behave as before. MathChannelsService resolves the list (resolveAutoEnableSignals), the sources to preselect (resolveBatchSources) and the tag that matched (resolveAutoEnableTag). Signal names are matched case/whitespace- insensitively against the file's own names, like the acceleration extra-curve lookup, since the GME dictionary's newline-split descriptions come through with irregular spacing; an exact-name lookup would silently isolate nothing. A tagged file whose channels are all absent falls back to selecting everything rather than leaving Create disabled with an empty selection. The modal notes which tag drove the preselection under both the "Signals to Filter" and "Signals to Show" fields. --- CLAUDE.md | 1 + .../math-channel-modal/math-channel-modal.css | 10 ++ .../math-channel-modal.html | 12 ++- .../math-channel-modal/math-channel-modal.ts | 35 ++++++- src/app/core/math-channels.service.spec.ts | 97 +++++++++++++++++++ src/app/core/math-channels.service.ts | 93 +++++++++++++++++- src/app/core/math-definitions.ts | 63 +++++++++--- 7 files changed, 290 insertions(+), 21 deletions(-) diff --git a/CLAUDE.md b/CLAUDE.md index 17560ee..2e58740 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -10,6 +10,7 @@ - **Tooling Reliance:** Do not act as a syntax linter or formatter. Rely on ESLint, Stylelint, and Prettier (see Commands below) and CI to catch formatting/lint issues. - **Never amend commits:** Always create a new commit instead of `git commit --amend`, even for a small immediate follow-up fix (e.g. a lint/format correction) to a commit made moments earlier. This holds regardless of whether the original commit has been pushed. - **Run Prettier before committing:** Run `npx prettier --write` on changed files (or `npm run format`) before creating a commit, so CI's Prettier check doesn't fail on avoidable formatting issues. +- **Keep the commit title short:** The subject line must fit the conventional-commit standard of ~50 characters and never exceed 72 — GitHub truncates longer titles in the commits list and PR view, so the point of the change gets cut off. Recent history here has titles that are far too long; don't copy them. Write `: ` and put the detail in the commit body, not the title. - **No AI co-author trailer:** Never add a `Co-Authored-By: Claude ...` (or similar AI-attribution) line to commit messages. - **Branch from a local ref, not a remote-tracking ref:** Never run `git checkout -b origin/main` (or `origin/`) to create a feature branch. Passing a remote-tracking ref as the start-point makes git auto-set that branch's upstream to it (`branch.autoSetupMerge`), so a later push with no explicit destination silently targets `main`/that remote branch instead of creating `origin/` — this already caused a rejected push straight to `main`. Instead branch from local `main` (`git checkout -b main`, after `git fetch`/`git pull` if it needs to be current) so no upstream is auto-configured, and only set one explicitly via `git push -u origin ` when actually pushing. diff --git a/src/app/analyzer/math-channel-modal/math-channel-modal.css b/src/app/analyzer/math-channel-modal/math-channel-modal.css index a3953f2..968647d 100644 --- a/src/app/analyzer/math-channel-modal/math-channel-modal.css +++ b/src/app/analyzer/math-channel-modal/math-channel-modal.css @@ -69,3 +69,13 @@ font-size: 0.85em; padding: 6px 4px; } + +.math-tag-note { + font-size: 0.8rem; + color: var(--text-secondary); + margin: 6px 0 0; +} + +.math-tag-note strong { + color: var(--accent, var(--text-primary)); +} diff --git a/src/app/analyzer/math-channel-modal/math-channel-modal.html b/src/app/analyzer/math-channel-modal/math-channel-modal.html index d27063d..97a9cf8 100644 --- a/src/app/analyzer/math-channel-modal/math-channel-modal.html +++ b/src/app/analyzer/math-channel-modal/math-channel-modal.html @@ -91,7 +91,12 @@

Create Math Channel

No signals match. } - } @else if (input.isConstant && input.options) { + @if (appliedTag(); as tag) { +

+ Preselected {{ selectedSources().length }} signal(s) for the + {{ tag }} tag. +

+ } } @else if (input.isConstant && input.options) {