Say local engine in the import dialog and the offline errors

A tester saw "raw files are demosaiced by the server" and read it as an upload
to someone else's machine. In desktop mode the decoder runs in the bundle on
this PC, so the import dialog, the join page and the "cannot reach" error now
say local engine, while team-server installs keep the server wording.
This commit is contained in:
2026-12-01 12:45:04 +00:00
parent 91ce88a51f
commit 0525e496e0
4 changed files with 36 additions and 10 deletions
+1
View File
@@ -2540,6 +2540,7 @@ export default function App() {
initialFiles={pendingFiles}
existing={photos}
cloud={cloudUser ? { uploadOriginal, push: pushPhoto } : null}
local={localMode}
onNeedServer={() => {
setImportOpen(false);
setCloudError(null);
+15 -5
View File
@@ -18,6 +18,8 @@ interface Props {
immichEnabled?: boolean;
onCreateImmichGallery?: (eventId: string) => Promise<EventRecord>;
cloud?: CloudImport | null;
/** Desktop bundle: the decoder runs on this PC rather than a team server. */
local?: boolean;
onNeedServer: () => void;
}
@@ -32,6 +34,7 @@ export default function ImportModal({
immichEnabled = false,
onCreateImmichGallery,
cloud,
local = false,
onNeedServer,
}: Props) {
const startId = initialEventId !== 'all' && initialEventId !== 'unsorted' ? initialEventId : events[0]?.id ?? '__new';
@@ -278,7 +281,8 @@ export default function ImportModal({
<strong>Drop photos here</strong>
<p className="muted">
or click to choose files. JPEG, PNG, WebP, AVIF, TIFF and camera raw (CR2, CR3, NEF,
ARW, ORF, RW2, RAF, DNG, PEF…) — raw needs the team server.
ARW, ORF, RW2, RAF, DNG, PEF…) — raw needs{' '}
{local ? 'the local engine' : 'the team server'}.
</p>
</div>
<input
@@ -329,18 +333,24 @@ export default function ImportModal({
<strong>
{rawCount} raw file{rawCount === 1 ? '' : 's'} cannot be read by the browser.
</strong>{' '}
They are decoded by the team server, so sign in before importing — or import them later
from the library.
{local
? 'They are decoded by the local engine on this PC. Check that Luminary is running, then import again.'
: 'They are decoded by the team server, so sign in before importing — or import them later from the library.'}
{!local && (
<button className="btn primary small banner-action" onClick={onNeedServer} disabled={busy}>
Sign in to the server
</button>
)}
</div>
)}
{rawCount > 0 && cloud && (
<div className="banner info">
Raw files are demosaiced by the server (LibRaw), a few at a time in parallel. Each file
usually takes 2–4 seconds.
{local
? 'Raw files are demosaiced by the Luminary local engine (LibRaw) on this PC, a few ' +
'at a time in parallel. Each file usually takes 2–4 seconds, and nothing leaves your computer.'
: 'Raw files are demosaiced by the server (LibRaw), a few at a time in parallel. Each ' +
'file usually takes 2–4 seconds.'}
</div>
)}
+1 -1
View File
@@ -101,7 +101,7 @@ LUMINARY
{loadError && (
<>
<span className="join-eyebrow">Invite</span>
<h1>Can’t reach the server</h1>
<h1>Can’t reach Luminary</h1>
<p className="muted">{loadError}</p>
<a className="btn ghost wide" href="/">
Go to Luminary
+16 -1
View File
@@ -35,6 +35,17 @@ export interface UploadResult {
note?: string | null;
}
/**
* True once /api/health reports LUMINARY_LOCAL=1: the engine runs inside this
* app's own folder, so copy must not send users looking for a remote server.
*/
let localEngine = false;
/** Whether this app talks to the engine in its own bundle (desktop mode). */
export function isLocalEngine(): boolean {
return localEngine;
}
export class ApiError extends Error {
status: number;
constructor(message: string, status: number) {
@@ -48,7 +59,10 @@ export async function request<T>(path: string, init?: RequestInit): Promise<T> {
try {
res = await fetch(path, { credentials: 'same-origin', ...init });
} catch {
throw new ApiError('Cannot reach the Luminary server', 0);
throw new ApiError(
localEngine ? 'Cannot reach the Luminary local engine' : 'Cannot reach the Luminary server',
0,
);
}
if (!res.ok) {
let message = `Request failed (${res.status})`;
@@ -78,6 +92,7 @@ export async function getHealth(): Promise<Health | null> {
const res = await fetch('/api/health', { credentials: 'same-origin' });
if (!res.ok) return null;
const body = (await res.json()) as Health;
localEngine = body?.local === true;
return body?.ok ? body : null;
} catch {
return null;