[PR #2544] [MERGED] feat(home): rotate greetings from a deterministic per-user daily pool #8353

Closed
opened 2026-04-20 18:10:08 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/go-vikunja/vikunja/pull/2544
Author: @tink-bot
Created: 4/5/2026
Status: Merged
Merged: 4/5/2026
Merged by: @kolaente

Base: mainHead: feat-rotating-home-greetings


📝 Commits (5)

  • 81bf126 feat(helpers): add deterministic stringHash for stable daily selection
  • 66adfaa i18n: add rotating home greeting variants
  • cd0c090 feat(home): rotate greetings from a deterministic per-user daily pool
  • ad9b0c9 test(e2e): relax home greeting assertions for rotating pool
  • 0ff9933 docs(helpers): explain djb2 seed constant in stringHash

📊 Changes

8 files changed (+268 additions, -16 deletions)

View changed files

frontend/src/composables/useDaytimeSalutation.test.ts (+122 -0)
📝 frontend/src/composables/useDaytimeSalutation.ts (+82 -13)
frontend/src/helpers/stringHash.test.ts (+21 -0)
frontend/src/helpers/stringHash.ts (+13 -0)
📝 frontend/src/i18n/lang/en.json (+27 -0)
📝 frontend/tests/e2e/user/login.spec.ts (+1 -1)
📝 frontend/tests/e2e/user/openid-login.spec.ts (+1 -1)
📝 frontend/tests/e2e/user/registration.spec.ts (+1 -1)

📄 Description

The Home view showed a single fixed greeting per daytime bucket, so logged-in users saw the same wording every day. This replaces it with a rotating pool of variants per bucket plus weekday-specific extras for mornings, selected deterministically from date + userKey + bucket so the greeting is stable within a day but varies across days and users.

  • Adds a tiny stringHash helper (djb2) used as the stable selection key.
  • Extends en.json with 28 new greeting variants; existing keys are kept as the first entry of each pool so prior translations remain valid.
  • Rewrites useDaytimeSalutation to pick from these pools, accepting an optional Ref<Date> so tests can inject a fixed time.

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/go-vikunja/vikunja/pull/2544 **Author:** [@tink-bot](https://github.com/tink-bot) **Created:** 4/5/2026 **Status:** ✅ Merged **Merged:** 4/5/2026 **Merged by:** [@kolaente](https://github.com/kolaente) **Base:** `main` ← **Head:** `feat-rotating-home-greetings` --- ### 📝 Commits (5) - [`81bf126`](https://github.com/go-vikunja/vikunja/commit/81bf126b98b77f0395c18be91a6e78022dad8db7) feat(helpers): add deterministic stringHash for stable daily selection - [`66adfaa`](https://github.com/go-vikunja/vikunja/commit/66adfaa9b63b8bbfc1f485f3954351daa1999009) i18n: add rotating home greeting variants - [`cd0c090`](https://github.com/go-vikunja/vikunja/commit/cd0c090fe86dc48b474001bebce742bb1287a313) feat(home): rotate greetings from a deterministic per-user daily pool - [`ad9b0c9`](https://github.com/go-vikunja/vikunja/commit/ad9b0c943c0c66ba23781e0e83e024d245a09673) test(e2e): relax home greeting assertions for rotating pool - [`0ff9933`](https://github.com/go-vikunja/vikunja/commit/0ff9933f04cd5e5e3d66ccf038f7481e3dfb67b3) docs(helpers): explain djb2 seed constant in stringHash ### 📊 Changes **8 files changed** (+268 additions, -16 deletions) <details> <summary>View changed files</summary> ➕ `frontend/src/composables/useDaytimeSalutation.test.ts` (+122 -0) 📝 `frontend/src/composables/useDaytimeSalutation.ts` (+82 -13) ➕ `frontend/src/helpers/stringHash.test.ts` (+21 -0) ➕ `frontend/src/helpers/stringHash.ts` (+13 -0) 📝 `frontend/src/i18n/lang/en.json` (+27 -0) 📝 `frontend/tests/e2e/user/login.spec.ts` (+1 -1) 📝 `frontend/tests/e2e/user/openid-login.spec.ts` (+1 -1) 📝 `frontend/tests/e2e/user/registration.spec.ts` (+1 -1) </details> ### 📄 Description The Home view showed a single fixed greeting per daytime bucket, so logged-in users saw the same wording every day. This replaces it with a rotating pool of variants per bucket plus weekday-specific extras for mornings, selected deterministically from `date + userKey + bucket` so the greeting is stable within a day but varies across days and users. - Adds a tiny `stringHash` helper (djb2) used as the stable selection key. - Extends `en.json` with 28 new greeting variants; existing keys are kept as the first entry of each pool so prior translations remain valid. - Rewrites `useDaytimeSalutation` to pick from these pools, accepting an optional `Ref<Date>` so tests can inject a fixed time. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the pull-request label 2026-04-20 18:10:08 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/vikunja#8353