Address #123 review: viewers can read plop notes; tighten the API
Build image / build-and-push (push) Successful in 11s

- The "add note" affordance no longer hides from viewers (it claimed
  parity with the bed inspector but gated on !readOnly). A viewer now sees
  "📓 Notes about this plant" and can open the plop's journal to read it;
  the composer stays edit-gated, so they can't write. Real parity now.
- onScopePlantingChange is required, matching onScopeChange (its bed twin),
  so a caller can't pass a plop scope with no way to clear it. Dropped the
  now-dead guard on the "Show all" button.
- Pulled the plop-over-bed scope-label priority into one `scopeLabel`,
  shared by the filter's sibling logic and the composer, so they can't
  drift; trimmed the invariant comment that was restated a third time.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01H3zbym8Doka2d7D48maSgZ
This commit is contained in:
2026-07-22 21:41:11 -04:00
co-authored by Claude Opus 4.8
parent 7015148edf
commit f14875557b
2 changed files with 22 additions and 23 deletions
+5 -3
View File
@@ -35,7 +35,9 @@ export function PlopInspector({
onChangePlant: () => void
onClose: () => void
/** Scope the journal to this plop and open it — the plop parallel of the bed
* inspector's "add note" (#85). Absent for a viewer, who can't write notes. */
* inspector's "add note" (#85). Offered to viewers too (to READ the plop's
* notes, like the bed inspector does); the journal's composer is separately
* gated on edit rights, so a viewer just sees the entries. */
onAddNote?: () => void
readOnly?: boolean
}) {
@@ -176,9 +178,9 @@ export function PlopInspector({
/>
</fieldset>
{!readOnly && onAddNote && (
{onAddNote && (
<Button variant="ghost" className="justify-start px-2 py-1 text-sm" onClick={onAddNote}>
📓 Add a note about this plant
📓 {readOnly ? 'Notes about this plant' : 'Add a note about this plant'}
</Button>
)}