Skip to content

[PER-10415] Edtf date record viewer#1065

Open
aasandei-vsp wants to merge 11 commits into
PER-10643-edtf-validationfrom
PER-10415-edtf-date-record-viewer
Open

[PER-10415] Edtf date record viewer#1065
aasandei-vsp wants to merge 11 commits into
PER-10643-edtf-validationfrom
PER-10415-edtf-date-record-viewer

Conversation

@aasandei-vsp

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

Copy link
Copy Markdown
Contributor

Warning

This functionality is hidden under the edtf-date flag. Enable it only for testing — it must stay OFF in production.

Manual test cases — EDTF date in the full-screen record view (file-viewer)

Setup (run once)

  1. Log in or create a new account.
  2. Upload two files.
  3. Click a file to open it in full-screen view.
    Expected: The full-screen viewer opens with a metadata panel (name, description, Date, Uploaded, Size, Type).

Flag ON — EDTF date appears

  1. Turn the edtf-date flag ON.
  2. Open a file in full-screen view.
    Expected: The Date area shows the EDTF date control (clickable, opens a dropdown).
    Expected: No legacy plain "Date" text field is shown.

Flag OFF — legacy date appears

  1. Turn the edtf-date flag OFF.
  2. Open a file in full-screen view.
    Expected: The metadata table shows a legacy "Date" row with the inline date editor.
    Expected: The EDTF dropdown/modal control does not appear.

Modify the date from the dropdown (flag ON)

  1. Open a file in full-screen view.
  2. Click the Date control.
    Expected: The date dropdown opens.
  3. Enter April 12, 1985.
  4. Click Save.
    Expected: The Date area shows "April 12, 1985" with no error banner.

Modify the date from the modal (flag ON)

  1. Click the Date control.
  2. Click "More options".
    Expected: The edit date/time modal opens with a Start date card.
  3. Enter June 15, 1990.
  4. Click Save.
    Expected: The Date area updates to "June 15, 1990".

Cancel in the modal (flag ON)

  1. Click the Date control.
  2. Click "More options".
  3. Change the date to a new value.
  4. Click Cancel.
    Expected: The modal closes and the Date area still shows the previously saved value.

Persistence after refresh (flag ON)

  1. Set the date to April 12, 1985 and save.
    Expected: The Date area shows "April 12, 1985".
  2. Refresh the browser page.
    Expected: The full-screen view shows "April 12, 1985".

Persistence across left/right navigation (flag ON)

  1. Open the first file in full-screen view.
  2. Set its date to April 12, 1985 and save.
  3. Click the right chevron (›).
    Expected: The next file shows its own date or the empty state, not "April 12, 1985".
  4. Set this file's date to June 15, 1990 and save.
  5. Click the left chevron (‹).
    Expected: The first file shows "April 12, 1985".
  6. Click the right chevron (›).
    Expected: The second file shows "June 15, 1990".

Date shows in the sidebar after closing full-screen (flag ON)

  1. Set the date to April 12, 1985 and save.
  2. Click "Back".
    Expected: The full-screen view closes and the file list appears.
  3. Select the same file.
    Expected: The sidebar's Date section shows "April 12, 1985".

Shared item — date is disabled (flag ON)

  1. Share a file with another account using view-only (Viewer) access.
  2. Log in as the recipient account.
  3. Open the shared file in full-screen view.
    Expected: The Date area shows the saved date (or empty state).
  4. Click the Date control.
    Expected: Nothing happens — the date is disabled and the dropdown/modal does not open.

@aasandei-vsp aasandei-vsp self-assigned this Jun 17, 2026
@codecov

codecov Bot commented Jun 17, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 82.60870% with 8 lines in your changes missing coverage. Please review.
✅ Project coverage is 52.00%. Comparing base (67edbff) to head (df091d0).

Files with missing lines Patch % Lines
...er/components/file-viewer/file-viewer.component.ts 78.12% 7 Missing ⚠️
...debar-date-picker/sidebar-date-picker.component.ts 92.85% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@                      Coverage Diff                      @@
##           PER-10643-edtf-validation    #1065      +/-   ##
=============================================================
+ Coverage                      51.98%   52.00%   +0.02%     
=============================================================
  Files                            354      354              
  Lines                          12127    12164      +37     
  Branches                        2183     2190       +7     
=============================================================
+ Hits                            6304     6326      +22     
- Misses                          5599     5613      +14     
- Partials                         224      225       +1     

☔ 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.

@aasandei-vsp
aasandei-vsp force-pushed the PER-10643-edtf-validation branch from fe7dd07 to 57c3de4 Compare June 29, 2026 10:27
@aasandei-vsp
aasandei-vsp force-pushed the PER-10415-edtf-date-record-viewer branch from 67e2e7f to dd1b3c1 Compare June 29, 2026 10:55
@cecilia-donnelly

Copy link
Copy Markdown
Member

+1 to @slifty 's comments and I'll remove myself as a reviewer for now.

@cecilia-donnelly
cecilia-donnelly removed their request for review July 10, 2026 15:30
Left-pad single-digit month and day values with zero instead of
X-padding them, since a single 1-9 digit can only be a complete value
('5' -> '05', no longer '5X'). Require a complete date whenever a time
is provided and surface a dedicated friendly error message for that
case. Add a generic getSegmentError helper that the datepicker and
timepicker inputs use to build their inline field error messages
(invalid characters and out-of-range checks, skipped while the value
is still being typed).

Issue: PER-10643
Instead of silently rejecting invalid input, the year, month and day
segments now emit whatever the user typed and surface a per-field
error message below the input (invalid characters, out-of-range month
or day). The day is re-validated when the month changes, and picking
a date from the calendar clears all errors. The error styling lives
in new shared input-error-state and input-error-message mixins.

Issue: PER-10643
Instead of silently rejecting invalid input, the hours, minutes and
seconds segments now emit whatever the user typed and surface a
per-field error message below the input. The hour is re-validated
when the AM/PM/24H format changes.

Issue: PER-10643
The inline-error restructure dropped role="button", tabindex, and the
keydown.enter/space handlers from the calendar and clock toggle buttons,
leaving them mouse-only. Restore them and add keyboard-toggle tests.

Issue: PER-10643
Persist null instead of '' when a date is cleared, and render an
explicitly-null displayTime as empty ("Click to add date"). Widen
displayTime to string | null and add specs.

Issue: PER-10643
With the flag on, displayTime is authoritative (the migration backfills
it before the flip), so a missing value means the date was cleared and
nothing is shown. With the flag off, the file list keeps its fallback
so deployed code is unchanged.

Issue: PER-10643
Move the picker's display formatting into EdtfService so the preview
and the serialized EDTF are built from the same padding helpers — a
single-digit month now reads as the month itself ("1" -> January /
1985-01) in both. A lone "0" month or day is rejected with a clear
range error instead of being silently serialized to "0X".

Issue: PER-10643
@aasandei-vsp
aasandei-vsp force-pushed the PER-10643-edtf-validation branch from 57c3de4 to 67edbff Compare July 14, 2026 12:45
Gate the date control on the edtf-date flag: show the EDTF dropdown/modal
when it's on, and the legacy inline date field when it's off.

Port the sidebar's date handling to the file viewer:
- Cache displayTimeObject in a field, recomputed per record in initRecord,
  instead of a getter that allocated on every change-detection cycle.
- Re-sync after every save via a shared saveDisplayTime helper (used by
  both the inline picker and the modal), including on failure.
- Track the modal's closed subscription so it unsubscribes on destroy.

Issue: PER-10415
The global error banner sat at a lower z-index than full-screen views
(e.g. the file viewer), so errors rendered but were hidden behind the
overlay. Raise it above the full-screen layer and the date/time picker
dropdowns that open within it.

Issue: PER-10415
Mirror the sidebar behavior: persist null instead of '' when a date is
cleared, and render an explicitly-null displayTime as empty ("Click to
add date"). Add specs.

Issue: PER-10643
@aasandei-vsp

Copy link
Copy Markdown
Contributor Author

+1 to @slifty 's comments and I'll remove myself as a reviewer for now.

Very good points, I've addressed all of them.

- Give the inline date picker the same live EDTF validation as the
  modal: save is disabled with an inline error while the input is
  invalid, sharing the modal's error styling via a new mixin.
- Skip the date recompute in the file viewer when the edtf-date flag
  is off, so no EDTF errors can surface while the picker is hidden.
- Await the property save in the file viewer so the picker re-syncs
  to the reverted value when a save fails on the server.

Issue: PER-10415
@aasandei-vsp
aasandei-vsp force-pushed the PER-10415-edtf-date-record-viewer branch from dd1b3c1 to df091d0 Compare July 15, 2026 10:24
@aasandei-vsp
aasandei-vsp force-pushed the PER-10643-edtf-validation branch 2 times, most recently from a3a7e5a to 452da47 Compare July 22, 2026 13:33
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