diff --git a/src/components/explore/RecordExplorer.tsx b/src/components/explore/RecordExplorer.tsx index eab1bfe..a41fc75 100644 --- a/src/components/explore/RecordExplorer.tsx +++ b/src/components/explore/RecordExplorer.tsx @@ -134,25 +134,48 @@ export default function RecordExplorer({ repo, collection, rkey }: Props) { /> - {/* Rich preview leads — most visitors care about "what is this - record?" before they care about its CID / PDS / DID. Mirrors - the universal link page's layout. The Edit button slots into - the generic preview's footer alongside the CID when applicable; - post / margin previews fall back to a standalone chip below. */} + {/* Primary slot. In read mode this is the rich preview (PostPreview / + margin variants / generic RecordPreview). In edit mode the same + slot becomes the editor — so the user's eye doesn't have to + travel to find their changes, and the page doesn't grow longer + to accommodate a separate editor section. + + The Edit button slots into the generic preview's footer + alongside the CID when applicable; post / margin previews fall + back to a standalone chip below the copy row. */} {recordError &&

{recordError}

} - {!record && !recordError &&

Loading record…

} + {!record && !recordError && !editing && ( +

Loading record…

+ )} - + {editing && canEdit && agent ? ( + { + setRecord((prev) => (prev ? { ...prev, value: next } : prev)); + }} + onDeleted={() => { + setEditing(false); + router.push(`/explore/${repoSeg}/${collection}`); + }} + onCancel={() => setEditing(false)} + /> + ) : ( + + )} - {record && ( + {record && !editing && ( @@ -173,8 +196,9 @@ export default function RecordExplorer({ repo, collection, rkey }: Props) { {/* Standalone Edit chip — only for post / margin previews that - don't have a place to slot the button into their layout. */} - {!editsInPreviewFooter && editButton && ( + don't have a place to slot the button into their layout, and + only in read mode. */} + {!editsInPreviewFooter && !editing && editButton && (
)} - {editing && canEdit && agent && ( - { - setRecord((prev) => (prev ? { ...prev, value: next } : prev)); - }} - onDeleted={() => { - setEditing(false); - router.push(`/explore/${repoSeg}/${collection}`); - }} - onCancel={() => setEditing(false)} - /> - )} - {!session && (