Skip to content

FV-149 Anpassung Filtermenü Zeitauswahl#558

Open
martind260 wants to merge 16 commits intosprintfrom
FV-149_Anpassung-Filtermenü-Zeitauswahl-3

Hidden character warning

The head ref may contain hidden characters: "FV-149_Anpassung-Filtermen\u00fc-Zeitauswahl-3"
Open

FV-149 Anpassung Filtermenü Zeitauswahl#558
martind260 wants to merge 16 commits intosprintfrom
FV-149_Anpassung-Filtermenü-Zeitauswahl-3

Conversation

@martind260
Copy link
Member

@martind260 martind260 commented Feb 11, 2026

Description

Anpassung Filtermenü Zeitauswahl

Issue References

FV-149

Definition of Done

  • Acceptance criteria are met
  • Testing is done (unit-tests, DEV-environment)
  • Build/Test workflow has successfully finished
  • Release notes are complemented
  • Documentation is complemented (operator manual, system specification, etc.)

Summary by CodeRabbit

  • New Features

    • Enhanced pedestrian-only partial counting mode with improved default option selection.
    • Automatic selection of block time and default 06:00–19:00 time block when only pedestrian counts are active.
    • UI now disables incompatible time-value choice for strict pedestrian-only scenarios.
  • Bug Fixes

    • Automatic adaptation and validation to prevent invalid option combinations when only pedestrians are selected.

@coderabbitai
Copy link

coderabbitai bot commented Feb 11, 2026

Walkthrough

Adds detection for partial pedestrian-only countings (single FUSS category and non-24h duration). Applies BLOCK time selection and the ZB_06_19 time block by default in those cases, disables the Tageswert radio when applicable, and watches option changes to adapt time selection automatically.

Changes

Cohort / File(s) Summary
Pedestrian-only counting logic & defaults
frontend/src/components/zaehlstelle/optionsmenue/OptionsmenueZaehlstelle.vue, frontend/src/components/zaehlstelle/optionsmenue/panels/ZeitauswahlPanel.vue
Adds isTeilzaehlungFussverkehr computed to detect single-category FUSS non-24h countings; updates default option logic to set zeitauswahl = BLOCK and zeitblock = ZB_06_19 when applicable; disables Tageswert radio via computed guards; adds watcher to adapt options when only Fussgaenger are selected.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

🚥 Pre-merge checks | ✅ 2 | ❌ 1
❌ Failed checks (1 inconclusive)
Check name Status Explanation Resolution
Description check ❓ Inconclusive The description includes the required template sections but lacks substantive detail. The 'Description' section only contains a generic one-liner without explaining the actual changes or their purpose. Expand the Description section to explain what was changed and why (e.g., the new disabled state for Tageswert radio, the automatic time selection logic). Add details about testing scope and documentation updates to clarify the unchecked DoD items.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title 'FV-149 Anpassung Filtermenü Zeitauswahl' clearly reflects the main change: adjusting the filter menu's time selection panel for partial pedestrian-only counting scenarios.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch FV-149_Anpassung-Filtermenü-Zeitauswahl-3

No actionable comments were generated in the recent review. 🎉

📜 Recent review details

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 21470a8 and 5e2153a.

📒 Files selected for processing (2)
  • frontend/src/components/zaehlstelle/optionsmenue/OptionsmenueZaehlstelle.vue
  • frontend/src/components/zaehlstelle/optionsmenue/panels/ZeitauswahlPanel.vue
🚧 Files skipped from review as they are similar to previous changes (1)
  • frontend/src/components/zaehlstelle/optionsmenue/OptionsmenueZaehlstelle.vue
🔇 Additional comments (2)
frontend/src/components/zaehlstelle/optionsmenue/panels/ZeitauswahlPanel.vue (2)

39-39: LGTM — Tageswert disabled binding looks correct.

The two conditions cover both the counting-level restriction (isTeilzaehlungFussverkehr) and the user-selection-level restriction (isOnlyFussgaengerSelected), which aligns with the intended behavior.


330-344: Computed properties look correct and well-structured.

Both isTeilzaehlungFussverkehr and isOnlyFussgaengerSelected have clear, readable logic. The separation between counting-level detection and user-selection-level detection is a good design choice.

✏️ Tip: You can disable this entire section by setting review_details to false in your review settings.


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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
frontend/src/components/zaehlstelle/optionsmenue/OptionsmenueZaehlstelle.vue (1)

182-207: ⚠️ Potential issue | 🟠 Major

Add missing case Fahrzeug.FUSS to set fussverkehr option

The switch statement doesn't handle Fahrzeug.FUSS, so optionsCopy.fussverkehr remains at its default value of false on initial load. This prevents isOnlyFussgaengerSelected in ZeitauswahlPanel.vue from ever being true initially, even for pedestrian-only countings.

While line 147 forces BLOCK selection for non-24-hour pedestrian countings via isTeilzaehlungFussverkehr, the pedestrian traffic option itself won't be pre-selected in the UI, which is inconsistent with the intended behavior for pedestrian-only counts.

Add a case after Fahrzeug.RAD:

case Fahrzeug.FUSS:
  optionsCopy.fussverkehr = true;
  break;
🤖 Fix all issues with AI agents
In
`@frontend/src/components/zaehlstelle/optionsmenue/OptionsmenueZaehlstelle.vue`:
- Around line 134-138: The computed isTeilzaehlungFussverkehr currently uses
loose inequality (activeZaehlung.value.zaehldauer !=
Zaehldauer.DAUER_24_STUNDEN); update this to use strict inequality (!==) to
ensure type-safe comparison. Locate the computed property
isTeilzaehlungFussverkehr and replace the != operator with !== when comparing
activeZaehlung.value.zaehldauer to Zaehldauer.DAUER_24_STUNDEN so the check is
strict and consistent with other components like ZeitauswahlPanel.vue.

In
`@frontend/src/components/zaehlstelle/optionsmenue/panels/ZeitauswahlPanel.vue`:
- Around line 346-362: The deep watcher on chosenOptionsCopy causes redundant
re-runs because adaptOptionsUpdate mutates that same object; replace the broad
deep watch with targeted watchers (watch chosenOptionsCopy.value.zeitauswahl and
isOnlyFussgaengerSelected, or a single watch on a computed that derives those
specific keys) so adaptOptionsUpdate only runs when relevant fields change, and
inside adaptOptionsUpdate verify the candidate Zeitblock before assigning by
checking that Zeitblock.ZB_06_19 exists in zeitblockValues (or fall back to the
first available zeitblock in zeitblockValues) instead of hardcoding it; update
references to chosenOptionsCopy, adaptOptionsUpdate, zeitauswahl, zeitblock,
Zeitblock.ZB_06_19, zeitblockValues and isOnlyFussgaengerSelected accordingly.
🧹 Nitpick comments (1)
frontend/src/components/zaehlstelle/optionsmenue/panels/ZeitauswahlPanel.vue (1)

330-334: Duplicate computed: isTeilzaehlungFussverkehr is defined identically in OptionsmenueZaehlstelle.vue.

Consider extracting this into a shared composable or utility to avoid maintaining the same logic in two places.

Also, Line 333 uses != (loose equality) while the rest of the codebase consistently uses !== (strict equality). Use !== for consistency.

Proposed fix for strict equality
 const isTeilzaehlungFussverkehr = computed(() => {
   return (activeZaehlung.value.kategorien.length === 1 &&
       activeZaehlung.value.kategorien[0] === Fahrzeug.FUSS &&
-      activeZaehlung.value.zaehldauer != Zaehldauer.DAUER_24_STUNDEN);
+      activeZaehlung.value.zaehldauer !== Zaehldauer.DAUER_24_STUNDEN);
 });
📜 Review details

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 047d721 and 21470a8.

📒 Files selected for processing (2)
  • frontend/src/components/zaehlstelle/optionsmenue/OptionsmenueZaehlstelle.vue
  • frontend/src/components/zaehlstelle/optionsmenue/panels/ZeitauswahlPanel.vue
🔇 Additional comments (2)
frontend/src/components/zaehlstelle/optionsmenue/panels/ZeitauswahlPanel.vue (1)

336-344: Consider adding Fahrzeugkategorie checks to isOnlyFussgaengerSelected.

This computed property checks traffic type booleans (kraftfahrzeugverkehr, schwerverkehr, etc.) but doesn't check Fahrzeugkategorie-related options (personenkraftwagen, lastkraftwagen, lastzuege, busse, kraftraeder, pkwEinheiten). If any Fahrzeugkategorie is selected alongside Fussverkehr, the computed will incorrectly evaluate to true, causing "Tageswert" to be disabled and forced to BLOCK when a mixed selection actually exists. The utility function hasSelectedFahrzeugkategorie() is already available in ZaehlstelleUtils and should be incorporated into this logic.

frontend/src/components/zaehlstelle/optionsmenue/OptionsmenueZaehlstelle.vue (1)

147-150: Validate Zeitblock.ZB_06_19 exists in available blocks before assigning it.

The code hardcodes Zeitblock.ZB_06_19 for 13-hour countings and Fußverkehr-only partial countings without checking if it exists in activeZaehlung.value.zeitauswahl.blocks. If the backend returns a blocks array without this block, the user ends up with a zeitblock value that doesn't match any option in the dropdown. Add a check to ensure the block is available, or fall back to the first available block (as done in the SONSTIGE case at line 178).

✏️ Tip: You can disable this entire section by setting review_details to false in your review settings.

Comment on lines +346 to +362
watch(
() => chosenOptionsCopy.value,
() => {
adaptOptionsUpdate();
},
{ deep: true }
);

/**
* Passt die Controls anhand ihrer Abhängigkeiten zu anderen Optionen an.
*/
function adaptOptionsUpdate(){
if (isOnlyFussgaengerSelected.value && chosenOptionsCopy.value.zeitauswahl !== Zeitauswahl.BLOCK && chosenOptionsCopy.value.zeitauswahl !== Zeitauswahl.SPITZENSTUNDE_FUSS){
chosenOptionsCopy.value.zeitauswahl = Zeitauswahl.BLOCK;
chosenOptionsCopy.value.zeitblock = Zeitblock.ZB_06_19;
}
}
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Deep watcher on the entire options model may cause unintended re-triggers.

Since adaptOptionsUpdate mutates chosenOptionsCopy (setting zeitauswahl and zeitblock), the deep watcher will fire again on those mutations. The guard condition prevents an infinite loop, but the watcher still executes twice per relevant change.

More importantly, adaptOptionsUpdate hardcodes Zeitblock.ZB_06_19 without verifying it exists in zeitblockValues. If the active counting doesn't include that block, this could set an invalid value.

Suggested: guard against unavailable zeitblock
 function adaptOptionsUpdate(){
   if (isOnlyFussgaengerSelected.value && chosenOptionsCopy.value.zeitauswahl !== Zeitauswahl.BLOCK && chosenOptionsCopy.value.zeitauswahl !== Zeitauswahl.SPITZENSTUNDE_FUSS){
     chosenOptionsCopy.value.zeitauswahl = Zeitauswahl.BLOCK;
-    chosenOptionsCopy.value.zeitblock = Zeitblock.ZB_06_19;
+    const defaultBlock = zeitblockValues.value.length > 0
+      ? zeitblockValues.value[0].value
+      : Zeitblock.ZB_06_19;
+    chosenOptionsCopy.value.zeitblock = defaultBlock;
   }
 }
📝 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.

Suggested change
watch(
() => chosenOptionsCopy.value,
() => {
adaptOptionsUpdate();
},
{ deep: true }
);
/**
* Passt die Controls anhand ihrer Abhängigkeiten zu anderen Optionen an.
*/
function adaptOptionsUpdate(){
if (isOnlyFussgaengerSelected.value && chosenOptionsCopy.value.zeitauswahl !== Zeitauswahl.BLOCK && chosenOptionsCopy.value.zeitauswahl !== Zeitauswahl.SPITZENSTUNDE_FUSS){
chosenOptionsCopy.value.zeitauswahl = Zeitauswahl.BLOCK;
chosenOptionsCopy.value.zeitblock = Zeitblock.ZB_06_19;
}
}
watch(
() => chosenOptionsCopy.value,
() => {
adaptOptionsUpdate();
},
{ deep: true }
);
/**
* Passt die Controls anhand ihrer Abhängigkeiten zu anderen Optionen an.
*/
function adaptOptionsUpdate(){
if (isOnlyFussgaengerSelected.value && chosenOptionsCopy.value.zeitauswahl !== Zeitauswahl.BLOCK && chosenOptionsCopy.value.zeitauswahl !== Zeitauswahl.SPITZENSTUNDE_FUSS){
chosenOptionsCopy.value.zeitauswahl = Zeitauswahl.BLOCK;
const defaultBlock = zeitblockValues.value.length > 0
? zeitblockValues.value[0].value
: Zeitblock.ZB_06_19;
chosenOptionsCopy.value.zeitblock = defaultBlock;
}
}
🤖 Prompt for AI Agents
In `@frontend/src/components/zaehlstelle/optionsmenue/panels/ZeitauswahlPanel.vue`
around lines 346 - 362, The deep watcher on chosenOptionsCopy causes redundant
re-runs because adaptOptionsUpdate mutates that same object; replace the broad
deep watch with targeted watchers (watch chosenOptionsCopy.value.zeitauswahl and
isOnlyFussgaengerSelected, or a single watch on a computed that derives those
specific keys) so adaptOptionsUpdate only runs when relevant fields change, and
inside adaptOptionsUpdate verify the candidate Zeitblock before assigning by
checking that Zeitblock.ZB_06_19 exists in zeitblockValues (or fall back to the
first available zeitblock in zeitblockValues) instead of hardcoding it; update
references to chosenOptionsCopy, adaptOptionsUpdate, zeitauswahl, zeitblock,
Zeitblock.ZB_06_19, zeitblockValues and isOnlyFussgaengerSelected accordingly.

@martind260 martind260 self-assigned this Feb 11, 2026
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.

2 participants