Skip to content

[PER-10641] Create edtf date dropdown component#1047

Open
aasandei-vsp wants to merge 5 commits into
PER-10632-add-components-edtffrom
PER-10641-create-edtf-date-dropdpwn-component
Open

[PER-10641] Create edtf date dropdown component#1047
aasandei-vsp wants to merge 5 commits into
PER-10632-add-components-edtffrom
PER-10641-create-edtf-date-dropdpwn-component

Conversation

@aasandei-vsp

@aasandei-vsp aasandei-vsp commented Jun 3, 2026

Copy link
Copy Markdown
Contributor

Manual test cases — sidebar date dropdown

Setup (run once before the tests):

  1. Log in or create a new account.
  2. Upload a file.
  3. Click the file.
    EXPECTED: The sidebar appears with a Date section.

STEPS TO TEST:

Date and time:

  1. Open the dropdown.
  2. Enter April 12, 1985 in the date input.
  3. In the time input, enter 02:30:00 and toggle the meridian to PM.
  4. Click Save.
    EXPECTED: The sidebar shows "April 12, 1985 • 02:30:00 PM" with the browser timezone abbreviation appended (e.g. "EST").

Date with unspecified digits:

  1. Open the dropdown.
  2. Type only 1988 (3 digits) in the year input, leave the month empty, and 05 in the day.
  3. Click Save.
    EXPECTED: The sidebar shows "1988-XX-05".

Cancel:

  1. With a date already saved (e.g. April 12, 1985), click the Date section to reopen the dropdown.
    EXPECTED: The dropdown reopens with the saved date and time pre-filled.
  2. Change the year to 1990.
  3. Click Cancel.
    EXPECTED: The dropdown closes and the sidebar still shows "April 12, 1985". No changes are persisted.

Edit a saved date through the dropdown:

  1. With a date already saved (e.g. April 12, 1985), click the Date section.
  2. Change the day to 20.
  3. Click Save.
    EXPECTED: The sidebar updates to "April 20, 1985".
  4. Refresh the page.
    EXPECTED: The sidebar still shows "April 20, 1985".

Introduce three shared components for EDTF date/time editing:
datepicker-input, timepicker-input, and timezone-dropdown.

Includes related updates to EdtfService and to the shared styles
(_colors.scss and _mixins.scss) to support the new components.

Issue: PER-10632
@codecov

codecov Bot commented Jun 3, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 76.56904% with 112 lines in your changes missing coverage. Please review.
✅ Project coverage is 50.66%. Comparing base (23409a4) to head (004db68).
⚠️ Report is 8 commits behind head on main.

Files with missing lines Patch % Lines
...c/app/shared/services/edtf-service/edtf.service.ts 77.62% 16 Missing and 16 partials ⚠️
...debar-date-picker/sidebar-date-picker.component.ts 84.24% 11 Missing and 12 partials ⚠️
...nts/timepicker-input/timepicker-input.component.ts 69.11% 18 Missing and 3 partials ⚠️
...nts/datepicker-input/datepicker-input.component.ts 73.01% 14 Missing and 3 partials ⚠️
...le-browser/components/sidebar/sidebar.component.ts 36.84% 11 Missing and 1 partial ⚠️
...s/timezone-dropdown/timezone-dropdown.component.ts 81.81% 4 Missing and 2 partials ⚠️
src/app/core/services/edit/edit.service.ts 83.33% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1047      +/-   ##
==========================================
+ Coverage   49.86%   50.66%   +0.79%     
==========================================
  Files         348      352       +4     
  Lines       11502    11894     +392     
  Branches     1975     2119     +144     
==========================================
+ Hits         5736     6026     +290     
- Misses       5579     5639      +60     
- Partials      187      229      +42     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Created a new component that shows a dropdown for picking up a date
in the sidebar. This uses the date and time pickers and integrates
with the BE.

Issue: PER-10641
The integration of the sidebar-date-picker component in the sidebar is
hidden under a flag.

Issue: PER-10641
@aasandei-vsp aasandei-vsp force-pushed the PER-10641-create-edtf-date-dropdpwn-component branch from d223eda to 1312842 Compare June 3, 2026 09:38
@slifty slifty requested a review from Copilot June 3, 2026 19:33

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

This PR introduces new EDTF-focused date/time UI building blocks (date picker, time picker, timezone dropdown) and wires an EDTF date picker into the file-browser sidebar behind a feature flag, supported by a substantial expansion/refactor of the shared EdtfService.

Changes:

  • Added reusable date/time input components and a sidebar EDTF date picker UI (feature-flagged).
  • Refactored EdtfService parsing/serialization and expanded validation helpers + test coverage.
  • Added displayTime mapping support to the record repo + improved edit-service error handling/revert behavior.

Reviewed changes

Copilot reviewed 29 out of 29 changed files in this pull request and generated 9 comments.

Show a summary per file
File Description
src/styles/_mixins.scss Adds new SCSS mixins used by the new date/time components.
src/styles/_colors.scss Adds PR blue shade tokens used by the new component styles.
src/app/shared/services/edtf-service/edtf.service.ts Major refactor/expansion of EDTF parsing, formatting, validation, and timezone-display helpers.
src/app/shared/services/edtf-service/edtf.service.spec.ts Updates and expands unit tests for the new EDTF behavior and helper methods.
src/app/shared/services/api/record.repo.ts Adds optional displayTime support in Stela record mapping.
src/app/shared/services/api/record.repo.spec.ts Adds tests verifying displayTime mapping behavior.
src/app/shared/components/timezone-dropdown/timezone-dropdown.component.ts Adds standalone timezone dropdown component sourcing IANA zones via Intl.
src/app/shared/components/timezone-dropdown/timezone-dropdown.component.spec.ts Adds unit tests for timezone dropdown behavior.
src/app/shared/components/timezone-dropdown/timezone-dropdown.component.scss Styles for the timezone dropdown.
src/app/shared/components/timezone-dropdown/timezone-dropdown.component.html Template for timezone dropdown UI.
src/app/shared/components/timepicker-input/timepicker-input.component.ts Adds standalone time input + ng-bootstrap timepicker dropdown behavior.
src/app/shared/components/timepicker-input/timepicker-input.component.spec.ts Adds unit tests for timepicker input interactions/validation.
src/app/shared/components/timepicker-input/timepicker-input.component.scss Styles for the timepicker input.
src/app/shared/components/timepicker-input/timepicker-input.component.html Template for timepicker input UI.
src/app/shared/components/datepicker-input/datepicker-input.component.ts Adds standalone date input + ng-bootstrap datepicker dropdown behavior.
src/app/shared/components/datepicker-input/datepicker-input.component.spec.ts Adds unit tests for datepicker input interactions/validation.
src/app/shared/components/datepicker-input/datepicker-input.component.scss Styles for the datepicker input.
src/app/shared/components/datepicker-input/datepicker-input.component.html Template for datepicker input UI.
src/app/file-browser/file-browser-components.module.ts Imports the new sidebar date picker component into the file-browser module.
src/app/file-browser/components/sidebar/sidebar.component.ts Integrates EDTF date picker into the sidebar behind edtf-date feature flag; adds save handler.
src/app/file-browser/components/sidebar/sidebar.component.spec.ts Updates sidebar tests for feature flag handling and new dependencies.
src/app/file-browser/components/sidebar/sidebar.component.scss Switches to Sass @use for variables import.
src/app/file-browser/components/sidebar/sidebar.component.html Feature-flagged switch between legacy inline date edit and new EDTF picker UI.
src/app/file-browser/components/sidebar-date-picker/sidebar-date-picker.component.ts Adds the sidebar EDTF date picker component and related formatting logic.
src/app/file-browser/components/sidebar-date-picker/sidebar-date-picker.component.spec.ts Adds unit tests for sidebar date picker rendering and interactions.
src/app/file-browser/components/sidebar-date-picker/sidebar-date-picker.component.scss Styles for the sidebar date picker dropdown/panel.
src/app/file-browser/components/sidebar-date-picker/sidebar-date-picker.component.html Template for the sidebar date picker UI.
src/app/core/services/edit/edit.service.ts Improves error handling: reverts property on failure and shows error messages.
src/app/core/services/edit/edit.service.spec.ts Adds tests ensuring revert + error messaging behavior on save failures.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/app/shared/services/edtf-service/edtf.service.ts
Comment thread src/app/shared/components/timepicker-input/timepicker-input.component.html Outdated
Comment thread src/app/file-browser/components/sidebar/sidebar.component.ts
@aasandei-vsp aasandei-vsp changed the title [PER-10641] Create edtf date dropdpwn component [PER-10641] Create edtf date dropdown component Jun 4, 2026
The user can now choose to fill in the date using meridian, but
also the 24h format.

Issue: PER-10641
In the edtf date dropdown and modal, when year, month or day have undefined
digits, replace them with X values for display and leave them as empty in
the inputs.

PER-10641
@cecilia-donnelly

Copy link
Copy Markdown
Member

Can you base this PR on #1029? That will make it much simpler to review without accidentally looking at the same code twice, and it'll automatically switch to main once #1029 gets merged in. Thank you!

@aasandei-vsp aasandei-vsp changed the base branch from main to PER-10632-add-components-edtf June 11, 2026 11:32
@aasandei-vsp aasandei-vsp changed the base branch from PER-10632-add-components-edtf to main June 11, 2026 11:33
@aasandei-vsp aasandei-vsp changed the base branch from main to PER-10632-add-components-edtf June 11, 2026 11:35
@aasandei-vsp aasandei-vsp force-pushed the PER-10632-add-components-edtf branch from 05e98b2 to e00e0ae Compare June 11, 2026 16:33
@aasandei-vsp

aasandei-vsp commented Jun 11, 2026

Copy link
Copy Markdown
Contributor Author

Can you base this PR on #1029? That will make it much simpler to review without accidentally looking at the same code twice, and it'll automatically switch to main once #1029 gets merged in. Thank you!

That makes more sense, yes. I have been working on this today, but I got some conflicts that didn't manage to fix yet.(Some commits SHAs have diverted, not sure why) I should have this rebased on the correct branch tomorrow, as I am almost done with rebasing them correctly locally.

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.

3 participants