🐛 Bug: Fix greeting timezone mismatch and add night greeting#8924
🐛 Bug: Fix greeting timezone mismatch and add night greeting#8924MinitJain wants to merge 8 commits intomakeplane:previewfrom
Conversation
The greeting text and displayed time were computed from different timezone sources — hour used browser local time while timeString used user profile timezone — causing mismatched greeting and display. Also adds a "night" bucket (0–4 AM) so late-night users no longer see "Good morning", and guards against invalid timezone strings crashing the component via a try/catch fallback to browser local time. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
📝 WalkthroughWalkthroughUser greeting components now delegate time/weekday/date formatting and greeting selection to a new Changes
Sequence Diagram(s)sequenceDiagram
participant Component as UserGreetings Component
participant Hook as useGreeting Hook
participant Time as useCurrentTime
participant Intl as Intl.DateTimeFormat
Component->>Hook: call useGreeting(user)
Hook->>Time: read currentTime
Hook->>Hook: validate/memoize user.user_timezone
Hook->>Intl: format hour, date, weekday, timeString (with timezone)
Hook->>Hook: parse hour → determine greeting
Hook-->>Component: return { greeting, timeString, weekDay, date }
Component->>Component: call t(`greetings.${greeting}`, { first_name, last_name })
Component-->>User: render localized greeting and time strings
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 3❌ Failed checks (1 warning, 2 inconclusive)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
Actionable comments posted: 14
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (5)
packages/i18n/src/locales/ru/translations.ts (1)
496-500:⚠️ Potential issue | 🟡 MinorLocalize the new night greeting for Russian.
Line 500 leaves the Russian locale in English, so users can see
Доброго night. If the greeting is built from fragments, this also needs phrase-level handling for the natural Russian form “Доброй ночи”.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@packages/i18n/src/locales/ru/translations.ts` around lines 496 - 500, The Russian locale currently leaves the "night" key untranslated ("night"), causing outputs like "Доброго night"; update the translations in packages/i18n/src/locales/ru/translations.ts so the night fragment is translated (e.g., change night to "ночи") and, if greetings are composed from fragments, either (a) provide the correct fragment "ночи" and adjust plural/grammatical assembly so "Доброй ночи" is formed (change the "good" fragment to a context-aware form for night if needed) or (b) add a dedicated key like "goodNight": "Доброй ночи" and ensure the greeting builder uses this specific key when timeOfDay === "night".packages/i18n/src/locales/de/translations.ts (1)
501-505:⚠️ Potential issue | 🟠 MajorTranslate the new night greeting across 18 non-English locales.
The English placeholder
night: "night"was not translated in German or any of the other 17 affected locales (de, es, fr, it, pt-BR, ja, ko, ru, pl, ro, tr-TR, sk, ua, vi-VN, zh-CN, zh-TW, cs, id). Users will see mixed-language greetings across multiple languages. For German specifically, ensure the translation produces grammatically correct phrases like "Gute Nacht" rather than "Guten Nacht" if the UI concatenates time-of-day keys.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@packages/i18n/src/locales/de/translations.ts` around lines 501 - 505, The German locale currently has incorrect entries for the greeting keys in translations.ts: change the "good" value from "Guten" to "Gute" and replace the placeholder "night": "night" with the proper German translation "night": "Nacht" so concatenation produces "Gute Nacht"; update the same "night" key in the other 17 locale files (es, fr, it, pt-BR, ja, ko, ru, pl, ro, tr-TR, sk, ua, vi-VN, zh-CN, zh-TW, cs, id) with their correct translations, locating the entries by the keys good, morning, afternoon, evening, and night in each translations.ts to make consistent time-of-day greetings.packages/i18n/src/locales/sk/translations.ts (1)
488-492:⚠️ Potential issue | 🟡 MinorLocalize the new Slovak
nightvalue.Line 492 leaves the new greeting bucket in English, so Slovak users can see mixed-language greeting text.
🌐 Proposed fix
- night: "night", + night: "noc",If the UI composes this as
good + night, please also verify the final rendered Slovak phrase, since night greetings may need a full-phrase translation.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@packages/i18n/src/locales/sk/translations.ts` around lines 488 - 492, The key "night" in the Slovak translations object is still English ("night"); update the "night" value to the correct Slovak word (e.g., "noc" or the context-appropriate phrase) alongside the existing keys (good, morning, afternoon, evening, night) so all greeting parts are localized; also check where the UI composes greetings from "good" + "night" (or similar concatenation) and, if needed, replace the composed parts with a single localized phrase or adjust the "good" and "night" strings so the final rendered Slovak greeting reads naturally.packages/i18n/src/locales/fr/translations.ts (1)
497-501:⚠️ Potential issue | 🟡 MinorLocalize the new French
nightvalue.Line 501 leaves the new greeting bucket in English, so French users can see mixed-language greeting text.
🌐 Proposed fix
- night: "night", + night: "nuit",If this is rendered as a composed greeting, please verify the full French phrase because “Good night” is usually not a direct
good + nightconstruction.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@packages/i18n/src/locales/fr/translations.ts` around lines 497 - 501, The 'night' translation key is still English; update the value for the night key in the translations object (the same object that contains good, morning, afternoon, evening) to a proper French string—use "nuit" if the key is used as a noun or "bonne nuit" if it's rendered as a full greeting (e.g., composed with 'good' resulting in "bonne nuit"); if your UI composes greetings by concatenating 'good' + ' ' + 'night', prefer setting night="nuit" and change composition to produce "Bonne nuit" or replace night with "bonne nuit" and remove concatenation to avoid double words/capitalization issues.packages/i18n/src/locales/es/translations.ts (1)
501-505:⚠️ Potential issue | 🟡 MinorLocalize the new Spanish
nightvalue.Line 505 leaves the new greeting bucket in English, so Spanish users can see mixed-language greeting text.
🌐 Proposed fix
- night: "night", + night: "noches",Please verify the final rendered greeting as well, since Spanish night greetings usually need agreement with the preceding word.
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@packages/i18n/src/locales/es/translations.ts` around lines 501 - 505, The Spanish translations file left the "night" key untranslated; change the "night" value from "night" to "noches" and then ensure gender/number agreement for the composed greeting used by the UI: either add a specific key like "good_night": "Buenas" or extend the existing "good" key to provide gendered variants (e.g., good.masc / good.fem) so that when the code composes greetings (using keys good, morning/afternoon/evening/night) the final rendered phrase is correct (e.g., "Buenas noches" instead of "Buenos noches"); update the translations in translations.ts accordingly and adjust any consuming code to use the new key or variant.
🧹 Nitpick comments (2)
apps/web/core/components/user/user-greetings.tsx (2)
25-33: ConsideruseMemofor the timezone validation IIFE.The IIFE runs on every render (and
currentTimeupdates frequently viauseCurrentTime), constructing a throwawayIntl.DateTimeFormateach time just for validation. Wrapping it inuseMemokeyed onuser?.user_timezoneavoids redundant work and lets the validated value be reused.♻️ Proposed refactor
- const userTimezone = (() => { - if (!user?.user_timezone) return undefined; - try { - Intl.DateTimeFormat(undefined, { timeZone: user.user_timezone }); - return user.user_timezone; - } catch { - return undefined; - } - })(); + const userTimezone = useMemo(() => { + if (!user?.user_timezone) return undefined; + try { + new Intl.DateTimeFormat(undefined, { timeZone: user.user_timezone }); + return user.user_timezone; + } catch { + return undefined; + } + }, [user?.user_timezone]);Note:
Intl.DateTimeFormat(...)withoutnewstill works for validation, but addingnewis the conventional form.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@apps/web/core/components/user/user-greetings.tsx` around lines 25 - 33, Refactor the userTimezone IIFE into a memoized computation using React's useMemo so validation only runs when user?.user_timezone changes: replace the self-invoking function that constructs Intl.DateTimeFormat with a useMemo hook keyed on user?.user_timezone, keep the same try/catch validation logic (use new Intl.DateTimeFormat for clarity) and return undefined on invalid values; ensure the variable name userTimezone remains the same so existing consumers are unchanged and avoid tying it to currentTime or other frequently-updating state like useCurrentTime.
1-75: Remove the unused duplicate —apps/web/core/components/user/user-greetings.tsxis dead code.Both
apps/web/core/components/user/user-greetings.tsxandapps/web/core/components/home/user-greetings.tsxare byte-for-byte identical in implementation. The user version is exported viauser/index.tsbut has zero consumers in the codebase, while the home version is actively used inapps/web/core/components/home/root.tsx. Delete the user version and update the barrel export, or consolidate into a shared component if the barrel export path is intended for future use.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@apps/web/core/components/user/user-greetings.tsx` around lines 1 - 75, The file defines a duplicate component UserGreetingsView that is unused; remove this dead copy and update exports: delete the duplicate UserGreetingsView implementation (the unused user variant) and remove its export from the user barrel (user/index.ts) or point that barrel to the existing home variant (the single shared UserGreetingsView used by home/root.tsx); alternatively consolidate by exporting the shared component from one location and updating any imports to reference that single export so only one implementation remains.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@apps/web/core/components/user/user-greetings.tsx`:
- Around line 35-60: The midnight hour formats as "24" causing hourNum to be 24
and the greeting to misclassify as "evening"; update the two Intl.DateTimeFormat
instances that produce hour and timeString to include hourCycle: "h23" so
midnight formats as "0" and the hourNum/greeting logic (variables hour,
timeString, hourNum, greeting) works correctly; make the identical change in the
other user-greetings.tsx component that contains the same hour/timeString
formatters.
In `@packages/i18n/src/locales/cs/translations.ts`:
- Line 492: The Czech locale currently has the key "night" set to the English
string "night"; update the value of the "night" translation in
packages/i18n/src/locales/cs/translations.ts (the "night" entry) to the approved
Czech wording so the late-night greeting renders fully localized.
In `@packages/i18n/src/locales/id/translations.ts`:
- Line 497: The translations file contains an untranslated "night" key (e.g., in
packages/i18n/src/locales/id/translations.ts the entry night: "night") — replace
the English literal with the appropriate Indonesian string ("dini hari") and
ensure the semantic bucket for 00:00–04:59 is correct (note evening already maps
to "malam"); repeat the same fix across the other non-English locale files
listed (zh-CN, vi-VN, zh-TW, tr-TR, sk, ro, ua, pt-BR, it, ja, fr, es, ko, ru,
de, cs, pl) by replacing their "night" values with the correct localized
translations for the 00:00–04:59 time range while keeping the key name night
unchanged.
In `@packages/i18n/src/locales/it/translations.ts`:
- Line 498: The Italian translations file contains the key "night" set to the
English string "night"; update the Italian locale's translations.ts entry for
the "night" key to the proper Italian text (e.g., "notte" or "buonanotte") so
the night greeting is localized; locate the "night" key in the translations
object and replace the English value with the chosen Italian translation.
In `@packages/i18n/src/locales/ja/translations.ts`:
- Line 491: The `night` translation is still in English; update the value for
the `night` key in the translations object (symbol: night in translations.ts) to
a proper Japanese string such as "夜" or "おやすみなさい" so it matches the other
localized time-of-day keys; simply replace "night": "night" with "night": "夜"
(or your preferred Japanese phrasing).
In `@packages/i18n/src/locales/ko/translations.ts`:
- Line 485: The translations object contains an English value for the key night
(night: "night") in packages/i18n/src/locales/ko/translations.ts; replace the
English string with the correct Korean localization (e.g., "밤" or the preferred
Korean greeting) so the Korean UI displays a native time-of-day label for the
night key.
In `@packages/i18n/src/locales/pl/translations.ts`:
- Line 491: The Polish locale has the 'night' translation left in English
("night"); update the value for the 'night' key in translations.ts to the
correct Polish string (e.g., "noc" or a suitable greeting) so it matches the
other time-of-day keys like 'morning', 'afternoon', and 'evening' in that file;
locate the 'night' key in the translations.ts dictionary and replace its value
with the Polish translation.
In `@packages/i18n/src/locales/pt-BR/translations.ts`:
- Line 501: The pt-BR translations object currently has night: "night"
(English); update the pt-BR locale entry for the key "night" in
packages/i18n/src/locales/pt-BR/translations.ts to the Brazilian Portuguese term
("noite") so the greeting is properly localized, making sure you modify the
exported translations object (the "night" property) rather than adding a new
key.
In `@packages/i18n/src/locales/ro/translations.ts`:
- Line 498: The translations file currently uses the English string "night" for
the key named night in packages/i18n/src/locales/ro/translations.ts; replace
that placeholder with the proper Romanian translation (e.g., "noapte") for the
night key and ensure the change is saved in the translations.ts export so the
locale bundle contains the correct string; after updating, run the i18n/locales
smoke tests or build step you use to validate translation keys so compilation
and consumers pick up the corrected Romanian value (also review the same night
key in the other locale translation files you own and update them similarly if
they still contain the English placeholder).
In `@packages/i18n/src/locales/tr-TR/translations.ts`:
- Line 493: The Turkish translations object currently has the key 'night' set to
the English string "night"; update the 'night' entry in the translations object
to the correct Turkish greeting (e.g., "iyi geceler") and ensure the value
follows the same quoting/casing style as the surrounding entries so the locale
no longer contains an English fragment.
In `@packages/i18n/src/locales/ua/translations.ts`:
- Line 500: Replace the English placeholder for the translation key 'night' in
translations.ts with the correct Ukrainian word "ночі" so the composed greeting
(e.g., "Доброї ночі") is grammatically correct; update the value for the 'night'
key in the exported translations object accordingly and run a quick UI check for
strings that concatenate with this key to ensure correct case/declension.
In `@packages/i18n/src/locales/vi-VN/translations.ts`:
- Line 498: Replace the English fallback for the translations key "night" in the
translations object with the approved Vietnamese wording; update the entry
night: "night" to night: "đêm" so the vi-VN locale shows the proper Vietnamese
label for the 00:00–04:59 greeting bucket.
In `@packages/i18n/src/locales/zh-CN/translations.ts`:
- Line 480: Replace the English placeholder value for the translations key
"night" in the zh-CN locale by changing night: "night" to night: "晚安" in
packages/i18n/src/locales/zh-CN/translations.ts; then audit the other
non-English locale files (it, zh-TW, tr-TR, ua, vi-VN, sk, pt-BR, ru, pl, ko,
ro, ja, id, es, fr, de, cs) and replace their night: "night" entries with
appropriate localized strings for each language so all non-English locales have
translated text for the "night" label.
In `@packages/i18n/src/locales/zh-TW/translations.ts`:
- Line 479: Replace the English literal for the greeting key night in
translations.ts with a Traditional Chinese string; update the entry night:
"night" to use the zh-TW translation (e.g. night: "深夜好") so that t(greeting)
shows a localized greeting for the 00:00–04:59 bucket.
---
Outside diff comments:
In `@packages/i18n/src/locales/de/translations.ts`:
- Around line 501-505: The German locale currently has incorrect entries for the
greeting keys in translations.ts: change the "good" value from "Guten" to "Gute"
and replace the placeholder "night": "night" with the proper German translation
"night": "Nacht" so concatenation produces "Gute Nacht"; update the same "night"
key in the other 17 locale files (es, fr, it, pt-BR, ja, ko, ru, pl, ro, tr-TR,
sk, ua, vi-VN, zh-CN, zh-TW, cs, id) with their correct translations, locating
the entries by the keys good, morning, afternoon, evening, and night in each
translations.ts to make consistent time-of-day greetings.
In `@packages/i18n/src/locales/es/translations.ts`:
- Around line 501-505: The Spanish translations file left the "night" key
untranslated; change the "night" value from "night" to "noches" and then ensure
gender/number agreement for the composed greeting used by the UI: either add a
specific key like "good_night": "Buenas" or extend the existing "good" key to
provide gendered variants (e.g., good.masc / good.fem) so that when the code
composes greetings (using keys good, morning/afternoon/evening/night) the final
rendered phrase is correct (e.g., "Buenas noches" instead of "Buenos noches");
update the translations in translations.ts accordingly and adjust any consuming
code to use the new key or variant.
In `@packages/i18n/src/locales/fr/translations.ts`:
- Around line 497-501: The 'night' translation key is still English; update the
value for the night key in the translations object (the same object that
contains good, morning, afternoon, evening) to a proper French string—use "nuit"
if the key is used as a noun or "bonne nuit" if it's rendered as a full greeting
(e.g., composed with 'good' resulting in "bonne nuit"); if your UI composes
greetings by concatenating 'good' + ' ' + 'night', prefer setting night="nuit"
and change composition to produce "Bonne nuit" or replace night with "bonne
nuit" and remove concatenation to avoid double words/capitalization issues.
In `@packages/i18n/src/locales/ru/translations.ts`:
- Around line 496-500: The Russian locale currently leaves the "night" key
untranslated ("night"), causing outputs like "Доброго night"; update the
translations in packages/i18n/src/locales/ru/translations.ts so the night
fragment is translated (e.g., change night to "ночи") and, if greetings are
composed from fragments, either (a) provide the correct fragment "ночи" and
adjust plural/grammatical assembly so "Доброй ночи" is formed (change the "good"
fragment to a context-aware form for night if needed) or (b) add a dedicated key
like "goodNight": "Доброй ночи" and ensure the greeting builder uses this
specific key when timeOfDay === "night".
In `@packages/i18n/src/locales/sk/translations.ts`:
- Around line 488-492: The key "night" in the Slovak translations object is
still English ("night"); update the "night" value to the correct Slovak word
(e.g., "noc" or the context-appropriate phrase) alongside the existing keys
(good, morning, afternoon, evening, night) so all greeting parts are localized;
also check where the UI composes greetings from "good" + "night" (or similar
concatenation) and, if needed, replace the composed parts with a single
localized phrase or adjust the "good" and "night" strings so the final rendered
Slovak greeting reads naturally.
---
Nitpick comments:
In `@apps/web/core/components/user/user-greetings.tsx`:
- Around line 25-33: Refactor the userTimezone IIFE into a memoized computation
using React's useMemo so validation only runs when user?.user_timezone changes:
replace the self-invoking function that constructs Intl.DateTimeFormat with a
useMemo hook keyed on user?.user_timezone, keep the same try/catch validation
logic (use new Intl.DateTimeFormat for clarity) and return undefined on invalid
values; ensure the variable name userTimezone remains the same so existing
consumers are unchanged and avoid tying it to currentTime or other
frequently-updating state like useCurrentTime.
- Around line 1-75: The file defines a duplicate component UserGreetingsView
that is unused; remove this dead copy and update exports: delete the duplicate
UserGreetingsView implementation (the unused user variant) and remove its export
from the user barrel (user/index.ts) or point that barrel to the existing home
variant (the single shared UserGreetingsView used by home/root.tsx);
alternatively consolidate by exporting the shared component from one location
and updating any imports to reference that single export so only one
implementation remains.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 62eb9433-0f04-4b53-89e9-f3c0fa466e3a
📒 Files selected for processing (21)
apps/web/core/components/home/user-greetings.tsxapps/web/core/components/user/user-greetings.tsxpackages/i18n/src/locales/cs/translations.tspackages/i18n/src/locales/de/translations.tspackages/i18n/src/locales/en/translations.tspackages/i18n/src/locales/es/translations.tspackages/i18n/src/locales/fr/translations.tspackages/i18n/src/locales/id/translations.tspackages/i18n/src/locales/it/translations.tspackages/i18n/src/locales/ja/translations.tspackages/i18n/src/locales/ko/translations.tspackages/i18n/src/locales/pl/translations.tspackages/i18n/src/locales/pt-BR/translations.tspackages/i18n/src/locales/ro/translations.tspackages/i18n/src/locales/ru/translations.tspackages/i18n/src/locales/sk/translations.tspackages/i18n/src/locales/tr-TR/translations.tspackages/i18n/src/locales/ua/translations.tspackages/i18n/src/locales/vi-VN/translations.tspackages/i18n/src/locales/zh-CN/translations.tspackages/i18n/src/locales/zh-TW/translations.ts
| morning: "pagi", | ||
| afternoon: "siang", | ||
| evening: "malam", | ||
| night: "night", |
There was a problem hiding this comment.
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
# Find all locale translation files and show the `night` key value to spot any that still carry the English literal or are otherwise untranslated.
fd -e ts 'translations\.ts$' packages/i18n/src/locales --exec sh -c 'printf "%s: " "$1"; rg -N "^\s*night:\s*" "$1" || echo "(missing)"' _ {}Repository: makeplane/plane
Length of output: 1289
Untranslated night value in Indonesian and all 18 other non-English locales.
All non-English locale files carry the English literal "night" instead of translations. This is a systematic i18n defect affecting 18 locale files (id, zh-CN, vi-VN, zh-TW, tr-TR, sk, ro, ua, pt-BR, it, ja, fr, es, ko, ru, de, cs, pl).
For Indonesian (id), since the evening bucket already maps to "malam" and hours 0–4 require translation, "dini hari" (early morning hours) is semantically appropriate:
Suggested fix for Indonesian
- night: "night",
+ night: "dini hari",All 18 non-English locales require equivalent translations for the night key corresponding to the 00:00–04:59 time range.
📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| night: "night", | |
| night: "dini hari", |
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@packages/i18n/src/locales/id/translations.ts` at line 497, The translations
file contains an untranslated "night" key (e.g., in
packages/i18n/src/locales/id/translations.ts the entry night: "night") — replace
the English literal with the appropriate Indonesian string ("dini hari") and
ensure the semantic bucket for 00:00–04:59 is correct (note evening already maps
to "malam"); repeat the same fix across the other non-English locale files
listed (zh-CN, vi-VN, zh-TW, tr-TR, sk, ro, ua, pt-BR, it, ja, fr, es, ko, ru,
de, cs, pl) by replacing their "night" values with the correct localized
translations for the 00:00–04:59 time range while keeping the key name night
unchanged.
| morning: "sabah", | ||
| afternoon: "öğleden sonra", | ||
| evening: "akşam", | ||
| night: "night", |
There was a problem hiding this comment.
Localize the new Turkish night greeting.
This leaves the Turkish locale with an English greeting fragment.
🌐 Proposed localization fix
- night: "night",
+ night: "gece",📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| night: "night", | |
| night: "gece", |
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@packages/i18n/src/locales/tr-TR/translations.ts` at line 493, The Turkish
translations object currently has the key 'night' set to the English string
"night"; update the 'night' entry in the translations object to the correct
Turkish greeting (e.g., "iyi geceler") and ensure the value follows the same
quoting/casing style as the surrounding entries so the locale no longer contains
an English fragment.
| morning: "Buổi sáng", | ||
| afternoon: "Buổi chiều", | ||
| evening: "Buổi tối", | ||
| night: "night", |
There was a problem hiding this comment.
Localize the new night label.
The vi-VN locale should not fall back to the English word night for the new 00:00–04:59 greeting bucket. Please use the approved Vietnamese wording.
🌐 Example fix
- night: "night",
+ night: "Buổi đêm",📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| night: "night", | |
| night: "Buổi đêm", |
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@packages/i18n/src/locales/vi-VN/translations.ts` at line 498, Replace the
English fallback for the translations key "night" in the translations object
with the approved Vietnamese wording; update the entry night: "night" to night:
"đêm" so the vi-VN locale shows the proper Vietnamese label for the 00:00–04:59
greeting bucket.
| morning: "早上", | ||
| afternoon: "下午", | ||
| evening: "晚上", | ||
| night: "night", |
There was a problem hiding this comment.
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
# Description: Find locale files where the new night greeting still uses the English placeholder.
# Expected: Only English locale files, if any, should contain night: "night".
rg -n --glob 'translations.ts' 'night:\s*"night"' packages/i18n/src/localesRepository: makeplane/plane
Length of output: 1346
Localize the new night label and address this across all non-English locales.
The Chinese locale (and 17 other non-English locale files) still use the English placeholder "night" instead of localized text. For zh-CN, replace it with "晚安" (or another approved Chinese term). Verify that all non-English locale files have proper translations:
- it, zh-TW, zh-CN, tr-TR, ua, vi-VN, sk, pt-BR, ru, pl, ko, ro, ja, id, es, fr, de, cs (all currently contain
night: "night")
Example fix for zh-CN
- night: "night",
+ night: "晚安",📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| night: "night", | |
| night: "晚安", |
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@packages/i18n/src/locales/zh-CN/translations.ts` at line 480, Replace the
English placeholder value for the translations key "night" in the zh-CN locale
by changing night: "night" to night: "晚安" in
packages/i18n/src/locales/zh-CN/translations.ts; then audit the other
non-English locale files (it, zh-TW, tr-TR, ua, vi-VN, sk, pt-BR, ru, pl, ko,
ro, ja, id, es, fr, de, cs) and replace their night: "night" entries with
appropriate localized strings for each language so all non-English locales have
translated text for the "night" label.
… translations Replace hour12: false with hourCycle: "h23" on hour and timeString formatters so midnight returns "0" instead of "24" in Chromium-based browsers (h24 cycle). This prevented the night greeting from firing at 00:00. Also adds proper localized translations for the night key across all 18 non-English locales instead of the English placeholder. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@apps/web/core/components/home/user-greetings.tsx`:
- Around line 60-65: The current composition {t("good")} {t(greeting)} produces
wrong phrase-level translations for the new "night" bucket; change to use a
single phrase-level translation key per bucket (e.g., derive greetingKey =
`greetings.${greeting}` from the existing greeting variable) and replace the JSX
to call t(greetingKey, { first_name: user?.first_name, last_name:
user?.last_name }) or otherwise pass the name into the locale template; update
the locale files to add greetings.night (and ensure morning/afternoon/evening
keys exist) so translations render correctly for {t(greetingKey)} instead of
composing two separate t() calls.
- Around line 25-33: Replace the current IIFE that computes userTimezone with a
memoized computation keyed on user.user_timezone (e.g., useMemo(() => { ... },
[user?.user_timezone])) so validation doesn’t run on every render; inside the
memo, attempt Intl.DateTimeFormat(undefined, { timeZone: user.user_timezone })
inside a try-catch that captures the error as unknown, narrow it to Error (or
stringify) and log a single diagnostic (e.g., console.warn or project logger)
including the invalid timezone and the error message, then return undefined on
failure; reference the symbol userTimezone and the property user.user_timezone
when making these changes.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: d0a72437-f268-4d9f-90fa-f7ec13ae7dd2
📒 Files selected for processing (20)
apps/web/core/components/home/user-greetings.tsxapps/web/core/components/user/user-greetings.tsxpackages/i18n/src/locales/cs/translations.tspackages/i18n/src/locales/de/translations.tspackages/i18n/src/locales/es/translations.tspackages/i18n/src/locales/fr/translations.tspackages/i18n/src/locales/id/translations.tspackages/i18n/src/locales/it/translations.tspackages/i18n/src/locales/ja/translations.tspackages/i18n/src/locales/ko/translations.tspackages/i18n/src/locales/pl/translations.tspackages/i18n/src/locales/pt-BR/translations.tspackages/i18n/src/locales/ro/translations.tspackages/i18n/src/locales/ru/translations.tspackages/i18n/src/locales/sk/translations.tspackages/i18n/src/locales/tr-TR/translations.tspackages/i18n/src/locales/ua/translations.tspackages/i18n/src/locales/vi-VN/translations.tspackages/i18n/src/locales/zh-CN/translations.tspackages/i18n/src/locales/zh-TW/translations.ts
✅ Files skipped from review due to trivial changes (8)
- packages/i18n/src/locales/de/translations.ts
- packages/i18n/src/locales/es/translations.ts
- packages/i18n/src/locales/tr-TR/translations.ts
- packages/i18n/src/locales/ja/translations.ts
- packages/i18n/src/locales/ua/translations.ts
- packages/i18n/src/locales/pl/translations.ts
- packages/i18n/src/locales/fr/translations.ts
- packages/i18n/src/locales/vi-VN/translations.ts
🚧 Files skipped from review as they are similar to previous changes (8)
- packages/i18n/src/locales/zh-CN/translations.ts
- apps/web/core/components/user/user-greetings.tsx
- packages/i18n/src/locales/zh-TW/translations.ts
- packages/i18n/src/locales/pt-BR/translations.ts
- packages/i18n/src/locales/sk/translations.ts
- packages/i18n/src/locales/ko/translations.ts
- packages/i18n/src/locales/ru/translations.ts
- packages/i18n/src/locales/ro/translations.ts
Replaced IIFE with useMemo keyed on user_timezone so the validation runs once per timezone change rather than on every render tick. Also adds console.warn when an invalid timezone is detected so it is diagnosable rather than silently discarded. Fixed missing `new` keyword on Intl.DateTimeFormat validation call. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
There was a problem hiding this comment.
♻️ Duplicate comments (2)
apps/web/core/components/home/user-greetings.tsx (1)
67-67:⚠️ Potential issue | 🟡 MinorSame i18n composition issue as in
core/components/user/user-greetings.tsx.
{t("good")} {t(greeting)}with the newnightkey yields incorrect phrases in multiple locales (CzechDobrý noc, ItalianBuono notte, IndonesianBagus dini hari, etc.) because the noun doesn't agree with the genericgoodadjective form chosen for morning/afternoon/evening. Switch to one phrase-level translation key per bucket (e.g.,greetings.night) and rendert(\greetings.${greeting}`)` so locales can provide natural full greetings.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@apps/web/core/components/home/user-greetings.tsx` at line 67, The current composition "{t('good')} {t(greeting)}" in the UserGreetings component produces ungrammatical translations; replace the two-part call with a single phrase-level key lookup so locales can supply full greetings: change the render to call t(`greetings.${greeting}`) instead of t("good") and t(greeting), update the i18n resource keys (add greetings.morning, greetings.afternoon, greetings.evening, greetings.night as needed) and ensure the component (user-greetings.tsx / the UserGreetings render) passes the bucket identifier in `greeting` unchanged so t(`greetings.${greeting}`) resolves correctly.apps/web/core/components/user/user-greetings.tsx (1)
67-67:⚠️ Potential issue | 🟡 MinorComposed
{t("good")} {t("night")}still produces grammatically incorrect greetings in several locales.The
hourCycle: "h23"fix and memoized timezone validation look good, but the two-token composition remains problematic for the newnightbucket: e.g. CzechDobrý noc(should beDobrou noc), ItalianBuono notte(should beBuona notte), IndonesianBagus dini hari. The existing morning/afternoon/evening translations were chosen to fit thegood <x>template, butnightdoesn't agree in gender/case across many locales.Prefer a single phrase-level key per bucket (e.g.,
greetings.morning…greetings.night) and rendert(\greetings.${greeting}`)` so each locale can provide a natural full phrase.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@apps/web/core/components/user/user-greetings.tsx` at line 67, The composed two-token translation using t("good") + t(greeting) produces ungrammatical phrases in some locales; update the rendering in user-greetings.tsx to use a single phrase-level key instead (replace the current {t("good")} {t(greeting)} usage with t(`greetings.${greeting}`) where greeting is the computed bucket), and ensure all locale files provide greetings.morning / greetings.afternoon / greetings.evening / greetings.night entries (with sensible fallbacks if a key is missing) so each locale can supply a grammatically correct full phrase.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Duplicate comments:
In `@apps/web/core/components/home/user-greetings.tsx`:
- Line 67: The current composition "{t('good')} {t(greeting)}" in the
UserGreetings component produces ungrammatical translations; replace the
two-part call with a single phrase-level key lookup so locales can supply full
greetings: change the render to call t(`greetings.${greeting}`) instead of
t("good") and t(greeting), update the i18n resource keys (add greetings.morning,
greetings.afternoon, greetings.evening, greetings.night as needed) and ensure
the component (user-greetings.tsx / the UserGreetings render) passes the bucket
identifier in `greeting` unchanged so t(`greetings.${greeting}`) resolves
correctly.
In `@apps/web/core/components/user/user-greetings.tsx`:
- Line 67: The composed two-token translation using t("good") + t(greeting)
produces ungrammatical phrases in some locales; update the rendering in
user-greetings.tsx to use a single phrase-level key instead (replace the current
{t("good")} {t(greeting)} usage with t(`greetings.${greeting}`) where greeting
is the computed bucket), and ensure all locale files provide greetings.morning /
greetings.afternoon / greetings.evening / greetings.night entries (with sensible
fallbacks if a key is missing) so each locale can supply a grammatically correct
full phrase.
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 46498e70-fecd-4bdc-9289-bff316b49de4
📒 Files selected for processing (2)
apps/web/core/components/home/user-greetings.tsxapps/web/core/components/user/user-greetings.tsx
Replaces {t("good")} {t(greeting)}, {name} composition with a single
t("greetings.<bucket>", { first_name, last_name }) call. Fragment
composition was grammatically incorrect in many locales — e.g. Russian
"Доброго ночи" instead of "Доброй ночи", German "Guten Nacht" instead
of "Gute Nacht", Czech "Dobrý noc" instead of "Dobrou noc".
Adds greetings.{morning,afternoon,evening,night} nested keys with
proper full-phrase translations across all 19 locale files.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
There was a problem hiding this comment.
🧹 Nitpick comments (1)
apps/web/core/components/home/user-greetings.tsx (1)
26-62: Consider extracting the shared greeting/timezone derivation.This timezone validation,
Intl.DateTimeFormatsetup, and daypart bucketing is duplicated inapps/web/core/components/user/user-greetings.tsx. A small shared hook/helper would reduce future drift—the PR already had to fix this bug twice.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@apps/web/core/components/home/user-greetings.tsx` around lines 26 - 62, Extract the duplicated timezone validation, DateTimeFormat setup and greeting bucketing into a shared hook (e.g., useUserLocalTime) and replace the inline logic in both UserGreetings components: move the userTimezone useMemo logic (the Intl.DateTimeFormat validation using user?.user_timezone), the DateTimeFormat calls that produce hour, date, weekDay, timeString, and the greeting calculation (parseInt(hour, 10) -> greeting) into that hook; have the hook accept (user, currentTime) and return {userTimezone, timeString, date, weekDay, hourNum, greeting}, update both components to call useUserLocalTime(...) and use the returned values, and ensure the hook preserves the same fallback behavior and error logging when user_timezone is invalid.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In `@apps/web/core/components/home/user-greetings.tsx`:
- Around line 26-62: Extract the duplicated timezone validation, DateTimeFormat
setup and greeting bucketing into a shared hook (e.g., useUserLocalTime) and
replace the inline logic in both UserGreetings components: move the userTimezone
useMemo logic (the Intl.DateTimeFormat validation using user?.user_timezone),
the DateTimeFormat calls that produce hour, date, weekDay, timeString, and the
greeting calculation (parseInt(hour, 10) -> greeting) into that hook; have the
hook accept (user, currentTime) and return {userTimezone, timeString, date,
weekDay, hourNum, greeting}, update both components to call
useUserLocalTime(...) and use the returned values, and ensure the hook preserves
the same fallback behavior and error logging when user_timezone is invalid.
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 3bdd5dd5-a2ca-45ac-b15d-bc3fd894e7d9
📒 Files selected for processing (21)
apps/web/core/components/home/user-greetings.tsxapps/web/core/components/user/user-greetings.tsxpackages/i18n/src/locales/cs/translations.tspackages/i18n/src/locales/de/translations.tspackages/i18n/src/locales/en/translations.tspackages/i18n/src/locales/es/translations.tspackages/i18n/src/locales/fr/translations.tspackages/i18n/src/locales/id/translations.tspackages/i18n/src/locales/it/translations.tspackages/i18n/src/locales/ja/translations.tspackages/i18n/src/locales/ko/translations.tspackages/i18n/src/locales/pl/translations.tspackages/i18n/src/locales/pt-BR/translations.tspackages/i18n/src/locales/ro/translations.tspackages/i18n/src/locales/ru/translations.tspackages/i18n/src/locales/sk/translations.tspackages/i18n/src/locales/tr-TR/translations.tspackages/i18n/src/locales/ua/translations.tspackages/i18n/src/locales/vi-VN/translations.tspackages/i18n/src/locales/zh-CN/translations.tspackages/i18n/src/locales/zh-TW/translations.ts
✅ Files skipped from review due to trivial changes (2)
- packages/i18n/src/locales/cs/translations.ts
- packages/i18n/src/locales/tr-TR/translations.ts
🚧 Files skipped from review as they are similar to previous changes (12)
- packages/i18n/src/locales/ro/translations.ts
- packages/i18n/src/locales/de/translations.ts
- packages/i18n/src/locales/pl/translations.ts
- packages/i18n/src/locales/ja/translations.ts
- packages/i18n/src/locales/ko/translations.ts
- packages/i18n/src/locales/es/translations.ts
- packages/i18n/src/locales/ua/translations.ts
- packages/i18n/src/locales/pt-BR/translations.ts
- packages/i18n/src/locales/fr/translations.ts
- packages/i18n/src/locales/id/translations.ts
- packages/i18n/src/locales/ru/translations.ts
- packages/i18n/src/locales/sk/translations.ts
|
Hey @MinitJain, thanks for fixing this bug! 🙌 I do have a small piece of feedback though- using “Good night” as a greeting might not be ideal since it’s usually used as a farewell rather than a greeting. Let’s simplify the greetings to the following time ranges:
|
Per maintainer feedback, "Good night" is a farewell not a greeting. Simplifies to three buckets: morning (5-11), afternoon (12-16), evening (17-4). Extracts duplicated timezone validation, Intl formatting, and daypart logic into a shared useGreeting hook to eliminate future drift between the two identical components. Removes greetings.night key from all 19 locale files. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
Hey @aaryan610, thanks for the review : ) |
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (5)
packages/i18n/src/locales/ru/translations.ts (1)
500-505: Remove the stale top-levelnightentry if the hook is three-bucket only.
greetingsnow contains onlymorning,afternoon, andevening, so keepingnightat the top level leaves this locale schema out of sync with the current greeting behavior.♻️ Proposed cleanup
- night: "ночи", greetings: { morning: "Доброе утро, {first_name} {last_name}", afternoon: "Добрый день, {first_name} {last_name}",🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@packages/i18n/src/locales/ru/translations.ts` around lines 500 - 505, Remove the stale top-level "night" translation entry from the translations object so the locale schema matches the three-bucket greeting behavior; locate the "night" key (top-level) and delete it, leaving only the nested greetings object with "morning", "afternoon", and "evening" keys (references: "night" and "greetings" in translations.ts).packages/i18n/src/locales/fr/translations.ts (1)
501-506: Keep the locale keys consistent with the simplified greeting model.Since
greetingsno longer includes anighttemplate, the top-levelnightkey should be removed if the app no longer emits anightgreeting bucket.♻️ Proposed cleanup
- night: "nuit", greetings: { morning: "Bonjour, {first_name} {last_name}", afternoon: "Bon après-midi, {first_name} {last_name}",🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@packages/i18n/src/locales/fr/translations.ts` around lines 501 - 506, The translations object contains a top-level "night" key that is inconsistent with the simplified greetings model which now nests templates under "greetings"; remove the standalone "night" key from this file so only the "greetings" object (with morning, afternoon, evening templates) defines greeting text, ensuring any code referencing greetings uses greetings.morning/afternoon/evening rather than a top-level night symbol.packages/i18n/src/locales/tr-TR/translations.ts (1)
493-498: Remove the stalenightkey from the three-bucket locale shape.The current greeting flow no longer has a
nightbucket, whilegreetingscorrectly only definesmorning,afternoon, andevening. Keepingnighthere leaves an unused fourth bucket and can drift from the intended locale schema.♻️ Proposed cleanup
- night: "gece", greetings: { morning: "Günaydın, {first_name} {last_name}", afternoon: "İyi günler, {first_name} {last_name}", evening: "İyi akşamlar, {first_name} {last_name}",🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@packages/i18n/src/locales/tr-TR/translations.ts` around lines 493 - 498, Remove the stale top-level "night" key from the translations export in translations.ts so the locale shape matches the three-bucket greetings structure; locate the "night" identifier near the "greetings" object (which already defines morning, afternoon, evening) and delete that "night" entry to avoid the unused fourth bucket.packages/i18n/src/locales/ko/translations.ts (1)
485-485: Remove the stalenightkey if the three-bucket scheme is final.The Korean value is localized now, but
useGreetingcannot returnnight, so this added key is dead translation data under the current contract.Suggested cleanup
- night: "밤",🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@packages/i18n/src/locales/ko/translations.ts` at line 485, Remove the stale "night" translation entry from the Korean translations object because useGreeting() never returns "night" under the finalized three-bucket scheme; locate the "night" key in translations.ts and delete that key/value pair, and then run a quick search for "night" and for the translations key reference to ensure there are no remaining usages or tests expecting that identifier (update any test fixtures if needed).packages/i18n/src/locales/id/translations.ts (1)
497-497: Remove the stalenightkey if the three-bucket scheme is final.
useGreetingnow returns only"morning" | "afternoon" | "evening", so this new top-levelnightlabel is no longer consumed and leaves the locale shape inconsistent with the finalized behavior.Suggested cleanup
- night: "dini hari",🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@packages/i18n/src/locales/id/translations.ts` at line 497, The locale file contains a stale top-level label "night" that is no longer used because useGreeting() only returns "morning" | "afternoon" | "evening"; remove the "night" entry from translations.ts (the line night: "dini hari",) so the Indonesian locale shape matches the finalized three-bucket scheme and update any related locale type/checks if necessary to avoid unused-key warnings.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@packages/i18n/src/locales/vi-VN/translations.ts`:
- Around line 498-503: Remove the stale top-level translation key "night" from
the translations object (the unused symbol night) so only the greetings object
with keys morning/afternoon/evening remains; locate the translations.ts file and
delete the line defining night: "Buổi đêm" (leaving greetings: { morning,
afternoon, evening } intact), and then apply the same removal across other
locale translation files to keep them consistent.
---
Nitpick comments:
In `@packages/i18n/src/locales/fr/translations.ts`:
- Around line 501-506: The translations object contains a top-level "night" key
that is inconsistent with the simplified greetings model which now nests
templates under "greetings"; remove the standalone "night" key from this file so
only the "greetings" object (with morning, afternoon, evening templates) defines
greeting text, ensuring any code referencing greetings uses
greetings.morning/afternoon/evening rather than a top-level night symbol.
In `@packages/i18n/src/locales/id/translations.ts`:
- Line 497: The locale file contains a stale top-level label "night" that is no
longer used because useGreeting() only returns "morning" | "afternoon" |
"evening"; remove the "night" entry from translations.ts (the line night: "dini
hari",) so the Indonesian locale shape matches the finalized three-bucket scheme
and update any related locale type/checks if necessary to avoid unused-key
warnings.
In `@packages/i18n/src/locales/ko/translations.ts`:
- Line 485: Remove the stale "night" translation entry from the Korean
translations object because useGreeting() never returns "night" under the
finalized three-bucket scheme; locate the "night" key in translations.ts and
delete that key/value pair, and then run a quick search for "night" and for the
translations key reference to ensure there are no remaining usages or tests
expecting that identifier (update any test fixtures if needed).
In `@packages/i18n/src/locales/ru/translations.ts`:
- Around line 500-505: Remove the stale top-level "night" translation entry from
the translations object so the locale schema matches the three-bucket greeting
behavior; locate the "night" key (top-level) and delete it, leaving only the
nested greetings object with "morning", "afternoon", and "evening" keys
(references: "night" and "greetings" in translations.ts).
In `@packages/i18n/src/locales/tr-TR/translations.ts`:
- Around line 493-498: Remove the stale top-level "night" key from the
translations export in translations.ts so the locale shape matches the
three-bucket greetings structure; locate the "night" identifier near the
"greetings" object (which already defines morning, afternoon, evening) and
delete that "night" entry to avoid the unused fourth bucket.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 1fbb7e69-40e8-482f-8120-6f1c779a7d33
📒 Files selected for processing (22)
apps/web/core/components/home/user-greetings.tsxapps/web/core/components/user/user-greetings.tsxapps/web/core/hooks/use-greeting.tspackages/i18n/src/locales/cs/translations.tspackages/i18n/src/locales/de/translations.tspackages/i18n/src/locales/en/translations.tspackages/i18n/src/locales/es/translations.tspackages/i18n/src/locales/fr/translations.tspackages/i18n/src/locales/id/translations.tspackages/i18n/src/locales/it/translations.tspackages/i18n/src/locales/ja/translations.tspackages/i18n/src/locales/ko/translations.tspackages/i18n/src/locales/pl/translations.tspackages/i18n/src/locales/pt-BR/translations.tspackages/i18n/src/locales/ro/translations.tspackages/i18n/src/locales/ru/translations.tspackages/i18n/src/locales/sk/translations.tspackages/i18n/src/locales/tr-TR/translations.tspackages/i18n/src/locales/ua/translations.tspackages/i18n/src/locales/vi-VN/translations.tspackages/i18n/src/locales/zh-CN/translations.tspackages/i18n/src/locales/zh-TW/translations.ts
✅ Files skipped from review due to trivial changes (1)
- packages/i18n/src/locales/es/translations.ts
🚧 Files skipped from review as they are similar to previous changes (12)
- apps/web/core/components/home/user-greetings.tsx
- apps/web/core/components/user/user-greetings.tsx
- packages/i18n/src/locales/pl/translations.ts
- packages/i18n/src/locales/ja/translations.ts
- packages/i18n/src/locales/pt-BR/translations.ts
- packages/i18n/src/locales/en/translations.ts
- packages/i18n/src/locales/zh-TW/translations.ts
- packages/i18n/src/locales/de/translations.ts
- packages/i18n/src/locales/cs/translations.ts
- packages/i18n/src/locales/ua/translations.ts
- packages/i18n/src/locales/ro/translations.ts
- packages/i18n/src/locales/sk/translations.ts
…rom screen readers - Memoize all four Intl.DateTimeFormat instances on userTimezone so formatter objects are only recreated when the timezone changes, not on every 60-second render tick - Add aria-hidden="true" to the decorative emoji <div> in both UserGreetingsView components so screen readers skip it Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
The top-level night: key was never referenced in app code.
Only the greetings.{morning,afternoon,evening} nested keys are used.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
Hey @sriramveeraghanta |
|
The PR fixes a timezone mismatch bug on the greeting component where the greeting text |
|
@MinitJain Your changes looks good to me but the problem is |
…zone Greeting should reflect where the user physically is, not the timezone they configured in Plane settings. Removed userTimezone from all Intl.DateTimeFormat calls so formatters fall back to browser locale.
|
Hey @sriramveeraghanta I have removed the user_timezone from all Intl.DateTimeFormat calls in useGreeting. Also dropped the userTimezone validation logic since it's no longer needed. |
Description
The home page greeting component had two bugs:
Timezone mismatch:
hour(used to determine greeting text) was computed using the browser's local timezone, whiletimeString(displayed time) useduser.user_timezonefrom the profile. These two could differ, producing a greeting like "Good morning" while showing 19:38.Missing night bucket:
hour < 12classified all midnight-to-noon hours as "morning", so users at 1 AM, 2 AM, 3 AM would see "Good morning".Root cause in one line: the displayed time and greeting logic were reading time from two different clocks.
Fix:
Intl.DateTimeFormatcalls now usetimeZone: userTimezoneconsistentlyuser_timezoneis an invalid IANA string, falls back to browser local time instead of throwingRangeErrorand crashing the componentnighti18n key to all 19 locale filesGreeting thresholds:
Both
apps/web/core/components/home/user-greetings.tsxandapps/web/core/components/user/user-greetings.tsxhad identical bugs and were fixed identically.Type of Change
Screenshots and Media
Test Scenarios
America/New_Yorkwhile in IST), verify greeting and time both use New York timeReferences
Summary by CodeRabbit
New Features
Bug Fixes
Localization