Fix Activity Log timezone formatting#112
Conversation
Co-authored-by: openhands <openhands@all-hands.dev>
|
🚀 Deploy Preview PR Created/Updated A deploy preview has been created/updated for this PR. Deploy PR: https://github.com/OpenHands/deploy/pull/4289 Once the deploy PR's CI passes, the automation service will be deployed to the feature environment. |
all-hands-bot
left a comment
There was a problem hiding this comment.
🟢 Good taste - Clean, focused fix that solves a real UX problem.
Changes Reviewed:
- Timezone handling: Activity log timestamps now use the automation's trigger timezone instead of browser timezone
- Backward compatibility: Falls back to legacy
automation.timezonefor existing data - Error handling: Try-catch in formatting function gracefully handles invalid timezones
- Type safety: TypeScript types properly updated
- Test coverage: New test verifies timezone formatting with abbreviation display
[RISK ASSESSMENT]
- [Overall PR]
⚠️ Risk Assessment: 🟢 LOW
This is a frontend-only display formatting change with no API or backend modifications. The implementation includes proper fallbacks (missing timezone, formatting errors, legacy data), maintains backward compatibility through optional props, and has test coverage. The change is minimal, focused, and well-structured.
VERDICT:
✅ Worth merging: Clean implementation with proper error handling and backward compatibility.
KEY INSIGHT:
Elegant solution that threads timezone through components without over-engineering - uses simple prop passing rather than context, appropriate for this focused use case.
Was this automated review useful? React with 👍 or 👎 to this review to help us measure review quality.
Workflow run: https://github.com/OpenHands/automation/actions/runs/26409964274
Summary
trigger.timezonewhile preserving the existing top-level fallback used by mocks/legacy data.Tests
cd frontend && npm run make-i18n && npm test -- src/__tests__/components/automations/detail/activity-log-item.test.tsx src/__tests__/components/automations/detail/activity-log-section.test.tsx src/__tests__/routes/automation-detail.test.tsxcd frontend && npm run typecheckcd frontend && npx eslint src/components/automations/detail/activity-log-item.tsx src/components/automations/detail/activity-log-section.tsx src/components/automations/detail/configuration-section.tsx src/routes/automation-detail.tsx src/__tests__/components/automations/detail/activity-log-item.test.tsx src/types/automation.ts && npx prettier --check src/components/automations/detail/activity-log-item.tsx src/components/automations/detail/activity-log-section.tsx src/components/automations/detail/configuration-section.tsx src/routes/automation-detail.tsx src/__tests__/components/automations/detail/activity-log-item.test.tsx src/types/automation.tsThis PR was created by an AI agent (OpenHands) on behalf of the user.
@neubig can click here to continue refining the PR
Related issue: #130