Skip to content

docs(legal): say project pages keep their task in the browser too - #51

Merged
kalaspuff merged 1 commit into
mainfrom
fctl/209-what-s-written-in-the-composer-box-on-th
Oct 23, 2026
Merged

kalaspuff merged 1 commit into
mainfrom
fctl/209-what-s-written-in-the-composer-box-on-th

Conversation

@fctl-sh

@fctl-sh fctl-sh Bot commented Oct 23, 2026

Copy link
Copy Markdown
Contributor

app.fctl.sh's project pages now keep the task being written in their task box in the browser, as the floor does, until a session starts with it or you sign out: hyperstructure/fctl#246. Each project keeps its own, apart from the floor's. The policy said only the floor's task stays in the browser; it now says each project page's does too.

updated is already today's date. npm run build renders the page with the change.

Merge this together with hyperstructure/fctl#246, or after it.

Session: https://app.fctl.sh/s/ses_01M5NC3YGDDG8BZZMRARNZFWS4

app.fctl.sh's project pages now keep the task being written in their
start form in the browser, as the floor does, each project's apart from
the floor's (hyperstructure/fctl, branch
fctl/209-what-s-written-in-the-composer-box-on-th).
@kalaspuff
kalaspuff merged commit c15a6af into main Oct 23, 2026
4 checks passed
@kalaspuff
kalaspuff deleted the fctl/209-what-s-written-in-the-composer-box-on-th branch October 23, 2026 22:19
kalaspuff pushed a commit to hyperstructure/fctl that referenced this pull request Oct 23, 2026
The task box on a project's Sessions tab now keeps what you write in it,
as the Agent Floor's has since #117. Leave the page, reload it or close
the tab, and the task comes back with the model, effort level and GitHub
access you picked, the files you attached and the caret where you left
it. It stays until a session starts with it or a schedule is set up with
it. Each project keeps its own draft, apart from the Agent Floor's and
other projects'.

This also fixes a bug on `main`. Going straight from one project's page
to another that was already loaded kept the first project's text in the
second one's box, where Start would have started it in the wrong
project.

## How

- **`@/lib/draft`.** Drafts have ids (`draftId`). The home page's is the
person's id, as before, so drafts written before this change come back.
A project's is `<person>:<project id>`. Text is in localStorage under
`fctl:draft:<id>`, files in IndexedDB under `<id>/<file key>`. The
separator is `:` because a `/` would put a project's files inside the
home page's key range. Starting a session forgets that one draft;
signing out still forgets them all.
- **`useKeepDraft`** (`web/src/components/session/start.tsx`) is what
the home page's form did inline. It saves the draft as it changes, as
the box loses the focus (with the caret) and as the form goes, puts the
caret back, and forgets the draft once a session starts with it. Both
forms use it.
- **The project page's form** moves out of `Sessions` into its own
`StartForm`, keyed by the project's id. Without the key, React keeps the
form's state when you go from one project's page to another that is
already loaded, because the route's component stays mounted. That is how
the text carried over.
- **Schedule** forgets the project's draft once the schedule is set up,
as on the Agent Floor.
- **Docs.** `docs/getting-started.md` says project pages keep their task
too.

The privacy policy on fctl.sh lists what app.fctl.sh keeps in the
browser. hyperstructure/fctl-site#51 adds project pages' tasks. Merge it
together with this one, or after it.

## Verification

- **Unit tests.**
- `web/src/lib/draft.test.ts`: each project's draft is kept apart from
the home page's and the others'. Forgetting one leaves the rest, and
signing out forgets them all.
- `web/src/components/session/start.test.tsx`: `useKeepDraft` keeps a
draft as it changes, keeps one of files alone and forgets one with
neither words nor files. It keeps the caret and puts it back, keeps
nothing once a session starts, and leaves other drafts alone. Each of
these tests fails when the line it covers is broken.
- **`cargo xtask check web`** passes: Biome, TypeScript, 681 tests and
the production build.
- **End to end**, with `cargo xtask dev` and Playwright in Chromium,
with two projects, Playground and Second:
1. I wrote a task in Playground, picked Haiku and attached an image. I
went to the Agent Floor, where the box was empty with no files, and
wrote there. Back in Playground, all of it was there.
2. Second's box started empty. Going straight between Playground and
Second kept each one's text.
3. After a reload, Playground's text, model and image came back, the
image from IndexedDB. The Agent Floor had its own draft and no files.
4. Starting a session from Playground emptied its box, also after a
reload. Second's and the Agent Floor's drafts stayed.
5. In Second, Schedule then Cancel kept the draft. Schedule then Set up
schedule forgot it.
6. The Agent Floor still keeps its words, file and selection, and a
session started there forgets its draft but not Second's.
7. Without `key={project.id}`, step 2 fails: Second's text shows in
Playground's box.
- **On `main`**, step 2 shows the bug (Playground's text appears in
Second's box), and Playground's text is gone after a visit to the Agent
Floor.

## Recordings

At 0365e7b, dark theme, 1280 × 720 shown at 960 px. Each writes a task
in Playground and attaches a picture, goes to the Agent Floor, and comes
back to Playground.

| Before | After |
|---|---|
| ![Before: back in Playground, the box is
empty](https://app.fctl.sh/api/v1/published/y3DMixftX4c5Y4EM98uaIGqAyC72zr9nz96LTePxnRM/before-draft.webp)
| ![After: back in Playground, the task and its picture are
there](https://app.fctl.sh/api/v1/published/pOqwDUQhxXBxl3MutUcG6heK31QX6JUOXy0dGdSLGx1/after-draft.webp)
|

Made in fctl session
https://app.fctl.sh/s/ses_01M5NC3YGDDG8BZZMRARNZFWS4

---------

Co-authored-by: fctl-sh[bot] <fctl-sh[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant