+
Tap a line to see and change its guardrails
+
+ {lines.map((s) => (
+
+ ))}
+ {map.tools.length > 0 && (
+
+ )}
+
+
+ );
+}
+
+/**
+ * A phone-width screen. There one finger must scroll the page, not drag the map
+ * (otherwise a visitor's finger is trapped on the canvas): the map pans and zooms
+ * with two fingers or its +/- buttons instead.
+ */
+function useNarrow(): boolean {
+ const [narrow, setNarrow] = useState(false);
+ useEffect(() => {
+ const q = window.matchMedia("(max-width: 760px)");
+ const on = () => setNarrow(q.matches);
+ on();
+ q.addEventListener("change", on);
+ return () => q.removeEventListener("change", on);
+ }, []);
+ return narrow;
+}
+
/**
* One project's guardrails, drawn where they act. The user outside; inside the
* project's box, each agent with its LLM, tools and documents; rails on the lines
@@ -1229,6 +1276,11 @@ export function GuardrailMap({
const [active, setActive] = useState(focus);
const [selected, setSelected] = useState