diff --git a/frontend/app/trees/page.tsx b/frontend/app/trees/page.tsx index 7316737..bcdf3f5 100644 --- a/frontend/app/trees/page.tsx +++ b/frontend/app/trees/page.tsx @@ -53,6 +53,15 @@ export default function TreesPage() { await api.POST("/api/v1/trees/{tree_id}/restore", { params: { path: { tree_id: id } } }); load(); } + // Optimistic visibility change so the dropdown reflects the pick immediately. + async function setVisibility(id: string, visibility: NonNullable) { + setTrees((cur) => cur.map((t) => (t.id === id ? { ...t, visibility } : t))); + await api.PATCH("/api/v1/trees/{tree_id}", { + params: { path: { tree_id: id } }, + body: { visibility }, + }); + load(); + } if (!ready) return

Loading…

; @@ -76,16 +85,26 @@ export default function TreesPage() { {trees.map((tree) => (
  • - +
    {tree.name}
    -
    - {tree.visibility} -
    +