Land camera-native raw profiles, real ICC soft proofing and 16-bit proxies.
Camera profiles, proofing tables and the half-float sidecar all have to agree with the pixels the editor actually grades, so they land together with the preset filter menu that was unusable while thumbnails streamed in. 🤖 Generated with Codebuff Co-Authored-By: Codebuff <noreply@codebuff.com>
This commit is contained in:
@@ -3,9 +3,11 @@ import {
|
||||
addGalleryComment,
|
||||
galleryDownloadAllUrl,
|
||||
galleryDownloadUrl,
|
||||
getGalleryStatus,
|
||||
loadGallery,
|
||||
setGalleryPick,
|
||||
setGalleryReview,
|
||||
unlockGallery,
|
||||
} from '../lib/api';
|
||||
import type { GalleryPayload, GalleryPhoto } from '../lib/api';
|
||||
|
||||
@@ -74,9 +76,22 @@ export default function ProofingGallery({ token }: { token: string }) {
|
||||
const [saving, setSaving] = useState<Set<string>>(new Set());
|
||||
const [commentDraft, setCommentDraft] = useState('');
|
||||
const [feedbackBusy, setFeedbackBusy] = useState(false);
|
||||
const [locked, setLocked] = useState(false);
|
||||
const [password, setPassword] = useState('');
|
||||
const [unlocking, setUnlocking] = useState(false);
|
||||
|
||||
const load = useCallback(async () => {
|
||||
try {
|
||||
// The status call is what turns a locked link into a password prompt
|
||||
// instead of a dead end: the gallery body is a 401 while locked.
|
||||
const status = await getGalleryStatus(token);
|
||||
if (status.locked) {
|
||||
setLocked(true);
|
||||
setData(null);
|
||||
setFatal(null);
|
||||
return;
|
||||
}
|
||||
setLocked(false);
|
||||
const payload = await loadGallery(token, identity.current.id);
|
||||
setData(payload);
|
||||
setPicks(new Set(payload.photos.filter((p) => p.mine).map((p) => p.id)));
|
||||
@@ -103,6 +118,21 @@ export default function ProofingGallery({ token }: { token: string }) {
|
||||
};
|
||||
}, [data]);
|
||||
|
||||
const unlock = async () => {
|
||||
if (unlocking || !password) return;
|
||||
setUnlocking(true);
|
||||
setError(null);
|
||||
try {
|
||||
await unlockGallery(token, password);
|
||||
setPassword('');
|
||||
await load();
|
||||
} catch (err) {
|
||||
setError(err instanceof Error ? err.message : 'That password did not work');
|
||||
} finally {
|
||||
setUnlocking(false);
|
||||
}
|
||||
};
|
||||
|
||||
const rememberName = (name: string) => {
|
||||
setClientName(name);
|
||||
try {
|
||||
@@ -260,6 +290,38 @@ export default function ProofingGallery({ token }: { token: string }) {
|
||||
);
|
||||
}
|
||||
|
||||
if (!data && locked) {
|
||||
return (
|
||||
<div className="proof">
|
||||
<div className="proof-splash proof-lock">
|
||||
<div className="logo large">Luminary</div>
|
||||
<h1>This gallery is private</h1>
|
||||
<p>Enter the password the photographer gave you.</p>
|
||||
<form
|
||||
className="proof-lock-form"
|
||||
onSubmit={(e) => {
|
||||
e.preventDefault();
|
||||
void unlock();
|
||||
}}
|
||||
>
|
||||
<input
|
||||
type="password"
|
||||
value={password}
|
||||
autoFocus
|
||||
autoComplete="current-password"
|
||||
placeholder="Gallery password"
|
||||
onChange={(e) => setPassword(e.target.value)}
|
||||
/>
|
||||
<button className="btn primary" type="submit" disabled={!password || unlocking}>
|
||||
{unlocking ? 'Opening…' : 'Open gallery'}
|
||||
</button>
|
||||
</form>
|
||||
{error && <p className="proof-subtle">{error}</p>}
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
if (!data) {
|
||||
return (
|
||||
<div className="proof">
|
||||
@@ -320,7 +382,7 @@ export default function ProofingGallery({ token }: { token: string }) {
|
||||
>
|
||||
My picks {pickedCount ? `(${pickedCount})` : ''}
|
||||
</button>
|
||||
{pickedCount > 0 && (
|
||||
{pickedCount > 0 && data.downloads?.allowed !== false && (
|
||||
<a
|
||||
className="btn ghost small"
|
||||
href={galleryDownloadAllUrl(token, identity.current.id)}
|
||||
@@ -419,9 +481,11 @@ export default function ProofingGallery({ token }: { token: string }) {
|
||||
<div className="proof-lb-bar">
|
||||
<div className="proof-lb-title">
|
||||
<span className="proof-lb-name">{lightboxPhoto.name}</span>
|
||||
<a className="btn ghost small" href={galleryDownloadUrl(token, lightboxPhoto.id)} download>
|
||||
Download
|
||||
</a>
|
||||
{data.downloads?.allowed !== false && (
|
||||
<a className="btn ghost small" href={galleryDownloadUrl(token, lightboxPhoto.id)} download>
|
||||
Download
|
||||
</a>
|
||||
)}
|
||||
</div>
|
||||
<button
|
||||
className={`proof-lb-pick ${picks.has(lightboxPhoto.id) ? 'on' : ''}`}
|
||||
|
||||
Reference in New Issue
Block a user