frontend: UI fixes + settings/patients features

- Record history: replace fragile COSS Timeline separator math with a
  continuous-rail list so every audited change renders in full (RTL-safe).
- Prescriptions: new reusable COSS DatePicker (Popover + Calendar) replaces
  raw <input type="date"> for Start/End date.
- Update banner: rebuilt with COSS Alert variant="warning"; pinned physical
  bottom-right so it stays bottom-right under Arabic RTL.
- AI setup notice: thin attached warning banner with clearer copy; now shown
  above the input in active chats too, not just the empty state.
- Settings profile: wire the previously dead Specialty (Select) and
  Professional links (editable rows) into the persisted preferences.
- Patients: add a status filter and broaden search to conditions/allergies.
- Sidebar user menu: quick language switch submenu (RTL already wired).
- ai-elements: fix a subset of Base UI type drift (22 -> 12; remainder is
  cmdk->Autocomplete migration drift kept behind ignoreBuildErrors).
- i18n: new keys added across all five locales (en/de/fr/ar/so).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
Khalid Abdi
2026-07-12 21:06:38 +03:00
parent bffed5525d
commit 2c239fbd27
20 changed files with 455 additions and 133 deletions
+31 -21
View File
@@ -1,10 +1,12 @@
"use client";
import Link from "next/link";
import { X } from "lucide-react";
import { ArrowUpCircle, X } from "lucide-react";
import { useEffect, useState } from "react";
import { useTranslation } from "react-i18next";
import { Alert, AlertAction, AlertTitle } from "@/components/ui/alert";
import { Button } from "@/components/ui/button";
import { getVersionInfo } from "@/lib/version";
const DISMISS_KEY = "temetro:update-dismissed";
@@ -39,28 +41,36 @@ export function UpdateBanner() {
setLatest(null);
};
// Pinned to the physical bottom-right in both LTR and RTL. The user wants it
// in the bottom-right corner in Arabic too, so we use physical `right`/`bottom`
// rather than the logical `end` (which would flip to the left under RTL).
return (
<div className="fixed end-4 bottom-4 z-50 flex max-w-sm items-start gap-3 rounded-2xl border border-border bg-card px-4 py-3 shadow-lg">
<div className="space-y-1.5">
<p className="text-sm text-foreground">
<div className="fixed right-4 bottom-4 z-50 w-full max-w-sm" dir="auto">
<Alert className="bg-card shadow-lg" variant="warning">
<ArrowUpCircle />
<AlertTitle className="text-foreground">
{t("settings.version.banner", { version: latest })}
</p>
<Link
className="text-sm font-medium text-primary underline-offset-4 hover:underline"
href="/settings?tab=version"
onClick={dismiss}
>
{t("settings.version.bannerUpdate")}
</Link>
</div>
<button
aria-label={t("settings.version.bannerDismiss")}
className="-me-1 shrink-0 rounded-lg p-1 text-muted-foreground transition-colors hover:bg-accent hover:text-foreground"
onClick={dismiss}
type="button"
>
<X className="size-4" />
</button>
</AlertTitle>
<AlertAction>
<Button
render={
<Link href="/settings?tab=version" onClick={dismiss} />
}
size="sm"
variant="outline"
>
{t("settings.version.bannerUpdate")}
</Button>
<Button
aria-label={t("settings.version.bannerDismiss")}
onClick={dismiss}
size="icon-sm"
variant="ghost"
>
<X className="size-4" />
</Button>
</AlertAction>
</Alert>
</div>
);
}