iterate.com / dash

git clone https://git.iterate.com/repos/dash

dash / index.htmlmain at da05cae

<!doctype html>
<html lang="en" data-frame>
  <head>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1" />
    <title>Dash</title>
    <!-- The components' modules and stylesheet come from one other host: the connection to it
         starts now, while the rest of this head is read. -->
    <link rel="preconnect" href="https://esm.iterate.com" crossorigin />
    <link rel="icon" href="/icon.svg" type="image/svg+xml" />
    <!-- iterate's components, pinned to one build. To upgrade, change the version here. -->
    <script type="importmap">
      {
        "imports": {
          "@iterate-com/ui/": "https://esm.iterate.com/@iterate-com/ui@0.1.0-main.20261127T000510Z-262a86d/",
          "react": "https://esm.iterate.com/@iterate-com/ui@0.1.0-main.20261127T000510Z-262a86d/react",
          "react/": "https://esm.iterate.com/@iterate-com/ui@0.1.0-main.20261127T000510Z-262a86d/react/",
          "react-dom": "https://esm.iterate.com/@iterate-com/ui@0.1.0-main.20261127T000510Z-262a86d/react-dom",
          "react-dom/": "https://esm.iterate.com/@iterate-com/ui@0.1.0-main.20261127T000510Z-262a86d/react-dom/",
          "lucide-react": "https://esm.iterate.com/lucide-react@1.48.0?external=react,react-dom"
        }
      }
    </script>
    <!-- THE PAGE'S SOCKET AND ITS SESSION, asked for here and not when the app's modules have
         loaded, which is a second later: `memberItx` (@iterate-com/ui/live, in app.js) takes the
         socket for its first session, and app.js takes the session's answer (the mind's
         address) from `__session`. Without these lines the app asks for both itself when it runs.
         It stands before the stylesheets, because a script after a stylesheet waits for it. -->
    <script>
      try {
        window.__itxSocket = new WebSocket(new URL("/itx", location.href.replace(/^http/, "ws")));
      } catch {}
      window.__session = fetch("/.auth/session.json").then((answer) => answer.json());
    </script>
    <!-- THE FRAME'S SHAPE, said before the first paint. The body draws the app's frame from HTML
         and app.css alone, in the places the shell will draw it, so nothing moves when the app
         takes over. These lines decide what the shell decides: the sidebar as the person left it
         (the cookie `sidebar_state`, which the shell writes at each toggle), or an explicit
         `#sidebar=collapsed` / `?sidebar=collapsed` (or `open`) in the URL when no choice is
         stored, and whether the page is an agent's, which has a header row. app.js hands the Dash
         the same default. `data-frame` on the root element tells the components that the person's
         wait began with this frame. -->
    <script>
      {
        const query = new URLSearchParams(location.search);
        const hash = new URLSearchParams(location.hash.replace(/^#/, ""));
        const sidebarParam = hash.get("sidebar") || query.get("sidebar");
        const agent = location.pathname.startsWith("/agents/")
          ? location.pathname.slice("/agents".length)
          : location.pathname === "/agents"
            ? query.get("contextPath")
            : null;
        const left = /(?:^|; )sidebar_state=(true|false)/.exec(document.cookie)?.[1];
        const open = left ? left === "true" : sidebarParam !== "collapsed";
        document.documentElement.dataset.sidebar = open ? "open" : "collapsed";
        if (agent) document.documentElement.dataset.page = "agent";
        // `?embed=1`: the page is shown in a frame of another app of the mind (the Tasks app shows
        // an agent's chat in a sheet). The frame is narrow, so the shell draws no sidebar; its
        // button is hidden too (public/app.css). The page is the same Dash, for the same member.
        if (query.get("embed") === "1") document.documentElement.dataset.embed = "";
      }
    </script>
    <!-- The stylesheet at the address the build serves it from: the shorter one answers with a
         redirect to this one. `crossorigin`, so it comes over the connection the modules use. -->
    <link
      rel="stylesheet"
      crossorigin
      href="https://esm.iterate.com/@iterate-com/ui@0.1.0-main.20261127T000510Z-262a86d/dist/styles.css"
    />
    <!-- The look of this mind's apps: theme.css of /repos/stdlib, one file for every app. One
         line there makes them all dark. shadcn's components also ask for the class `dark`, so the
         script puts it on <html> when the file says dark. -->
    <link rel="stylesheet" href="/theme.css" />
    <script>
      if (getComputedStyle(document.documentElement).colorScheme === "dark")
        document.documentElement.classList.add("dark");
    </script>
    <link rel="stylesheet" href="/app.css" />
  </head>
  <body>
    <!-- THE FRAME, until the app has drawn itself in its place: the sidebar, an agent page's header
         row and the page's first shapes, with no word in it. app.css draws it and says where each
         number comes from. React puts the app in #root, and so takes the frame out. -->
    <div id="root">
      <div class="frame" aria-busy="true" aria-label="Loading">
        <div class="frame-sidebar" data-frame="sidebar">
          <div class="frame-mind"></div>
          <div class="frame-row"></div>
          <div class="frame-label"></div>
          <div class="frame-agent"><span></span><span></span></div>
          <div class="frame-agent"><span></span><span></span></div>
          <div class="frame-agent"><span></span><span></span></div>
          <div class="frame-view-all"></div>
          <div class="frame-foot"></div>
          <div class="frame-foot"></div>
          <div class="frame-fold"></div>
          <div class="frame-account"></div>
        </div>
        <div class="frame-main">
          <div class="frame-header" data-frame="header">
            <div class="frame-button"></div>
            <div class="frame-path"></div>
            <div class="frame-tabs"></div>
          </div>
          <div class="frame-page" data-frame="page">
            <div class="frame-column">
              <div class="frame-line"></div>
              <div class="frame-composer"></div>
              <div class="frame-section">
                <div></div>
                <div></div>
              </div>
              <div class="frame-section">
                <div></div>
                <div class="frame-card"></div>
              </div>
            </div>
          </div>
        </div>
      </div>
    </div>
    <script type="module" src="/app.js"></script>
  </body>
</html>