Skip to content

fix: use datetime-local inputs with clean ISO round-trip in dialogs#273

Merged
fank merged 5 commits intomainfrom
fix/dialog-date-inputs
Feb 28, 2026
Merged

fix: use datetime-local inputs with clean ISO round-trip in dialogs#273
fank merged 5 commits intomainfrom
fix/dialog-date-inputs

Conversation

@fank
Copy link
Member

@fank fank commented Feb 28, 2026

Summary

  • Remove unnecessary reactive wrapper rec() in EditModal — access props.rec directly with eslint-disable comments for intentional one-time form state init
  • Change date inputs from type="date" to type="datetime-local" in both EditModal and UploadDialog to preserve time information
  • Use clean ISO round-trip: strip trailing Z on init, append Z on save — no timezone conversion needed since Go sends RFC 3339 UTC

Test plan

  • Open EditModal for a recording with a date — verify date and time are shown
  • Save without changes — verify the date round-trips unchanged
  • Modify the date/time and save — verify the new value persists correctly
  • Open UploadDialog — verify current date and time are pre-filled
  • Upload a recording with a date — verify the date is stored correctly

- Remove unnecessary reactive wrapper `rec()` in EditModal, access
  props.rec directly with eslint-disable for intentional one-time init
- Change date inputs from `type="date"` to `type="datetime-local"` in
  both EditModal and UploadDialog to preserve time information
- Use clean ISO round-trip: strip trailing Z on init, append Z on save
@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request refines the handling of date and time inputs within the application's dialogs. The primary goal is to ensure that date and time information is accurately captured and preserved throughout the editing and uploading processes, moving from date-only inputs to full datetime inputs and implementing a robust ISO format round-trip strategy.

Highlights

  • Reactive Wrapper Removal: Removed the unnecessary rec() reactive wrapper in EditModal, allowing direct access to props.rec for one-time form state initialization.
  • Date Input Type Update: Changed date input fields from type="date" to type="datetime-local" in both EditModal and UploadDialog to preserve time information.
  • ISO Date Round-Trip Handling: Implemented a clean ISO round-trip mechanism for dates: stripping the trailing 'Z' on initialization and appending it back on save, aligning with Go's RFC 3339 UTC format without requiring timezone conversion.
Changelog
  • ui/src/pages/recording-selector/dialogs.tsx
    • Refactored EditModal to directly access props.rec for signal initialization, removing an unnecessary reactive wrapper and adding eslint-disable comments for intentional one-time form state setup.
    • Updated date input fields in both EditModal and UploadDialog from type="date" to type="datetime-local" to support time information.
    • Implemented logic to strip the trailing 'Z' from ISO date strings on initialization and append it back on save, ensuring proper UTC round-tripping without timezone conversion.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request effectively addresses the need to edit both date and time for recordings by switching to datetime-local inputs. The implementation for a clean ISO string round-trip, by stripping and re-appending the 'Z' for UTC, is a good approach. The refactoring in EditModal to remove the unnecessary reactive wrapper also improves code clarity. I have one minor suggestion for the UploadDialog to enhance the user experience regarding date precision.

@github-actions
Copy link

Merging this branch will increase overall coverage

Impacted Packages Coverage Δ 🤖
github.com/OCAP2/web/internal/server 93.96% (+13.92%) 🎉

Coverage by file

Changed unit test files

  • github.com/OCAP2/web/internal/server/handler_test.go

- Add isoToLocalInput/localInputToIso helpers using native Date for
  timezone conversion instead of regex string manipulation
- EditModal and UploadDialog now display dates in the user's local
  timezone and save back as UTC ISO strings
- Two users in different timezones editing the same recording will
  both see the correct local time for the same instant
- Update tests with RFC 3339 date with +09:00 offset, verify UTC
  round-trip, use fireEvent.submit for reliable form submission
@github-actions
Copy link

github-actions bot commented Feb 28, 2026

Coverage Report for ui

Status Category Percentage Covered / Total
🔵 Lines 99.03%
🟰 ±0%
3791 / 3828
🔵 Statements 98.31%
⬆️ +0.01%
5240 / 5330
🔵 Functions 97.55%
🟰 ±0%
1559 / 1598
🔵 Branches 88.89%
⬆️ +0.09%
1705 / 1918
File Coverage
File Stmts Branches Functions Lines Uncovered Lines
Changed Files
ui/src/pages/recording-selector/dialogs.tsx 95.39%
⬇️ -0.03%
75.4%
⬆️ +0.80%
92.4%
⬇️ -0.10%
98.11%
⬇️ -0.01%
35, 43, 113, 148, 156-158, 163, 170, 189, 280, 319
ui/src/pages/recording-selector/helpers.ts 100%
🟰 ±0%
94.73%
⬆️ +1.40%
100%
🟰 ±0%
100%
🟰 ±0%
Generated in workflow #243 for commit 8b531c3 by the Vitest Coverage Report Action

@fank fank merged commit 22e94e7 into main Feb 28, 2026
4 of 5 checks passed
@fank fank deleted the fix/dialog-date-inputs branch February 28, 2026 23:41
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.

1 participant