Repository navigation
Update yr-weather-forecast extension - #27447
Conversation
- Merge branch \'contributions/merge-1773236949823\' - Pull contributions - Merge pull request raycast#30 from kyndig/feat/search-relevance-and-readme-padding - Remove dead comma-boundary check in calculateQueryRelevance - linting - fix(search): rank location results by query relevance - docs(readme): document date-forecast graph context padding - Merge pull request raycast#29 from kyndig/fix/review-cleanup - fix(search): reset lastToastedDateRef on search clear paths - refactor(weather-client): delegate plain fetches to metadata variants - fix(cache): memoize graph cache hook return object - fix(search): suppress repeated date-intent toast notifications - fix(search): remove duplicate query intent parsing in effect - Merge pull request raycast#28 from kyndig/docs/readme-changelog-raycast-compliance - docs(readme): use US English for Raycast store compliance - docs(changelog): align with Raycast store and reflect recent work - Merge pull request raycast#27 from kyndig/fix/sunrise-graph-single-render - fix: remove stale sunDataReady=true when items is empty - fix: gate forecast graph generation until sun data is ready - Merge pull request raycast#26 from kyndig/feat/error-boundaries-and-formatter-tests - fix: wrap Command render logic with outer error boundary - linting - test(formatters): add coverage for units, date, summary, and wrapper helpers - feat(error-boundary): wrap command and forecast views - feat(error-boundary): add shared fallback component and dependency - Merge pull request raycast#25 from kyndig/fix/dark-mode-graph-colors - fix(cache): bump graph version for palette update - test(graph): validate palette integrity and selector behavior - fix(graph): centralize theme palettes and dark-mode selection - Merge pull request raycast#24 from kyndig/feat/runtime-api-response-validation - test(schema): verify LocationResultSchema rejects NaN coordinates - fix(location-search): filter invalid coordinates before schema parse - chore: remove unused SunriseApiResponse and NominatimRawResult type exports - fix(schema): use looseObject for InstantDetailsSchema to allow non-numeric additive fields - fix(api): replace deprecated .passthrough() with z.looseObject() for Zod v4 - test(api): cover runtime schemas for boundary payloads - feat(api): validate external responses at runtime - Merge pull request raycast#23 from kyndig/fix/location-identity-unification - lint fix - fix(forecast): add missing originalName to graph generation useEffect deps - fix(ci): set TZ=Europe/Oslo for unit tests and guard timezone-dependent assertions - ci: run unit tests in Raycast CI workflow - test(identity): storage migration, cache-keys, location-utils, useFavorites, integration flow - refactor(forecast): resolved location contract and canonical React keys - feat(identity): harden location key canonicalization and prefixed ID normalization - Merge pull request raycast#22 from kyndig/fix/location-identity-unification - refactor(identity): remove id-only favorite helper and share coord precision constant - fix(forecast): preserve canonical location identity across favorite flows - Merge pull request raycast#21 from kyndig/fix/p0-timezone-date-correctness - test(dates): cover local date serialization and filtering boundaries - fix(dates): preserve local target date across forecast flow - Merge pull request raycast#20 from kyndig/refactor/phase-7-readme-fixup - docs(readme): add missing welcome message shortcuts to table - Merge pull request raycast#19 from kyndig/refactor/phase-7-readme - docs(readme): rewrite for conciseness and remove stale content - Merge pull request raycast#18 from kyndig/refactor/phase-6-cleanup - refactor(yr): extract favorite item render helpers - refactor(location): group settlement emoji switch cases - Merge pull request raycast#17 from kyndig/refactor/phase-5-cache - fix(cache-keys): replace dead weatherCacheKey/sunriseCacheKey with shared coordSuffix - refactor(api-client): use shared cache key builder - refactor(cache): remove CacheManager and unify graph cache keys - Merge pull request raycast#16 from kyndig/refactor/phase-4-forecast - refactor(favorites): remove dead sunTimesRef and favoriteErrorsRef - fix(favorites): retry failed favorites on refresh - fix(favorites): remove unused loading ref synchronization - fix(favorites): refetch cancelled loading-only entries - chore(refactor): apply formatter output after favorites refactor - refactor(favorites): fetch weather incrementally by location key - refactor(forecast): simplify sunrise fetch to single-pass requests - refactor(forecast): flatten graph lifecycle to one effect - Merge pull request raycast#15 from kyndig/refactor/phase-3-hooks - fix(search): abort stale requests for short parsed queries - fix(search): abort controller and reset isLoading in early-return guards - fix(search): defer setQueryIntent until after min-char guard - refactor(search): collapse duplicate reset branches in useEffect - chore(toast): remove stale empty JSDoc block - fix(search): move date-intent toast behind min-char guard - Merge pull request raycast#14 from kyndig/refactor/phase-3-hooks - fix(search): gate debounced queries by parsed location text - refactor(3e): remove dead networkConnectivityIssues toast - refactor(3d): remove redundant parse in search effect - refactor(3c): remove proactive network test and dead UI - refactor(3b): replace useFavoriteIds with derived lookup - Merge pull request raycast#13 from kyndig/refactor/phase-2-config-cleanup - style: apply Prettier formatting to phase-2 touched files - refactor(2d): cache DebugLogger.isDebugMode() at module load - refactor(2c): strip redundant JSDoc from weather-thresholds.ts - refactor(2b): single source of truth for cache TTLs - refactor(2a): flatten WeatherConfigManager to direct const exports - Merge pull request raycast#12 from kyndig/test/smoke-tests - test: add Tier 1 and Tier 2 smoke tests (121 cases) - test: add jest config, Raycast API mock, and fix .gitignore test exclusion - Merge pull request raycast#11 from kyndig/refactor/phase-1-dead-code - chore: remove BUNDLE_OPTIMIZATION.md (references deleted code) - refactor: delete dead modules (bundle-analyzer, optimized-components, useAsyncState, useDelayedError, lazy-graph) - refactor: remove dead bundle-analyzer usage and useForecastPreloader - Merge pull request raycast#9 from kyndig/raycast-ci-rules - Merge pull request raycast#10 from kyndig/cursor/git-status-error-handling-92bd - Fix missing error check on git status command in CI workflow - chore: update .gitignore to exclude dist/ directory - chore: update Raycast CI workflow to use environment variables - refactor: improve Raycast CI metadata verification script - chore: improve CI workflow for Raycast extension - chore: update CI configuration and .gitignore for Raycast extension - added ci rules for raycast extensions - Merge pull request raycast#8 from kyndig/2026-01-22-gve2 - chore: update CHANGELOG, package.json, and README for version 1.1.0 - Merge pull request raycast#7 from kyndig/fix/abort-aware-retry - fix: make retry backoff abortable - Merge pull request raycast#6 from kyndig/docs/functionality-analysis - updated - refactor: enhance location handling and caching mechanisms - refactor: enhance check script for improved functionality and maintainability - updated to reflect current changes - updated check script - improved data analysis of response - fix: remove unused imports (formatTime, getForecast) to resolve linting errors - refactor: update search results to pass LocationResult objects to forecast actions - feat: update LazyForecastView to accept LocationResult for simplified naming - refactor: update createLocationActions to accept LocationResult object instead of individual parameters - fix: improve data coverage detection threshold from 24h to 12h and integrate into compact summary line - fix: restore sunrise/sunset visualizations and improve caching system - Merge pull request raycast#5 from kyndig/testsuite - changed temperature view in fav view - updates - fixed linting - simplified error handling - added comprehensive linting check - Remove unused preloadForecast variable - Fix window.location.reload() call in Suspense fallback - Fix window.location.reload() calls in Raycast extension - Remove unused preloadForecast parameter from createForecastActions - fixed missing ACtionPanel use - Consolidate ActionPanel patterns and improve code formatting - removed accessibility changes, that didn\'t really work as intended - temperature format DRY improvement - caching of graphs and some accessibility enhancements - language fixes - updated shortcuts - emojis now reflect the type of location in the search - added specificity in search. Specific locations, such as Asker town, will be sorted above less specific locations, such as Asker municipality - upgraded query search, and made some adjustments to showing graphs for data where the data grid is thinner - updated to reflect current functionality - updated to reflect latest changes - fixed the missing onFavoriteChange callback in the ForecastView instantiation - ts linting - fixed ts errors to obsolete graph.tsx file - Merge remote changes with local improvements - accept all incoming changes - Pull contributions - sync with fork PR branch - added summary to 9-day forecast - updated readme - fixed linting errors - Merge branch \'contributions/merge-1757514100539\' - Pull contributions - fixed linting - added 24h support - new version with 24h support - updated with latest changes - updated sunrise sunset views and fixed a favourite bug - updated readme to reflect recent changes - updated readme to reflect recent changes - thresholds follow WMO, fixed sunrise/sunset logic - linting - added subtitle, updates - toastmessage cleans - extracted magic numbers - linting fix - more ts errors - linting fix - typescript error fix - refactor removing the text table form default view to kill the flickering issue once and for all. Also minor updates - Fix graph flickering with configurable delay and pre-rendering - attempting to solve flickering of graph views. Not successful, tho - fixed ts errors - bundle size optimizations to address the D3 library feedback - fixed linting - updated contact info - Refactor main component to use custom hooks and reduce complexity - Add useFavoriteIds hook to track favorite status of search results - Add useFavorites hook to extract favorites management logic - Add useSearch hook to extract search logic from main component - Use configurable forecast hour constants - Replace magic numbers with configurable UI thresholds - Replace all magic numbers with configurable graph thresholds - Use centralized unit conversion from configuration - Replace magic numbers with configurable precipitation thresholds - Add weather configuration manager with runtime controls - Add centralized weather thresholds configuration - added error boundaries - API headers consistency across all external API calls - eliminated unnecessary re-renders - linting - Merge pull request raycast#3 from kyndig/wfc-compare - visual feedback improvements for date queries - Fix linting errors: remove unused variables - Apply tech guru\'s React state management timing fixes - fixed query duplication - using auto-generated preference interfaces - revived unused quick day queries - updated - reverted some massive changes, trying to keep things simple - Merge pull request raycast#2 from kyndig/improvements - Fix race condition in concurrent network tests - Remove browser detection and redundant array checks - Fix references to non-existent LICENSE and CONTRIBUTING files - Add array bounds checking for tokens[i+1] access - Use auto-generated Preferences type instead of custom interface - Use showFailureToast utility for simplified error handling - Extract precipitation thresholds as documented constants - add debug mode preference for console in raycast ext. settings - updated with initial release - updated readme - docs: add welcome message system changes to changelog - docs: update README with welcome message features and shortcuts - feat: integrate welcome message callback in location actions - feat: add welcome message action to day view - feat: add welcome message action to graph view - feat: add welcome message action to forecast view - feat: integrate welcome message system with global shortcuts and all views - feat: add first-time user tracking functions - feat: add dedicated welcome message component with action panels - refactor: remove Quick View functionality and integrate favorites reordering shortcuts - feat: add favorites reordering functionality with moveUp/moveDown methods - feat: implement graph caching and smooth rendering transitions - feat: enhance graph with dual y-axis, rounded lines, and improved precipitation visualization - feat: add graph-table synchronization to prevent flickering - refactor: clean up unused imports and improve code organization - refactor: update API clients to use new utility functions - refactor: improve hooks with better error handling and loading states - feat: add generic API client for consistent HTTP requests - feat: add utility modules for DRY code organization - feat: implement graph caching for super snappy view switching - fixed linting - fixed ts linting errors - fixed linting errors - Removed search results limitation, added minimum 3 chars for search - feat: add favorite actions to day view - feat: add favorite actions to graph view - feat: add favorite actions to forecast view - refactor: simplify search to fix infinite loops - fix: prevent infinite re-render loop in useAsyncState - feat: add Nominatim API connectivity testing - feat: add network test hook for debugging connectivity issues - feat: add centralized async state management hooks - feat: add centralized date and time formatting utilities - feat: add centralized error message templates for weather-related errors - refactor: update to use centralized API configuration - refactor: update to use centralized API configuration - refactor: update to use centralized API configuration - feat: add centralized API configuration for all external API calls - refactor: update to use centralized symbolToCondition function - refactor: update buildWeatherTable to use centralized symbolToEmoji function - refactor: update to use centralized weather symbol utilities - feat: add centralized weather symbol utilities for emoji and condition mapping - feat: add useWeatherData hook for centralized weather data fetching - refactor: remove error handling as errors now handled in useWeatherData - refactor: remove error handling as errors now handled in useWeatherData - refactor: remove error handling as errors now handled in useWeatherData - refactor: replace manual error handling with useDelayedError hook - feat: add useDelayedError hook for consistent error display timing - fixed linting errors - updated - updated - fixed linting errors - Merge pull request raycast#1 from kyndig/daysearch - feat: add weather utility functions for data processing and formatting - feat: add weather summary generation and formatting utilities - feat: add weather emoji mapping for visual weather representation - feat: add query intent parsing for natural language date and location queries - feat: add graph utility functions for weather visualization - updates - updates - feat: add 150 ms delay before error msg - feat: add 150 ms delay before error msg - feat: add 150ms delay for \'No forecast available\' messages to prevent flashing - feat: implement Enter key to open detailed forecast view and add 150ms error delay - switched symbolCode from || to ?? to avoid falsly empty strings - New logic keeps two-decimal precision but strips trailing zeros without numeric coercion. - simplified date handling - updated dates - updated changelog - removed kynd as owner - removed unused pathFromPoints helper - added D3 graph support - smoothing graphs - changed contact - cleaned up linting - added api compiance and privacy for real, this time - typescript problem fixes - updated with privacy statement and API comliance for MET - changed user-agent in api headers - updates - initial commit from local - Initial commit
- Merge pull request raycast#31 from kyndig/fix/ray-cli-ts-and-local-verify - fix(types): remove generated Preferences dependency in debug utils - refactor(graph): remove unused buildGraphMarkdown re-export - fix(scripts): restore format-check in verify pipeline - chore: add Husky with pre-commit (lint) and pre-push (verify) - ci: add explicit type-check step to Raycast workflow - chore(scripts): add verify script and align check with it - fix(graph): resolve TS errors by using graph-utils and exported config
- Merge pull request raycast#32 from kyndig/fix/raycast-greptile-findings - fix(actions): show actual target date in weather action - refactor(preferences): centralize Raycast preference typing
- Merge pull request raycast#33 from kyndig/fix/pr-review-use-search-race-and-artifacts - fix(search): guard stale invocation state writes - Remove local developer artifacts and husky bootstrap wiring - Fix useSearch loading race for superseded requests
- Merge pull request raycast#34 from kyndig/fix/extension-audit-cleanups - formatting - chore(deps): refresh lockfile - fix(graph): remove dead precached graph path - fix(time): keep hour-only labels compact - fix(graph): key cache by render preferences - style: format forecast view - fix(preferences): align forecast output with settings - fix(graph): include data identity in cache keys - fix(graph): remove invalid graph prewarming paths - fix(weather): derive current conditions from forecast cache
|
Thank you for your contribution! 🎉 🔔 @holene @pernielsentikaer you might want to have a look. You can use this guide to learn how to check out the Pull Request locally in order to test it. 📋 Quick checkout commandsBRANCH="ext/yr-weather-forecast"
FORK_URL="https://github.com/holene/raycast-extensions.git"
EXTENSION_NAME="yr-weather-forecast"
REPO_NAME="raycast-extensions"
git clone -n --depth=1 --filter=tree:0 -b $BRANCH $FORK_URL
cd $REPO_NAME
git sparse-checkout set --no-cone "extensions/$EXTENSION_NAME"
git checkout
cd "extensions/$EXTENSION_NAME"
npm install && npm run devWe're currently experiencing a high volume of incoming requests. As a result, the initial review may take up to 10-15 business days. |
- npm audit and linting - resolved conflicts
Greptile SummaryA substantial quality overhaul of the yr-weather-forecast extension — adding Zod runtime validation of all API responses, AbortController-based request cancellation, retry logic with backoff, an incremental favorites loader, a deterministic graph cache keyed by data hash, error boundaries throughout, and 120+ unit/integration tests. All findings are P2 style/maintenance suggestions with no blocking issues. Confidence Score: 5/5Safe to merge; all findings are non-blocking P2 style suggestions. No P0 or P1 issues found. The retry/abort logic is implemented correctly including race-condition guards. The favorites migration is idempotent. Zod schemas use extensions/yr-weather-forecast/src/graph-cache.ts — direct LocalStorage access and 32-bit hash risk Important Files Changed
Prompt To Fix All With AIThis is a comment left during a code review.
Path: extensions/yr-weather-forecast/src/graph-cache.ts
Line: 228-256
Comment:
**Direct `LocalStorage` access bypasses the cache abstraction**
`invalidateModeGraphCache`, `invalidateDateGraphCache`, `cleanupOldGraphCache`, and `getGraphCacheStats` all call `LocalStorage.allItems()` directly and filter on the hardcoded string `"cache:graph:"`, while `cache.ts` centralises the `"cache:"` key prefix in its own `KEY_PREFIX` constant. If `KEY_PREFIX` is ever changed, these four functions would silently stop finding or removing any entries.
The existing `clearCachedByPrefix` helper already accepts a prefix string and applies `KEY_PREFIX` automatically (as `clearAllGraphCache` already shows). The `invalidateModeGraphCache` and `invalidateDateGraphCache` scans could be refactored to build a list with `clearCachedByPrefix` or a future `filterCachedByPredicate` helper, and `getGraphCacheStats`/`cleanupOldGraphCache` could similarly derive the correct storage prefix from a shared constant rather than a bare string literal.
How can I resolve this? If you propose a fix, please make it concise.
---
This is a comment left during a code review.
Path: extensions/yr-weather-forecast/src/graph-cache.ts
Line: 35-44
Comment:
**32-bit hash collision risk in `stableHash`**
`stableHash` produces a 32-bit unsigned integer (via `>>> 0`), giving a collision space of ~4 billion values. For a cache key discriminator over many distinct series snapshots, a collision would cause the wrong cached graph to be served silently — the user would see stale weather data without any error. Consider using a 64-bit accumulator (two 32-bit words) or the Web Crypto API (`crypto.subtle.digest`) to reduce collision probability to negligible levels.
How can I resolve this? If you propose a fix, please make it concise.
---
This is a comment left during a code review.
Path: extensions/yr-weather-forecast/src/yr.tsx
Line: 67-79
Comment:
**`graphCache` in `useEffect` deps triggers a reference comparison every render**
`graphCache` is the return value of `useGraphCache()`, which is itself a `useMemo` over all-`useCallback` functions. While the reference should be stable in practice, listing an object from a hook in a `useEffect` dependency array is fragile — any change to `useGraphCache`'s return value would restart the interval. The stable reference here is really `graphCache.cleanupCache`, and the interval only needs that one callback:
```typescript
const { cleanupCache } = useGraphCache();
useEffect(() => {
const cleanupInterval = setInterval(() => {
cleanupCache(24 * 60 * 60 * 1000);
}, 60 * 60 * 1000);
return () => clearInterval(cleanupInterval);
}, [cleanupCache]);
```
How can I resolve this? If you propose a fix, please make it concise.Reviews (3): Last reviewed commit: "refactor(yr-weather-forecast): improve c..." | Re-trigger Greptile |
- Merge pull request raycast#36 from kyndig/fix/simplify-local-check-scripts - chore: simplify local verification scripts - Merge branch \'contributions/merge-1777276485212\' - Pull contributions - Merge pull request raycast#35 from kyndig/fix/raycast-preferences-generated-type - docs: align contributing guidance with verify scripts - fix: make local verify follow CI-safe build order - ci: run Raycast build before TypeScript checks - fix: use command-scoped Preferences.Yr for getAppPreferences - fix: use Raycast generated Preferences type
|
Published to the Raycast Store: |
|
🎉 🎉 🎉 We've rewarded your Raycast account with some credits. You will soon be able to exchange them for some swag. |
Description
Screencast
Checklist
npm run buildand tested this distribution build in Raycastassetsfolder are used by the extension itselfREADMEare placed outside of themetadatafolder