Skip to content

feat(trip): deterministic photo ordering and unknown time zones - #40

Merged
KALalev18 merged 2 commits into
mainfrom
feat/photo-ordering
Nov 1, 2026
Merged

KALalev18 merged 2 commits into
mainfrom
feat/photo-ordering

Conversation

@KALalev18

@KALalev18 KALalev18 commented Oct 30, 2026 •

Copy link
Copy Markdown
Contributor

Closes #25 . Capture order (local wall time, oldest first), ties by upload time then photo id; missing or malformed capture times last, in their own "No capture date" group. Recently uploaded is newest upload first. The API is expected to return this order (agreed in #25 ) and the frontend sorts again. "time zone unknown" is shown when no UTC offset was recorded. The viewer follows the order of the view it was opened from.

Suggested new body:

Summary

Implement deterministic photo ordering, explicit handling of unknown capture times and time zones, and consistent photo-viewer navigation.

Implements the frontend portion of #25. Backend contract alignment remains tracked in backend #45 and #47.

Changes

  • Order Trip Gallery and Journey photos by camera-local capture time, oldest first.
  • Place photos with missing or malformed capture timestamps last, with an undated group.
  • Break equal capture-time ties using upload time and photo ID.
  • Order Recently uploaded by upload time, newest first.
  • Show unknown time zones explicitly without assuming a UTC offset.
  • Keep photo-viewer navigation consistent with its originating collection.
  • Use shared ordering utilities across the UI and mock API.

Follow-up correction

Exclude malformed capture dates from trip start/end aggregation using the existing capture-date validation.

Add a regression test covering an invalid February 30 timestamp.

Integration

Rebased onto the integrated frontend branch containing #38 (API adapters), #39 (trip editing), and #37 (mock sharing). Preserve contract-shaped API responses and the existing mock/live separation.

Verification

  • TypeScript type checks and production build passed.
  • Lint completed with 0 errors and 36 warnings.
  • Full acceptance suite: 301 passed, 2 skipped.
  • Mock/live boundary suite: 6 passed.
  • Photo-ordering checks: 8 passed.
  • Photo-ordering browser tests: 12 passed.

Remaining work

The backend must implement compatible persistent photo ordering, including stable pagination and missing-timestamp semantics, as part of backend #45/#47 and frontend #19.

Merge order

Merge #38 → #39 → #37 before merging this PR. After those merges, retarget to main and verify the final diff and CI checks.

@KALalev18 KALalev18 self-assigned this Oct 30, 2026
@kctong529
kctong529 force-pushed the feat/photo-ordering branch from fcd92bb to 0a69ea4 Compare October 31, 2026 20:28
@kctong529
kctong529 changed the base branch from main to feat/link-sharing October 31, 2026 20:28
@kctong529

Copy link
Copy Markdown
Contributor

I've integrated this PR on top of #37 (which already includes #38 and #39), resolving the conflicts while preserving the existing API adapters, trip editing, and sharing functionality.

I also added a separate fix for trip date aggregation: malformed capture timestamps are now excluded from the trip's start and end dates, using the same validation rules as photo ordering. The regression test covers an invalid February 30 timestamp.

The integration preserves the contract-shaped mock API responses, and the Dashboard's recently uploaded photos use the shared ordering utility with the required view-model conversion.

@kctong529 kctong529 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I've completed the review and verification of PR #40.

The ordering rules are consistent with their intended contexts: Trip Gallery and Journey use camera-local capture time (oldest first), while Recently uploaded uses upload time (newest first). Missing and malformed capture timestamps are handled as undated, ties have deterministic ordering, and unknown time zones are presented without inventing an offset.

The integrated implementation passes:

  • Type checks and production build
  • Lint: 0 errors (36 warnings)
  • Full acceptance suite: 301 passed, 2 skipped
  • Mock/live boundary tests: 6 passed
  • Dedicated photo-ordering tests: 8 checks and 12 browser tests passed

I don't see any remaining blockers within the scope of this PR. The existing lint and bundle-size warnings can be addressed separately.

Approved. Please merge #38, #39, and #37 in that order before merging #40. Once those PRs are merged, retarget this PR to main, verify its final diff and CI checks, and then merge.

@kanetran29 kanetran29 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM

Base automatically changed from feat/link-sharing to main November 1, 2026 21:15
KALalev18 and others added 2 commits November 1, 2026 23:16
Use the shared capture-date validation when calculating trip start
and end dates, so malformed timestamps cannot affect the displayed
date range.

Add a regression assertion covering an invalid February 30 timestamp
in the photo-ordering acceptance scenario.
@KALalev18
KALalev18 force-pushed the feat/photo-ordering branch from 0a69ea4 to a8d2522 Compare November 1, 2026 21:17
@KALalev18
KALalev18 merged commit d87037b into main Nov 1, 2026
2 checks passed
@KALalev18
KALalev18 deleted the feat/photo-ordering branch November 1, 2026 21:25
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.

Define trip photo ordering and date handling

3 participants