Skip to content

fix(web): fall back to workspace timezone for time displays - #9796

Open
Liewzheng wants to merge 1 commit into
makeplane:masterfrom
Liewzheng:fix/workspace-timezone-fallback
Open

fix(web): fall back to workspace timezone for time displays#9796
Liewzheng wants to merge 1 commit into
makeplane:masterfrom
Liewzheng:fix/workspace-timezone-fallback

Conversation

@Liewzheng

Copy link
Copy Markdown

Description

Time displays in the web app ignored the workspace timezone and mixed two different timezones on a single row:

  • home/user-greetings.tsx and user/user-greetings.tsx: the clock time used user.user_timezone (DB default UTC for anyone who never picked one) while the greeting word, weekday and date used the browser timezone.
  • profile/time.tsx (ProfileSidebarTime): used only the profile user_timezone.
  • workspaces.timezone was only referenced by the settings page itself.

This PR adds a shared resolver in apps/web/core/hooks/use-display-timezone.ts and applies it to all three components. Resolution order:

  1. The user's profile timezone, with UTC treated as "unset" — it is the database default, so a user who never chose a timezone is indistinguishable from one who deliberately picked UTC; the organization-declared workspace timezone is the better fallback for the common case (documented in code comments).
  2. The current workspace's timezone (useWorkspace().currentWorkspace.timezone).
  3. undefined, which makes the Intl APIs use the browser's local timezone.

All fields on the greeting row (hour used for the morning/afternoon/evening decision, date, weekDay, timeString) now share the same resolved timezone, fixing the inconsistency where the greeting word and the clock time could belong to different timezones. The three components are wrapped in observer since they now read from the MobX workspace store. useTimeZoneConverter (project-vs-user comparison for scheduling views) was intentionally left untouched as its semantics differ.

Type of Change

  • Bug fix (non-breaking change which fixes an issue)

Test Scenarios

  • Workspace timezone = Asia/Hong_Kong, profile timezone unset (DB default UTC): home greeting shows 12:33 (workspace tz) instead of 04:33 (UTC), and the greeting word matches the displayed time.
  • Profile timezone explicitly set to a non-UTC value: displays continue to use the profile timezone (unchanged behavior).
  • Neither set: displays fall back to the browser's local timezone; the profile sidebar shows the browser timezone name instead of undefined.
  • pnpm turbo run check:types --filter=web, pnpm check:lint and oxfmt all pass.

References

Closes #9795

@coldtea-pr-lens

coldtea-pr-lens Bot commented Sep 9, 2026

Copy link
Copy Markdown

◈ PR Lens

🟢 +1 new · 🟠 ~3 changed · 🔴 -0 removed · 1 flow · 4 files · commit 9eb1946


Architecture

Architecture diagram for makeplane/plane at 9eb1946

4 components touched across 2 lanes.

Open the interactive canvas


Inside the changed components — 1 view

Component view — Web timezone resolution

Internal hook and UI components resolving timezones and observing workspace state

Architecture view of Component view — Web timezone resolution in makeplane/plane

Data flow

Data flow diagram for makeplane/plane at 9eb1946

Resolving display timezone for greetings

Open the interactive canvas


Drill down
Client Applications — 4 components
🟡 CHANGED Plane Web App

Next.js web application providing the core user interface for workspace management and project tracking.

🟢 NEW Display timezone hook

Resolves display timezone with fallback order: user preference (excluding default UTC), workspace timezone, then browser local.

🟡 CHANGED User greetings view

Displays user greeting, date, weekday, and time formatted with a unified resolved timezone, wrapped with MobX observer.

🟡 CHANGED Profile sidebar time

Shows user time and active timezone label in the profile sidebar with reactive store observation.


View

  • Architecture lens
  • Data flow lens
  • Expand every detail
  • Show unchanged neighbours

Tip

PR Lens is free for open source. A star on the repository is what keeps it going.

🪧 More tips
  • Run PR Lens on your own machine: npx skills add coldteadotai/pr-lens installs the agent skill. Then tell your coding agent: "Diagram the change you just made with PR Lens and attach it to the pull request."
  • Draw a diff before it is even a pull request: npx @coldtea/pr-lens-cli analyze --base origin/main reads the diff with your own model key, and npx @coldtea/pr-lens-cli render .pr-lens/graph.json draws the same lenses on your machine.
  • The boxes under View are live. Tick Architecture lens or Data flow lens to choose which diagrams appear, or Expand every detail to open every drill-down at once. The comment redraws in place a few seconds later.
  • Show unchanged neighbours lists the components this change did not touch alongside the ones it did, so the drill-down shows what the changed code sits next to.
  • GitHub will not let you zoom an image in a comment. The link under each diagram opens it on an interactive canvas, where you can zoom, pan and step through the flow.
  • The CLI's render picks up .github/pr-lens.yml automatically and applies your corrections (renames, exclusions, lane pins) at draw time.
  • Would you rather run it from CI on a key of your own? Add .github/workflows/pr-lens.yml with coldteadotai/pr-lens/packages/action@v0 and a model key in your repository secrets, say GEMINI_API_KEY. The Action asks Gemini by default, or OpenAI and any endpoint speaking /chat/completions through its provider input.
  • Push a new commit and the whole comment re-renders for the new head. An older run never overwrites a newer one, so a slow render cannot put a stale diagram back.
  • The diagrams follow your GitHub theme, so dark mode gets the dark render and light mode the light one, and the moving dots show this pull request's data in motion.

◈ Rendered by PR Lens · crafted with ❤️ by the Coldtea team · Come say hi on Discord

@coderabbitai

coderabbitai Bot commented Sep 9, 2026

Copy link
Copy Markdown
Contributor

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Advanced

Run ID: 2c2a6529-d2ba-49e0-938e-e04bd205d7dc

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

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