Remove home greeting and date block (Task #60)

Per user request, the home page no longer shows the time-of-day greeting
("مساء الخير، {name}") nor the day-name + Gregorian date subtitle. The
apps grid (and the admin stats row when applicable) now sits directly
under the top bar.

Changes (artifacts/teaboy-os/src/pages/home.tsx):
- Removed the entire greeting block (the wrapper div, the <h1> greeting
  and the date <p>) from the Main Content section.
- Removed the now-unused `dayName`, `gregorianDate` and `greeting`
  locals plus the `formatWeekday` and `greetingKey` imports.
- Kept `displayName` (still used in the avatar header) and the
  `home.greeting.*` translation keys (left in place; cheap to keep and
  avoids touching unrelated locale files).

Mid-task fix:
- First pass also dropped `displayName` which broke the avatar
  (`displayName is not defined`). Restored it; `displayName` is needed
  by the user-card initials and name labels.

Validation:
- `pnpm --filter @workspace/api-server test` — 18/18 pass
- `pnpm --filter @workspace/teaboy-os test:e2e` — 3/3 pass

Notes:
- Pre-existing TypeScript errors in admin.tsx / clock-style-picker.tsx /
  clock.tsx are unrelated to this task (codegen drift from earlier
  tasks).
This commit is contained in:
Riyadh
2026-04-21 17:37:46 +00:00
parent 49f4ab4dbb
commit 13b067166f
-19
View File
@@ -50,9 +50,7 @@ import { CSS } from "@dnd-kit/utilities";
import {
formatDate,
formatTime,
formatWeekday,
formatNumber,
greetingKey,
} from "@/lib/i18n-format";
import {
Clock,
@@ -403,9 +401,6 @@ export default function HomePage() {
setLocation(app.route);
};
const dayName = formatWeekday(time, lang);
const gregorianDate = formatDate(time, lang);
const unreadCount = notifications?.filter((n) => !n.isRead).length ?? stats?.unreadNotifications ?? 0;
const displayName = lang === "ar"
@@ -414,8 +409,6 @@ export default function HomePage() {
const isAdmin = user?.roles?.includes("admin") ?? false;
const greeting = t(`home.greeting.${greetingKey(time)}`, { name: displayName });
const handleLogout = () => {
logout.mutate(undefined, {
onSuccess: () => {
@@ -500,18 +493,6 @@ export default function HomePage() {
{/* Main Content */}
<div className="flex-1 px-5 sm:px-8 pt-6 pb-32 overflow-y-auto">
{/* Greeting + optional analog clock widget */}
<div className="mb-8">
<div className="max-w-3xl min-w-0">
<h1 className="text-2xl sm:text-3xl font-bold text-foreground tracking-tight">
{greeting}
</h1>
<p className="text-sm text-muted-foreground mt-1">
{dayName} · <span className="tabular-nums">{gregorianDate}</span>
</p>
</div>
</div>
{/* Stats Row — admin only */}
{isAdmin && stats && (
<div className="grid grid-cols-2 sm:grid-cols-4 gap-3 mb-8 max-w-4xl">