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
+33 -1
View File
@@ -4,6 +4,7 @@ import {
Building2,
Check,
ChevronsUpDown,
Languages,
LogOut,
Moon,
Plus,
@@ -49,6 +50,8 @@ import {
useSidebar,
} from "@/components/ui/sidebar";
import { authClient } from "@/lib/auth-client";
import { supportedLanguages } from "@/lib/i18n/config";
import { persistLanguage } from "@/lib/language";
import { useActiveRole } from "@/lib/roles";
import { notify } from "@/lib/toast";
@@ -82,7 +85,13 @@ function GitHubIcon({ className }: { className?: string }) {
// shortcut hint (below Theme) and a clinic switcher submenu (below that) whose
// popup reveals the active clinic's details on hover.
export function NavUser() {
const { t } = useTranslation();
const { t, i18n } = useTranslation();
const activeLang = i18n.resolvedLanguage ?? i18n.language;
const changeLanguage = (lng: string) => {
if (lng === activeLang) return;
void i18n.changeLanguage(lng);
void persistLanguage(lng);
};
const { isMobile, state } = useSidebar();
const isCollapsed = state === "collapsed";
const router = useRouter();
@@ -197,6 +206,29 @@ export function NavUser() {
</MenuShortcut>
</MenuItem>
{/* Language: quick switch (also available in Settings). Applies
immediately and roams via the backend preferences. */}
<MenuSub>
<MenuSubTrigger>
<Languages />
<span className="truncate">{t("userMenu.language")}</span>
</MenuSubTrigger>
<MenuSubPopup className="min-w-44" sideOffset={8}>
{supportedLanguages.map((lng) => (
<MenuItem
className="gap-2"
key={lng}
onClick={() => changeLanguage(lng)}
>
<span className="flex-1 truncate">
{t(`settings.profile.language.${lng}`)}
</span>
{lng === activeLang && <Check className="size-4" />}
</MenuItem>
))}
</MenuSubPopup>
</MenuSub>
{/* Command palette: hint + shortcut, sits below Theme. */}
<MenuItem onClick={openCommand}>
<Search />