Skip to content

Conversation

@iamvdo
Copy link
Contributor

@iamvdo iamvdo commented Dec 1, 2025

Hey there,
Here are some small YETI fixes (comment from #4457)
Thanks!
Vincent

Summary by CodeRabbit

  • Bug Fixes

    • Corrected date validation calculations to use consistent daily boundaries rather than exact timestamps, improving date comparison accuracy across sessions
    • Simplified map fitting to display features without automatic zoom adjustments
  • Chores

    • Streamlined layer selector information by removing extraneous properties
    • Refactored tab management system for improved maintainability

✏️ Tip: You can customize this high-level summary in your review settings.

@github-actions github-actions bot added the bug Something isn't working label Dec 1, 2025
@coderabbitai
Copy link

coderabbitai bot commented Dec 1, 2025

Walkthrough

These changes refactor map layer components and YetiView's tab management. Date validation logic now uses start-of-day semantics; zoom adjustment is removed from fitMapToFeatures; the country property is removed from WinterRouteLayer's layerSelector; and tab initialization is converted from direct method invocation to a computed property with a watcher.

Changes

Cohort / File(s) Change Summary
Map layer date and selection logic
src/components/yeti/map-layers/DataAvalancheLayer.vue, src/components/yeti/map-layers/WinterRouteLayer.vue
DataAvalancheLayer: dateValid and differenceDays now use start-of-day semantics (YYYY-MM-DD) instead of exact timestamps for date boundary calculations. WinterRouteLayer: Removed country property from computed layerSelector object.
Route layer simplification
src/components/yeti/map-layers/RouteLayer.vue
Removed zoom adjustment logic from fitMapToFeatures; the method now fits map view to feature extent without computing or applying minimum zoom.
YetiView tab management refactoring
src/views/portals/YetiView.vue
Replaced direct setTabs() method invocation with a computed property localTabs that reconstructs tabs array (layer, risk, route, meteo) and a watcher that propagates changes to Yetix via Yetix.setTabs(). Removed setTabs() method and its created() invocation.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

  • DataAvalancheLayer.vue: Verify date boundary semantics change aligns with business logic and doesn't affect avalanche data filtering window
  • RouteLayer.vue: Confirm zoom behavior removal doesn't impact user experience or cause map navigation issues
  • WinterRouteLayer.vue: Check for dependencies on the removed country property elsewhere in the codebase
  • YetiView.vue: Ensure watcher initialization order, deep watching behavior, and immediate flag work correctly; verify tab state updates propagate properly

Poem

🐰 Hop, hop! The dates now dance at dawn,
Zoom fades to simplicity, routes march on,
Tabs waltz through watchers, computed and true,
Layers refined—the old ways withdrew!

Pre-merge checks and finishing touches

❌ Failed checks (1 inconclusive)
Check name Status Explanation Resolution
Title check ❓ Inconclusive The title is vague and generic, using the non-descriptive term 'Some YETI fixes' without conveying specific information about the actual changes. Specify the main changes: consider 'fix(yeti): Update date boundary calculations and layer selector logic' or more concrete description of the fixes applied.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

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: 0

🧹 Nitpick comments (3)
src/views/portals/YetiView.vue (2)

196-243: Consider renaming for clarity.

Having both tabs and localTabs can be confusing. While the distinction serves a purpose in the data flow (localTabs constructs the tabs, tabs retrieves them from Yetix), consider renaming one for better clarity:

  • Rename localTabs to tabsConfiguration or computedTabsState
  • Or rename tabs to yetixTabs or activeTabs

303-309: Remove unnecessary deep: true option.

Since localTabs returns a new array on each computation, the deep: true option is unnecessary. Vue's reactivity will detect the array reference change without deep comparison.

Apply this diff:

     localTabs: {
-      deep: true, // nested
       immediate: true, // also when created
       handler(tabs) {
         Yetix.setTabs(tabs);
       },
     },
src/components/yeti/map-layers/DataAvalancheLayer.vue (1)

109-110: Day-based calculation change looks good; consider DRY-ing the “today” logic and double-checking timezone behavior

Using a localized 'YYYY-MM-DD' anchor to strip the time part for dateValid and differenceDays is a reasonable way to get more stable, day-based results.

Since the todayStringnew Date(todayString) pattern is duplicated, you could optionally centralize it in a small helper (e.g. getTodayString() or getTodayAtMidnight()) to keep semantics consistent if this ever needs to change again.

Also, because this relies on this.$dateUtils.toLocalizedString(..., 'YYYY-MM-DD') plus new Date(todayString) parsing, it’s worth quickly sanity‑checking in your supported browsers/timezones (especially around DST boundaries) that you don’t get off‑by‑one‑day behavior for edge dates.

Also applies to: 113-114

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 7782a7b and f67a171.

📒 Files selected for processing (4)
  • src/components/yeti/map-layers/DataAvalancheLayer.vue (1 hunks)
  • src/components/yeti/map-layers/RouteLayer.vue (0 hunks)
  • src/components/yeti/map-layers/WinterRouteLayer.vue (0 hunks)
  • src/views/portals/YetiView.vue (2 hunks)
💤 Files with no reviewable changes (2)
  • src/components/yeti/map-layers/WinterRouteLayer.vue
  • src/components/yeti/map-layers/RouteLayer.vue
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: build (lts/*)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant