Fv 150 anpassung filtermenü fahrzeuge#559
Hidden character warning
Conversation
WalkthroughThe changes extend the options menu to handle pedestrian traffic (Fussverkehr) counting scenarios. When pedestrian traffic is the only category in a non-24-hour count, default settings are applied and specific UI options are disabled. UI labels are also updated for clarity. Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes 🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Fix all issues with AI agents
In
`@frontend/src/components/zaehlstelle/optionsmenue/OptionsmenueZaehlstelle.vue`:
- Around line 134-138: In the computed property isTeilzaehlungFussverkehr,
replace the loose inequality operator used on activeZaehlung.value.zaehldauer
(currently using !=) with the strict inequality operator !== so the comparison
against Zaehldauer.DAUER_24_STUNDEN is type-safe; update the expression in the
computed function that references activeZaehlung, Kategorien check, and
Zaehldauer.DAUER_24_STUNDEN accordingly.
In
`@frontend/src/components/zaehlstelle/optionsmenue/panels/ZeitauswahlPanel.vue`:
- Around line 330-334: Change the loose inequality to a strict one in the
computed isTeilzaehlungFussverkehr: replace the Zaehldauer comparison using `!=`
with `!==` so the check uses type-safe strict comparison on
activeZaehlung.value.zaehldauer against Zaehldauer.DAUER_24_STUNDEN; locate the
computed property named isTeilzaehlungFussverkehr that references
activeZaehlung, Fahrzeug.FUSS and Zaehldauer, and update that single operator.
🧹 Nitpick comments (2)
frontend/src/components/zaehlstelle/optionsmenue/panels/ZeitauswahlPanel.vue (2)
346-362: Watch-triggered mutation may cause redundant re-entries.The deep watcher on the entire
chosenOptionsCopyfires on every property change. WhenadaptOptionsUpdatesetszeitauswahlandzeitblock, it re-triggers this same watcher. Vue's reactivity deduplicates identical assignments so it stabilizes, but this is wasteful and fragile.Consider narrowing the watch to only the properties that matter:
♻️ Suggested improvement
-watch( - () => chosenOptionsCopy.value, - () => { - adaptOptionsUpdate(); - }, - { deep: true } -); +watch( + () => isOnlyFussgaengerSelected.value, + (newVal) => { + if (newVal) { + chosenOptionsCopy.value.zeitauswahl = Zeitauswahl.BLOCK; + chosenOptionsCopy.value.zeitblock = Zeitblock.ZB_06_19; + } + } +);This avoids re-triggering on unrelated option changes and eliminates the redundant re-entry cycle.
330-344:isTeilzaehlungFussverkehris duplicated across components.This exact computed exists in both
ZeitauswahlPanel.vueandOptionsmenueZaehlstelle.vue(lines 134–138). Consider extracting it into a shared composable or utility to keep it DRY, especially since the condition may evolve.
📜 Review details
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (3)
frontend/src/components/zaehlstelle/optionsmenue/OptionsmenueZaehlstelle.vuefrontend/src/components/zaehlstelle/optionsmenue/panels/FahrzeugPanel.vuefrontend/src/components/zaehlstelle/optionsmenue/panels/ZeitauswahlPanel.vue
🔇 Additional comments (4)
frontend/src/components/zaehlstelle/optionsmenue/panels/FahrzeugPanel.vue (2)
9-9: LGTM!Panel title updated to better reflect the expanded scope of the panel.
259-259: LGTM!Label simplified to "Fußverkehr" for consistency with the broader terminology changes.
frontend/src/components/zaehlstelle/optionsmenue/OptionsmenueZaehlstelle.vue (2)
143-150: LGTM!The default options logic cleanly extends the existing 13-hour pattern to also cover Fussverkehr-only Teilzählung scenarios, setting BLOCK/ZB_06_19 as the sensible default.
200-211: The Zaehlart mappings for RAD and FUSS activation are correct and align with domain requirements.Based on the enum definitions:
- FJS explicitly produces both "Fußverkehr/Radverkehr je Straßenseite" (pedestrian and cycle traffic per street side)
- QU ("Querung"/Crossing) naturally includes both pedestrian and cycle crossings
- QJS ("Querschnitt je Straßenseite"/Cross-section per street side) captures all vehicle types including pedestrians and cycles
Combined with cycle-specific types (R, QR) for RAD, the expanded sets correctly enable these vehicle types for all counting types that produce their respective data.
✏️ Tip: You can disable this entire section by setting review_details to false in your review settings.
| const isTeilzaehlungFussverkehr = computed(() => { | ||
| return (activeZaehlung.value.kategorien.length === 1 && | ||
| activeZaehlung.value.kategorien[0] === Fahrzeug.FUSS && | ||
| activeZaehlung.value.zaehldauer != Zaehldauer.DAUER_24_STUNDEN); | ||
| }); |
There was a problem hiding this comment.
Use strict inequality (!==) instead of !=.
Same as in ZeitauswahlPanel.vue — line 137 uses loose inequality != instead of !==.
🔧 Proposed fix
- activeZaehlung.value.zaehldauer != Zaehldauer.DAUER_24_STUNDEN);
+ activeZaehlung.value.zaehldauer !== Zaehldauer.DAUER_24_STUNDEN);📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| const isTeilzaehlungFussverkehr = computed(() => { | |
| return (activeZaehlung.value.kategorien.length === 1 && | |
| activeZaehlung.value.kategorien[0] === Fahrzeug.FUSS && | |
| activeZaehlung.value.zaehldauer != Zaehldauer.DAUER_24_STUNDEN); | |
| }); | |
| const isTeilzaehlungFussverkehr = computed(() => { | |
| return (activeZaehlung.value.kategorien.length === 1 && | |
| activeZaehlung.value.kategorien[0] === Fahrzeug.FUSS && | |
| activeZaehlung.value.zaehldauer !== Zaehldauer.DAUER_24_STUNDEN); | |
| }); |
🤖 Prompt for AI Agents
In `@frontend/src/components/zaehlstelle/optionsmenue/OptionsmenueZaehlstelle.vue`
around lines 134 - 138, In the computed property isTeilzaehlungFussverkehr,
replace the loose inequality operator used on activeZaehlung.value.zaehldauer
(currently using !=) with the strict inequality operator !== so the comparison
against Zaehldauer.DAUER_24_STUNDEN is type-safe; update the expression in the
computed function that references activeZaehlung, Kategorien check, and
Zaehldauer.DAUER_24_STUNDEN accordingly.
| const isTeilzaehlungFussverkehr = computed(() => { | ||
| return (activeZaehlung.value.kategorien.length === 1 && | ||
| activeZaehlung.value.kategorien[0] === Fahrzeug.FUSS && | ||
| activeZaehlung.value.zaehldauer != Zaehldauer.DAUER_24_STUNDEN); | ||
| }); |
There was a problem hiding this comment.
Use strict inequality (!==) instead of != for the Zaehldauer comparison.
Line 333 uses != (loose inequality). TypeScript/linting best practice is to use !== for type-safe comparison, consistent with the same check in OptionsmenueZaehlstelle.vue line 137.
🔧 Proposed fix
- activeZaehlung.value.zaehldauer != Zaehldauer.DAUER_24_STUNDEN);
+ activeZaehlung.value.zaehldauer !== Zaehldauer.DAUER_24_STUNDEN);📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| const isTeilzaehlungFussverkehr = computed(() => { | |
| return (activeZaehlung.value.kategorien.length === 1 && | |
| activeZaehlung.value.kategorien[0] === Fahrzeug.FUSS && | |
| activeZaehlung.value.zaehldauer != Zaehldauer.DAUER_24_STUNDEN); | |
| }); | |
| const isTeilzaehlungFussverkehr = computed(() => { | |
| return (activeZaehlung.value.kategorien.length === 1 && | |
| activeZaehlung.value.kategorien[0] === Fahrzeug.FUSS && | |
| activeZaehlung.value.zaehldauer !== Zaehldauer.DAUER_24_STUNDEN); | |
| }); |
🤖 Prompt for AI Agents
In `@frontend/src/components/zaehlstelle/optionsmenue/panels/ZeitauswahlPanel.vue`
around lines 330 - 334, Change the loose inequality to a strict one in the
computed isTeilzaehlungFussverkehr: replace the Zaehldauer comparison using `!=`
with `!==` so the check uses type-safe strict comparison on
activeZaehlung.value.zaehldauer against Zaehldauer.DAUER_24_STUNDEN; locate the
computed property named isTeilzaehlungFussverkehr that references
activeZaehlung, Fahrzeug.FUSS and Zaehldauer, and update that single operator.
Description
Filtermenu extended by new Zählarten
Issue References
FV-150
Definition of Done
Summary by CodeRabbit
New Features
Improvements