Merge pull request #100 from samuel-skean/remove-popover-text-assertion-173859597709416002#101
Merged
Conversation
This took jules quite the long time, so I just used biome manually.
Updates the geolocation handler to discard the first valid speed reading, filtering out potential initial GPS noise. The UI remains in the placeholder state until a second valid reading is received. - Modifies `src/app.ts` to track and ignore the first speed update. - Updates `tests/app.test.ts` to reflect the new behavior (requiring two updates for UI change). - Adds a new test case explicitly verifying that the first value is ignored.
- Added .github/workflows/test.yml to run npm tests on push and pull request. - Added AGENTS.md with instructions to verify tests and linting locally.
Set `maximumAge` to 250ms to allow for more frequent speed updates (up to 4Hz), as requested.
- Updated .github/workflows/test.yml to use Node 22. - Updated package.json postinstall script to skip heavy tasks (icon rendering, mkcert) in CI environment. - Added AGENTS.md verification instructions.
Set `maximumAge` to 250ms to allow for 4Hz updates. Introduce `GPS_WARMUP_SECONDS` (1s) to ignore initial readings for a fixed duration rather than a fixed count, compensating for the higher frequency. Update tests to use fake timers for verifying the time-based warmup logic.
- Change GPS warmup constant to milliseconds (`GPS_WARMUP_MS`) for clarity. - Create `AGENTS.md` with instructions to bump versions on changes. - Bump package version to 0.0.31. - Bump service worker cache version to 0.0.31.
…frequency-4012171701671650898
…8203853176629975
…unsupported-speed-api
- Verified that the branch is up to date with origin/main. - No actual conflicts found in local environment.
…4132932323 Add GitHub Action for tests
- Added a native HTML popover to `index.html` warning about "vibecoded" nature. - Added logic in `src/app.ts` to show the popover if `localStorage` key `vibe-warning-shown` is missing. - Persists dismissal to `localStorage` when the popover is closed (via `toggle` event). - Added an "Info" button in the bottom-right controls (next to GitHub link) to re-open the popover. - Updated `index.css` to style the popover (with backdrop) and the new button group. - Bumped version to 0.0.33.
- Added a native HTML popover to `index.html` warning about "vibecoded" nature. - Added logic in `src/app.ts` to show the popover only if `localStorage` key `vibe-warning-shown` is missing AND the app is not in PWA standalone mode. - Added `isStandalone()` helper to detect PWA mode via `matchMedia` and `navigator.standalone`. - Persists dismissal to `localStorage` when the popover is closed (via `toggle` event). - Added an "Info" button in the bottom-right controls (next to GitHub link) to re-open the popover manually. - Updated `index.css` to style the popover (with backdrop) and the new button group. - Bumped version to 0.0.34.
- Added a native HTML popover to `index.html` warning about "vibecoded" nature. - Added logic in `src/app.ts` to show the popover only if `localStorage` key `vibe-warning-shown` is missing AND the app is not in PWA standalone mode. - Implemented `isStandalone()` helper to detect PWA mode via `matchMedia` and `navigator.standalone`. - Added a shrink-to-icon dismissal animation. The logic calculates the vector from the popover (viewport center) to the "Info" icon and updates CSS variables `--exit-x` and `--exit-y` on resize. - CSS transitions use `allow-discrete` to animate the `display` property alongside `transform` and `opacity`. - Persists dismissal to `localStorage` when the popover is closed (via `toggle` event). - Added an "Info" button in the bottom-right controls (next to GitHub link) to re-open the popover manually. - Bumped version to 0.0.35.
- Added a native HTML popover to `index.html` warning about "vibecoded" nature. - Added logic in `src/app.ts` to show the popover only if `localStorage` key `vibe-warning-shown` is missing AND the app is not in PWA standalone mode. - Implemented `isStandalone()` helper to detect PWA mode via `matchMedia` and `navigator.standalone`. - Added a precise shrink-to-icon dismissal animation. The logic tracks the position of both the popover and the "Info" icon using `requestAnimationFrame` while the popover is open, updating CSS variables `--exit-x` and `--exit-y`. - CSS transitions use `allow-discrete` to animate the `display` property alongside `transform` and `opacity`. - Persists dismissal to `localStorage` when the popover is closed (via `toggle` event). - Added an "Info" button in the bottom-right controls (next to GitHub link) to re-open the popover manually. - Bumped version to 0.0.36.
- Added a native HTML popover to `index.html` warning about "vibecoded" nature. - Added logic in `src/app.ts` to show the popover only if `localStorage` key `vibe-warning-shown` is missing AND the app is not in PWA standalone mode. - Implemented `isStandalone()` helper to detect PWA mode via `matchMedia` and `navigator.standalone`. - Added a precise shrink-to-icon dismissal animation. The logic tracks the position of the "Info" button's SVG relative to the viewport center using `requestAnimationFrame`, updating CSS variables `--exit-x` and `--exit-y`. - Uses viewport center as the stable reference point to avoid feedback loops during animation. - CSS transitions use `allow-discrete` to animate the `display` property alongside `transform` and `opacity`. - Persists dismissal to `localStorage` when the popover is closed (via `toggle` event). - Added an "Info" button in the bottom-right controls (next to GitHub link) to re-open the popover manually. - Bumped version to 0.0.37.
- Added a native HTML popover to `index.html` warning about "vibecoded" nature. - Added logic in `src/app.ts` to show the popover only if `localStorage` key `vibe-warning-shown` is missing AND the app is not in PWA standalone mode. - Implemented `isStandalone()` helper to detect PWA mode via `matchMedia` and `navigator.standalone`. - Added a precise shrink-to-icon dismissal animation. The logic calculates the delta from the viewport center to the "Info" button's SVG on `resize` and `toggle` (open), avoiding per-frame loops. - CSS transitions use `allow-discrete` to animate the `display` property alongside `transform` and `opacity`. - Persists dismissal to `localStorage` when the popover is closed (via `toggle` event). - Added an "Info" button in the bottom-right controls (next to GitHub link) to re-open the popover manually. - Bumped version to 0.0.38.
- Added a native HTML popover to `index.html` warning about "vibecoded" nature.
- Added logic in `src/app.ts` to show the popover only if `localStorage` key `vibe-warning-shown` is missing AND the app is not in PWA standalone mode.
- Defer geolocation request (`watchPosition`) until the popover is dismissed on first launch.
- Included a conditional message in the popover ("We'll ask for location permissions after this") that shows only on first launch.
- Implemented `isStandalone()` helper to detect PWA mode via `matchMedia` and `navigator.standalone`.
- Added a precise shrink-to-icon dismissal animation. The logic calculates the delta from the viewport center to the "Info" button's SVG on `resize` and `toggle` (open).
- CSS transitions use `allow-discrete` to animate the `display` property alongside `transform` and `opacity`.
- Persists dismissal to `localStorage`.
- Added an "Info" button in the bottom-right controls to re-open the popover manually.
- Bumped version to 0.0.39.
- Added local `PopoverElement` interface to extend `HTMLElement` with popover methods (`showPopover`, `hidePopover`, `togglePopover`). - Added local `ToggleEvent` interface to type the popover toggle event. - Cast `vibeWarningEl` to `PopoverElement` and the toggle event to `ToggleEvent` to remove `any` usage. - Bumped version to 0.0.40.
- Updated `.vibe-warning-popover` CSS to use `display: flex`, `flex-direction: column`, and `align-items: center` to ensure the dismissal button is centered. - Bumped version to 0.0.41.
Changed the logging threshold for the delay between `handlePosition` calls from 1000ms to 1100ms to reduce noise. Updated the corresponding unit test to reflect the new threshold.
…ld-3948986247368700968 Update handlePosition logging threshold to 1100ms
- Changed unknown speed message text to 'Speed is unknown.'. - Removed pill styling and background from unknown speed message. - Added CSS logic to offset unknown speed message in portrait mode when warning is hidden, ensuring consistent layout position. - Updated index.html and app.test.ts. - Updated permissions flow: changed info popover button to 'Enable Location' (data-action='ask') initially. - Clicking 'Enable Location' triggers startGeolocation() and updates text to 'Waiting...'. - Upon successful location fix (in handlePosition), button updates to 'Got it' (data-action='close') and location message updates to 'Location access granted!'.
- Fixed unused variable in tests/app.test.ts. - Suppressed duplicate property warnings in index.html for CSS fallbacks. - Formatted code with Biome. - Consolidated previous changes: unknown speed message styling, positioning, and permissions flow improvements.
This change updates the logic for calculating the age of speed data. Instead of using `Date.now()` when the event is processed, it now uses `pos.timestamp` from the Geolocation API. This ensures that stale data (e.g., buffered events after app resume) is correctly identified as old, preventing the UI from displaying it as fresh data. Added a regression test case in `tests/app.test.ts` to verify that position updates with old timestamps trigger the stale data warning.
- Prevent the stale data warning from appearing if the "Speed is unknown" message is already visible. - Add regression test to verify that null speed updates do not trigger the warning even after a timeout.
…eed-1758944363823105266
Increases the padding-left and padding-right of the .bottom-bar in landscape mode to max(48px, env(safe-area-inset-*)). This ensures that control labels like "Stay Awake" and icons are more inset from the screen edges, improving aesthetics and preventing overlap with rounded corners or notches.
Increases the horizontal padding of the .bottom-bar in landscape mode to max(64px, env(safe-area-inset-*)) to ensure text and icons are well inset from the screen edges.
Increases the visual inset of the speed display and bottom bar controls in landscape mode. - Reduces `.speed` font-size from 32vw to 27vw to increase side margins (~8vw). - Increases `.bottom-bar` horizontal padding to max(64px, env(safe-area-inset-*)) to match. This ensures critical UI elements are not positioned too close to the screen edge or under notches/rounded corners.
This change increases the font size of the speed display in portrait mode to `clamp(64px, 52vw, 600px)` and adjusts the width to `3ch` to fit 3 digits maximally. These changes are wrapped in a `@media (orientation: portrait)` block to strictly isolate them and prevent regressions in landscape mode.
Decreases the font size in portrait mode from 52vw to 42vw. This effectively reduces the width of the 3ch container relative to the viewport, thereby increasing the auto-margins on the sides while keeping the text centered and legible. This change is scoped to the `@media (orientation: portrait)` block.
Updates the portrait mode font size to `42vw` to provide larger side margins while ensuring 3 digits still fit safely. Adds a `max-width: 100%` constraint for additional safety. Bumps the version number in `package.json` to 0.0.86. These changes are scoped to the portrait media query to avoid affecting landscape mode.
Replaces the 3 Em dashes (`———`) in the speed placeholder with 3 En dashes (`–––`). This reduces the width of the placeholder, ensuring it fits comfortably within the portrait viewport with the new, larger font size, preventing potential overflow or tight margins. These changes are applied to both the HTML `data-placeholder` attribute and the initial text content.
Updates the speed placeholder to use 3 En dashes (`–––`) instead of 3 Em dashes (`———`) in both `index.html` and `src/app.ts`. This ensures the placeholder text fits comfortably within the portrait viewport with the new, larger font size, and provides a consistent visual experience across both portrait and landscape modes.
…ait-2760285539754595711
…4884860826450105459
- Increased closing transition duration for `.info-popover` and its `::backdrop` to 1s. - Explicitly set opening transition duration to 0.5s in `:popover-open` state to preserve snappy opening. - Added `background-color` and `backdrop-filter` to `::backdrop` transition list to ensure smooth fade-out.
- Updated `.info-popover` transition duration to 0.75s. - Updated `.info-popover:popover-open` transition duration to 0.75s. - Updated `::backdrop` transitions to 0.75s.
- Removed `toHaveText("Info")` assertion in `tests/e2e/ui.spec.ts` to reduce brittleness.
- Kept `toBeVisible()` check to ensure popover opens correctly.
- Removed unused `heading` variable.
…on-173859597709416002
Deploying speedometer with
|
| Latest commit: |
31a71c8
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://db107d99.speedometer-f1o.pages.dev |
| Branch Preview URL: | https://dev.speedometer-f1o.pages.dev |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Alpha