Repository navigation
fix: format the outline tab's sequence due dates in the learner's timezone preference - #2149
Merged
Merged
Conversation
brian-smith-tcril
added this pull request to stack #2141
October 1, 2026 16:59
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #2149 +/- ##
==========================================
+ Coverage 95.14% 95.25% +0.11%
==========================================
Files 372 372
Lines 6053 6053
Branches 1452 1499 +47
==========================================
+ Hits 5759 5766 +7
+ Misses 282 275 -7
Partials 12 12 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
brian-smith-tcril
force-pushed
the
bsmith/sequence-due-date-timezone
branch
3 times, most recently
from
October 2, 2026 04:02
cc685ec to
6e86983
Compare
brian-smith-tcril
force-pushed
the
bsmith/sequence-due-date-timezone
branch
from
October 2, 2026 05:05
6e86983 to
6361944
Compare
Base automatically changed from
bsmith/declarative-courseware-redirects
to
master
October 2, 2026 05:34
…ezone preference `SequenceDueDate` read `userTimezone` as a top-level key of the outline tab data, where it has never existed: the endpoint carries `user_timezone` only inside `dates_widget`. PR #606 moved the outline tab's timezone reads to the course-home metadata but in `SequenceLink` only removed the `datesWidget` nesting, so the read has yielded `undefined` since and sequence due dates have formatted in the browser's zone. Read it from `useCourseHomeMeta`, as the tab's other date displays do, and name the field on `CourseHomeMeta`. Closes #2148 Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
brian-smith-tcril
force-pushed
the
bsmith/sequence-due-date-timezone
branch
from
October 2, 2026 05:34
6361944 to
af429fb
Compare
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.
Summary
The outline tab's subsection due dates have formatted in the browser's timezone rather than the learner's preference since #606 (2021). That PR moved the tab's timezone reads from the outline data to the course-home metadata, where the platform had just added
user_timezone; inSequenceLink.jsxit removed thedatesWidgetnesting from the read but left the model as'outline', souserTimezonehas beenundefinedthere since — carried verbatim intoSequenceDueDate.tsxby #1632, and given auserTimezone?: stringplaceholder on the hook's type by #2093 so it compiled. This makes the change #606 meant to make:SequenceDueDatereadsuserTimezonefromuseCourseHomeMeta, asCourseDatesandDayhave since that PR. Due dates now honour the learner's timezone preference; no other change, no request change. Found while planning #2130, which types the outline data from what the normalizer emits and so turned the read into a compile error. Part of the Redux → React Query migration (#1946, Stage 1); stacked above #2146, with #2130's layer to go on top. Closes #2148.One commit, test and fix together, by choice for a one-line fix; the test's before/after renders are in the decision log.
What changed
SequenceDueDate.tsx(decision 1):useOutlineTabData(courseId, { enabled: false }).data?.userTimezone→useCourseHomeMeta(courseId, { enabled: false }).data?.userTimezone.CourseHomeMeta(decision 4): gainsuserTimezone: string | null, the field this reader now reads; nullable because the platform returnsNonefor a user without a preference.OutlineTab.test.jsx(decision 3): one case, formats a sequence due date in the user_timezone from the course metadata — a sequence due2030-04-01T12:00:00Z,user_timezone: 'Asia/Tokyo'on the metadata, assertingdue Apr 1, 2030, 9:00 PM GMT+9. Before the fix the row rendersdue Apr 1, 2030, 12:00 PM UTC.Testing
npm run typesandnpm run lintclean; full suite 119 suites, 1186 passed, 0 skipped. The new case fails against the unfixed component for the observed reason (the UTC render above) and passes with the fix. No manual check: the suite case renders the real tab through the real queries with a non-UTC preference, which is the whole behaviour.Decisions
Full decision log
Decisions — the outline tab's sequence due dates ignore the learner's timezone preference (#2148)
Found while planning #2130 (
plan-2130.md, finding 1): typing the outlinedata from what
getOutlineTabDataemits turnedSequenceDueDate.tsx'suserTimezoneread into a compile error, and the history showed why. Layerof the running stack #2141 above #2146 (#2135), branch
bsmith/sequence-due-date-timezone; #2130's layer goes on top. Settled withthe user 2026-10-01.
Fix the read, do not delete it. The read has yielded
undefinedsince PR feat: add page banner to masquerade (AA-877) #606 (2021), which moved
userTimezoneto the course-homemetadata for
OutlineTab.jsxandCourseDates.jsxbut inSequenceLink.jsxonly removed thedatesWidgetnesting and left themodel as
'outline'(provenance in the issue). Deleting the read as deadcode was proposed and rejected: it throws away the broken thing instead
of fixing it. The change is the one feat: add page banner to masquerade (AA-877) #606 meant to make, the read
CourseDates.jsxandDay.jsxhave had since that PR:useCourseHomeMeta(courseId, { enabled: false }).data?.userTimezone.Its own layer, below Type the course-home API module on the functions that produce its results (convert course-home/data/api.js to TypeScript) #2130, one commit. The typing layer cannot land
with the read as it was (no
userTimezoneon the complete outline type;deleting or casting rejected), so the fix sits below it. The repo's
bug-fix layers are usually two commits, test then fix, for the
fail-to-pass CI evidence; the user chose one commit here, test and fix
together.
The test is in
OutlineTab.test.jsx, notSection.test.tsx.Section.test.tsxhas one test and renders with no data; the outlinesuite already renders the real tab through the real queries with
setMetadata/setTabData/fetchAndRender, and had no due-dateassertion. The case builds one sequence block with
due: '2030-04-01T12:00:00Z'throughbuildMinimalCourseBlocks'ssequenceBlocksoption and setsuser_timezone: 'Asia/Tokyo'on themetadata. Tests run in UTC (
global-setup.js) and the metadata factory'sdefault
user_timezoneis'UTC', so the defaults could not tell thepreference from the browser fallback; a non-UTC zone can. Observed:
before the fix the row renders
due Apr 1, 2030, 12:00 PM UTC; after,due Apr 1, 2030, 9:00 PM GMT+9, which the test pins exactly.userTimezone: string | nullis added toCourseHomeMeta. With thefix the reader reads it off the metadata, where it came through the
index signature as
unknown, and{ timeZone: unknown }failsFormattedTime'sDateTimeFormatOptions. Named per Type the course-home API module on the functions that produce its results (convert course-home/data/api.js to TypeScript) #2130's "name what weread" rule; nullable because the view sets it from
user_timezone_locale_prefs, which isNonefor a user without apreference (the platform's
test_view.pyassertsdates_widget.user_timezone is Nonefor that user). Type the course-home API module on the functions that produce its results (convert course-home/data/api.js to TypeScript) #2130 moves thetype beside its function.
The
userTimezone?: stringplaceholder onOutlineTabDatastays. Itnow has no reader, but it is Type the course-home API module on the functions that produce its results (convert course-home/data/api.js to TypeScript) #2130's to remove with the type it sits
on; this layer touches only what the fix needs.
Full suite on this layer: 119 suites, 1186 tests; lint and types clean.
🤖 Generated with Claude Code