mirror of
https://github.com/mauriceboe/TREK.git
synced 2026-12-01 08:53:13 +00:00
fix(settings): the checks the settings redesign left red
The phone's MCP card still read the config fold state that the shared hook no longer holds, so the client failed to typecheck. The phone keeps its folded config, so it now holds that state itself. SettingsColumns takes start and end instead of left and right: the prop types counted as two physical sides for lint:rtl, and in a right-to-left language the first column is the right one anyway. Also: an unused icon import, seven files outside the format baseline run through Prettier, Routing (de) and Services (fr) confirmed as the same word as in English, and the size and warning baselines lowered to what the redesign left (AdminPluginsPanel one wrapped line shorter, two promise warnings, one long function and two non-null assertions in tests fewer).
This commit is contained in:
@@ -77,7 +77,7 @@ export default function AccountTab(): React.ReactElement {
|
||||
{/* Two columns by length: who you are and the second factor on the left,
|
||||
the password and passkeys on the right. */}
|
||||
<SettingsColumns
|
||||
left={<>
|
||||
start={<>
|
||||
<Section title={t('settings.account')} icon={User}>
|
||||
{/* Who is signed in: the picture with its two actions, the role and the SSO link. */}
|
||||
<div className="flex items-center gap-4 rounded-[14px] border border-edge-faint bg-surface-card px-4 py-3.5">
|
||||
@@ -315,7 +315,7 @@ export default function AccountTab(): React.ReactElement {
|
||||
</>
|
||||
</Section>
|
||||
</>}
|
||||
right={<>
|
||||
end={<>
|
||||
{/* Change Password */}
|
||||
{!oidcOnlyMode && (
|
||||
<Section title={t('settings.changePassword')} icon={Lock}>
|
||||
|
||||
@@ -45,7 +45,7 @@ export default function AppearanceSettingsTab(): React.ReactElement {
|
||||
return (
|
||||
<>
|
||||
<SettingsColumns
|
||||
left={<>
|
||||
start={<>
|
||||
{/* ── Theme ───────────────────────────────────────────────── */}
|
||||
<Section title={tr('settings.appearance.theme', 'Theme')} icon={Paintbrush}>
|
||||
<SettingRows>
|
||||
@@ -212,7 +212,7 @@ export default function AppearanceSettingsTab(): React.ReactElement {
|
||||
</Section>
|
||||
|
||||
</>}
|
||||
right={<>
|
||||
end={<>
|
||||
{/* ── Dashboard widgets ───────────────────────────────────── */}
|
||||
<Section
|
||||
title={tr('settings.appearance.dashboardWidgets', 'Dashboard widgets')}
|
||||
|
||||
@@ -45,7 +45,7 @@ export default function DisplaySettingsTab(): React.ReactElement {
|
||||
|
||||
return (
|
||||
<SettingsColumns
|
||||
left={<>
|
||||
start={<>
|
||||
<Section title={t('settings.general.startup')} icon={Rocket}>
|
||||
<SettingRows>
|
||||
{/* Where opening TREK lands */}
|
||||
@@ -248,7 +248,7 @@ export default function DisplaySettingsTab(): React.ReactElement {
|
||||
</Section>
|
||||
|
||||
</>}
|
||||
right={
|
||||
end={
|
||||
<Section title={t('settings.general.travelMap')} icon={Map}>
|
||||
<SettingRows>
|
||||
{/* Preferred map app (#2423): opt-in, the picker stays the default */}
|
||||
|
||||
@@ -32,7 +32,7 @@ export default function IntegrationsTab(): React.ReactElement {
|
||||
{/* What connects your trips with other services on the left, AI and
|
||||
developer access on the right, every card open on the page. */}
|
||||
<SettingsColumns
|
||||
left={
|
||||
start={
|
||||
<>
|
||||
{/* Forwarded booking mails: hides itself where this server or plan has no import. */}
|
||||
<MailImportSection />
|
||||
@@ -51,7 +51,7 @@ export default function IntegrationsTab(): React.ReactElement {
|
||||
{S.llmEnabled && S.ownParsing && !managed && <LlmConnectionSection />}
|
||||
</>
|
||||
}
|
||||
right={
|
||||
end={
|
||||
<>
|
||||
{/* An API key needs no addon, so it leads, ahead of the MCP row. */}
|
||||
<DemoLock locked={demoLocked} reason={S.t('demo.lock.apiKeys')}>
|
||||
|
||||
@@ -52,7 +52,7 @@ export default function OfflineTab(): React.ReactElement {
|
||||
{/* Two columns by length: what the mode does and what is cached on the
|
||||
left, the per-trip choice of what to keep on the right. */}
|
||||
<SettingsColumns
|
||||
left={<>
|
||||
start={<>
|
||||
{/* Offline mode + prepare */}
|
||||
<Section title={t('settings.offline.mode.title')} icon={CloudOff}>
|
||||
<SettingRows>
|
||||
@@ -235,7 +235,7 @@ export default function OfflineTab(): React.ReactElement {
|
||||
)}
|
||||
</Section>
|
||||
</>}
|
||||
right={<>
|
||||
end={<>
|
||||
{/* What to store offline */}
|
||||
<Section title={t('settings.offline.storage.title')} icon={MapIcon}>
|
||||
<SettingRows>
|
||||
|
||||
@@ -43,7 +43,6 @@ export default function WandererConnectionSection(): React.ReactElement {
|
||||
</StatusPill>
|
||||
}
|
||||
>
|
||||
|
||||
<div className={GRID_2}>
|
||||
<EditorField label={t('wanderer.url')} htmlFor="wanderer-url">
|
||||
<input
|
||||
|
||||
@@ -43,12 +43,7 @@ function HintsButton({ W }: { W: WandererWatchController }) {
|
||||
return (
|
||||
<Tooltip label={count ? t('wanderer.watch.hintsCount', { count }) : t('wanderer.watch.empty')}>
|
||||
<span className="inline-flex">
|
||||
<button
|
||||
type="button"
|
||||
onClick={W.openHints}
|
||||
disabled={count === 0}
|
||||
className={`${SETTINGS_BUTTON} relative`}
|
||||
>
|
||||
<button type="button" onClick={W.openHints} disabled={count === 0} className={`${SETTINGS_BUTTON} relative`}>
|
||||
<BellRing size={13} strokeWidth={2.2} />
|
||||
{t('wanderer.watch.hints')}
|
||||
{count > 0 && (
|
||||
|
||||
@@ -81,32 +81,18 @@ function OwnConnection({ S, own }: { S: AiConnections; own: AiConnectionView })
|
||||
<SettingRows>
|
||||
<ConnectionRow kind={own.kind} title={t('assistant.connect.connected', { provider })} detail={own.hint}>
|
||||
{repairMode ? (
|
||||
<button
|
||||
type="button"
|
||||
onClick={() => S.repair(repairMode)}
|
||||
className={SETTINGS_BUTTON_PRIMARY}
|
||||
>
|
||||
<button type="button" onClick={() => S.repair(repairMode)} className={SETTINGS_BUTTON_PRIMARY}>
|
||||
{t(repairMode === 'chatgpt' ? 'assistant.errorAction.signIn' : 'assistant.errorAction.replaceKey')}
|
||||
</button>
|
||||
) : (
|
||||
<OpenAssistantButton S={S} />
|
||||
)}
|
||||
{own.kind === 'chatgpt' && own.status === 'ok' ? (
|
||||
<button
|
||||
type="button"
|
||||
onClick={() => void signOut()}
|
||||
disabled={busy}
|
||||
className={SETTINGS_BUTTON}
|
||||
>
|
||||
<button type="button" onClick={() => void signOut()} disabled={busy} className={SETTINGS_BUTTON}>
|
||||
<LogOut size={14} strokeWidth={2} /> {t('assistant.connect.signOut')}
|
||||
</button>
|
||||
) : (
|
||||
<button
|
||||
type="button"
|
||||
onClick={askDisconnect}
|
||||
disabled={busy}
|
||||
className={SETTINGS_BUTTON_DANGER}
|
||||
>
|
||||
<button type="button" onClick={askDisconnect} disabled={busy} className={SETTINGS_BUTTON_DANGER}>
|
||||
<Unplug size={14} strokeWidth={2} /> {t('assistant.connect.disconnect')}
|
||||
</button>
|
||||
)}
|
||||
|
||||
@@ -182,13 +182,14 @@ export function SettingsCard({ icon: Icon, iconFill = false, title, hint, badge,
|
||||
* grid over a flat list, which pairs cards row by row and leaves a hole under
|
||||
* the shorter of two. A column with nothing to show drops out and the other
|
||||
* takes the whole width. The cards carry their own bottom margin, so only the
|
||||
* gap between the columns is set.
|
||||
* gap between the columns is set. `start` is the left column, the right one in
|
||||
* a right-to-left language.
|
||||
*/
|
||||
export function SettingsColumns({ left, right }: { left: ReactNode; right: ReactNode }) {
|
||||
export function SettingsColumns({ start, end }: { start: ReactNode; end: ReactNode }) {
|
||||
return (
|
||||
<div className="xl:flex xl:items-start xl:gap-5">
|
||||
<div className="min-w-0 flex-1 empty:hidden">{left}</div>
|
||||
<div className="min-w-0 flex-1 empty:hidden">{right}</div>
|
||||
<div className="min-w-0 flex-1 empty:hidden">{start}</div>
|
||||
<div className="min-w-0 flex-1 empty:hidden">{end}</div>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user