Skip to content

[PER-10623] Refactor timezone dropdown and integrate it into the EDTF components - #1173

Open
aasandei-vsp wants to merge 4 commits into
mainfrom
PER-10623-add-timezone-dropdown-final-version
Open

aasandei-vsp wants to merge 4 commits into
mainfrom
PER-10623-add-timezone-dropdown-final-version

Conversation

@aasandei-vsp

@aasandei-vsp aasandei-vsp commented Sep 11, 2026

Copy link
Copy Markdown
Contributor

Manual test cases — IANA timezone picker on the EDTF date editors

Setup: Sign in as the owner of an archive with the edtf-date feature flag on.
You need: one record with a date and a time already set, one record with a year-only
date and no time, one record you can give a 1985 date to, one record that has a legacy
displayDT but no displayTime, and one folder. Your own machine timezone matters for two of the
scenarios below — note what it is before you start (macOS: System Settings → General →
Date & Time).

The visible change: three surfaces now have a timezone row, and they are not
interchangeable — the inline editor in the info sidebar, the same editor in the
full-screen file viewer's metadata panel, and the Edit date and time modal behind
More options in either of them.

The picker itself ⭐

*(run in all three — the info sidebar editor, the full-screen file viewer's editor,
and the Edit date and time modal.

Scenario — opening and reading a row

  1. Select the record that has a date and a time, and click the date in the info sidebar.
    • EXPECTED: The inline editor opens with a date field, a time field and a
      timezone row that is already filled in — an offset followed by a tz identifier,
      e.g. GMT+02:00 Africa/Blantyre.
  2. Click the timezone row.
    • EXPECTED: A list opens, grouped under headings Africa, America, Antarctica,
      Arctic, Asia, Atlantic, Australia, Europe, Indian, Pacific.
  3. Find Europe/Bucharest in the Europe group.
    • EXPECTED: The row shows an offset like GMT+02:00 or GMT+03:00, then
      Europe/Bucharest, then Romania.
  4. Click it.
    • EXPECTED: The list closes and the row now reads the offset followed by
      Europe/Bucharest.

Scenario — search, modal only

  1. In the sidebar editor click More options to open the modal, then click the
    timezone row in the Start date card.
    • EXPECTED: A list opens with a Search city, country or offset... field above it,
      already focused.
  2. Type bucharest.
    • EXPECTED: The list narrows to Europe/Bucharest.
  3. Clear the field and type romania.
    • EXPECTED: Europe/Bucharest is still listed — searching by country works
      even though the identifier never says Romania.
  4. Clear the field and type eastern european.
    • EXPECTED: Europe/Bucharest is listed — searching by the zone's display name
      works too.
  5. Clear the field and type new york.
    • EXPECTED: America/New_York is listed, despite the underscore in the identifier.
  6. Type nowhere at all.
    • EXPECTED: No matching timezones.

Timezone inferred from the date's own offset ⭐

Scenario — the guess appears without anyone choosing it

  1. Open the inline editor on a record with a date and a time that you have never given
    a timezone.
    • EXPECTED: The timezone row shows an offset and an identifier, if the edtf date had an offset attached.

Scenario — clearing the timezone actually clears it ⭐

  1. Give a record the date 2026 / 07 / 15, time 12 : 45 : 00 PM, pick
    Europe/Bucharest, and save.
    • EXPECTED: The stored displayTime is 2026-07-15T12:45:00+03:00.
  2. Reload, reopen the editor, choose Select timezone, and look at the editor before
    saving.
    • EXPECTED: The row reads Select timezone, and no offset is shown beside the time
      in the read-only row behind it.
  3. Save, then check the stored values.
    • EXPECTED: displayTime is now 2026-07-15T12:45:00no offset — and the
      timezone column is null. The offset goes when the zone goes; that is what stops
      the zone coming back.
  4. Reload and reopen the editor.
    • EXPECTED: The timezone row still reads Select timezone. The zone does not
      reappear. The date and time are unchanged.
  5. Save once more without touching the timezone.
    • EXPECTED: The timezone column is still null. A cleared zone is never quietly
      replaced by a guess.

Empty state and clearing ⭐

Scenario — a record with nothing to infer from starts empty

  1. Open the inline editor on a record with a date but no time.
    • EXPECTED: The timezone row reads Select timezone, not your own timezone.
      The picker never pre-fills with the machine's zone — only with a zone inferred from
      the record's own offset, and there is no offset here.

Scenario — choosing, then emptying again

  1. Pick Europe/Bucharest, then reopen the list.
  2. Click Select timezone.
    • EXPECTED: The row goes back to reading Select timezone.
  3. Save, reload the page, and reopen the editor.
    • EXPECTED: Still Select timezone. The clear survives the round trip, because
      clearing the zone also removes the offset there was to infer from.

Scenario — clear takes the timezone with it

  1. Pick Asia/Kathmandu, then click Clear date and time.
    • EXPECTED: The date, the time and the timezone are all emptied.
    • EXPECTED: After saving and reloading, all three are still empty.

Scenario — the clear row gets out of the way while searching

  1. In the modal, open the timezone list and type accra.
    • EXPECTED: Select timezone is no longer in the list.
  2. Press the down arrow once.
    • EXPECTED: Africa/Accra is highlighted — the first arrow press lands on a
      match, not on the clear row.

Validation ⭐

Scenario — a zone on a year-only date is not saved

  1. Open the inline editor on the record with a year-only date and no time.
    • EXPECTED: The timezone row reads Select timezone.
  2. Pick Europe/Bucharest and save.
    • EXPECTED: The save succeeds and the date row still shows the year.
  3. Reopen the editor.
    • EXPECTED: The timezone row reads Select timezone again — the zone was
      deliberately not stored, because there is no time for it to qualify.

Scenario — an unreadable time disables save

  1. In the modal, enter date 1985 / 05 / 12, then set the format toggle to 24H
    and type hour 99.
    • EXPECTED: The Save button is disabled and an inline error appears under
      the time field.
  2. Correct the hour to 14.
    • EXPECTED: Save becomes enabled and the EDTF value appears in the footer.

Scenario — no zone means no offset ⭐

  1. In the modal, enter a fresh date 1985 / 05 / 12 and time 12 : 45 : 00
    PM on a record with no stored timezone, and leave the timezone row alone.
    • EXPECTED: The EDTF value in the footer reads 1985-05-12T12:45:00 with no
      trailing offset. It does not end in your machine's offset.
  2. Save, then check the stored displayTime.
    • EXPECTED: Same — no offset.
  3. Now pick Europe/Bucharest and watch the footer.
    • EXPECTED: It becomes 1985-05-12T12:45:00+03:00.
  4. Choose Select timezone again.
    • EXPECTED: The offset disappears from the footer.

The full-screen file viewer ⭐

Scenario — the picker works the same here

  1. Open a record with a date and a time full-screen, and click the date in the
    metadata panel.
    • EXPECTED: The inline editor opens with the timezone row already filled in with an
      inferred zone, exactly as in the info sidebar.
  2. Change only the minutes and save.
  3. Click More options, pick Europe/Bucharest in the modal, and save.
    • EXPECTED: The sidebar shows the updated date.
4. Close the preview and single click on the same record.
- EXPECTED: The info sidebar shows the updated date.

Scenario — the legacy displayDT no longer shows a date here ⭐

  1. Find or make a record that has a legacy displayDT but no displayTime. With the
    edtf-date flag on, select it in the file list and look at the info sidebar.
    • EXPECTED: No date — Click to add date.
  2. Open that same record full-screen and look at the metadata panel.
    • EXPECTED: No date here either — Click to add date.
  3. Add a date and a time to it, and save.
    • EXPECTED: It saves normally and the date appears in both surfaces.
  4. Now turn the edtf-date flag off and open a record with only a displayDT
    full-screen.
    • EXPECTED: The legacy date field does still show the displayDT value. The
      old flag-off path was deliberately left alone.

The edtf-date flag — on and off ⭐

Scenario — flag ON, what should be present

  1. With edtf-date on, open a record in the info sidebar, then full-screen, then via
    More options.
    • EXPECTED: A timezone row in all three.
  2. Look at the read-only date row in the sidebar.
    • EXPECTED: Date, time, and an offset beside the time.

Scenario — flag OFF, what should be absent

  1. Turn edtf-date off, hard-reload, and open a record in the info sidebar.
    • EXPECTED: The legacy date field — a plain text input — and no timezone row
      anywhere. No More options button.
  2. Open the same record full-screen.
    • EXPECTED: The legacy Date row in the metadata table, no timezone row.
  3. Check a record whose only date is a legacy displayDT, in both the file list and the
    full-screen metadata table.
    • EXPECTED: The date is shown in both. The flag-off bindings still fall back to
      displayDT; only the flag-on picker stopped doing so.
  4. Edit a date in the legacy field and save.
    • EXPECTED: It saves and the new value is shown.

Scenario — flag OFF, what goes over the wire ⭐

  1. With edtf-date off, edit a date in the
    legacy sidebar field on a record you reached by opening its parent folder from the
    file list
    , and save.
    • EXPECTED: The save succeeds and the date is correct.
  2. Repeat on a record you reached by deep-linking straight to it (paste its URL and
    load the page fresh).
    • EXPECTED: The save succeeds and the date is correct.
  3. On a record that has a timezone set (set one with the flag on first, then flip the
    flag off and hard-reload), edit only the date and save.
    • EXPECTED: The timezone is still set afterwards. Turn the flag back on and reopen
      the editor to confirm the zone survived.

Scenario — flipping the flag does not strand data

  1. With the flag on, set a date, a time and Europe/Bucharest on a record. Save.
  2. Turn the flag off, hard-reload, and look at that record.
    • EXPECTED: The date still shows in the legacy field. The timezone is simply not
      surfaced — there is nowhere to show it — and that is correct, not lost.
  3. Turn the flag back on and reopen the editor.
    • EXPECTED: Europe/Bucharest is still selected.

Regression — untouched paths

Cheap sanity checks; these were traced as unchanged by this PR.

  1. Edit a record's name and description inline in the sidebar.
    • EXPECTED: Both save normally. They share the save path that was refactored.
  2. Set a date to Unknown, and separately to Approximate, and save each.
    • EXPECTED: Both behave as they did before; qualifiers are untouched by this change.

@aasandei-vsp aasandei-vsp self-assigned this Sep 11, 2026
@aasandei-vsp
aasandei-vsp marked this pull request as draft September 11, 2026 13:42
@aasandei-vsp
aasandei-vsp force-pushed the PER-10415-edtf-date-record-viewer branch from b16b99a to 6841c81 Compare September 11, 2026 13:49
@aasandei-vsp
aasandei-vsp force-pushed the PER-10623-add-timezone-dropdown-final-version branch from 4428303 to 11c61bd Compare September 11, 2026 13:52
@codecov

codecov Bot commented Sep 11, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 85.38682% with 51 lines in your changes missing coverage. Please review.
✅ Project coverage is 54.50%. Comparing base (8f4a06a) to head (201d5ab).

Files with missing lines Patch % Lines
...ared/services/timezone-service/timezone.service.ts 83.46% 17 Missing and 4 partials ⚠️
...s/timezone-dropdown/timezone-dropdown.component.ts 85.49% 14 Missing and 5 partials ⚠️
src/app/core/services/edit/edit.service.ts 70.00% 5 Missing and 1 partial ⚠️
...c/app/shared/services/edtf-service/edtf.service.ts 76.19% 4 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1173      +/-   ##
==========================================
+ Coverage   53.79%   54.50%   +0.71%     
==========================================
  Files         359      360       +1     
  Lines       12384    12651     +267     
  Branches     2256     2320      +64     
==========================================
+ Hits         6662     6896     +234     
- Misses       5485     5522      +37     
+ Partials      237      233       -4     

☔ 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-10623-add-timezone-dropdown-final-version branch 2 times, most recently from 2730f04 to 159e16b Compare September 12, 2026 13:30
@aasandei-vsp
aasandei-vsp marked this pull request as ready for review September 12, 2026 13:33
@aasandei-vsp
aasandei-vsp force-pushed the PER-10415-edtf-date-record-viewer branch 2 times, most recently from cd8e4f9 to 7a71bfa Compare September 16, 2026 11:15
@aasandei-vsp
aasandei-vsp force-pushed the PER-10623-add-timezone-dropdown-final-version branch from 159e16b to 1ee22f5 Compare September 16, 2026 11:27
@aasandei-vsp
aasandei-vsp force-pushed the PER-10415-edtf-date-record-viewer branch from 7a71bfa to a2a1b21 Compare September 17, 2026 11:26
Base automatically changed from PER-10415-edtf-date-record-viewer to main September 17, 2026 11:28
The already existing timezone was not wired to anything and it did not
match the current design, so it needed to be udpated.

The TimezoneService reads the tz database the browser already ships rather
than carrying a list of our own, so it stays current as the database
does. Also, it maps the cumbersome fields we are getting from the TZ database
into clear easy to use properties for our dropdown.

Issue: PER-10623
…perty.

Up until now we were just adding the current timezone of the browser, which
made times and even edge case dates inaccurate. With adding the timezone field,
now not only we have the correct offset, but the exact tz identifier that places
the date and time in a certain region.

From a technical perspective, we are using the tz identifier to infer and set
the offset of the date and time, only in special cases where we do not have a
stored timezone, we add an approximate tz identifier based on the offset we have
already saved.

Issue: PER-10623
Both folders and records on stela have a timezone property, so on
the web, we are using that to show the timezone(offset and tz identifier),
plus we are using the patch to update the value, this includes setting it
to null, in case we do not care about this property for our date.

Updating this value only goes through stela, which is consistent with the
way moving forward.

Issue: PER-10623
The intermediary step between the presentational components and the
saving/updating/deleting of the timezone is made by the sidebar and
file-viewer components that simply pic up the date time object, pass
it to the business layer and show any errors that might come from the BE.

Issue: PER-10623
@aasandei-vsp
aasandei-vsp force-pushed the PER-10623-add-timezone-dropdown-final-version branch from 1ee22f5 to 201d5ab Compare September 18, 2026 09:51
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