Public: anyone can read this; the crew can change it.

Apps without a login 1: a sentence becomes an app in the tab forge, with no model #18080

opened this in answer to

Merged 6h 23m ago, live in production

A sentence on /tab now becomes a working app, with no login and no model. I ran the new and tab tests, tsc, the gate and the design lint here, and all are clean. I did not run the headless 390 px check or open /tab in a browser, so the box, live preview and reload flow are untested in a real browser.

Notes

opened this

A sentence on /tab now becomes a working app, with no login and no model. I ran the new and tab tests, tsc, the gate and the design lint here, and all are clean. I did not run the headless 390 px check or open /tab in a browser, so the box, live preview and reload flow are untested in a real browser. The tests cover the same flow without a browser: a tracker made from "track my water" keeps three entries when the page is rebuilt over the same database. Platos was not readable from this sandbox, so I wrote the compiler from the issue's description. Its own compiler tests could not be run against the port.

  • Format: src/tab/spec.ts is the Apple app's Blocks JSON, version 1, with a kind per block. Reading is lenient. A version above 1 is refused in words. An unknown kind is drawn as its label plus "This device cannot show a “kind” block yet."
  • Compiler: src/tab/compile.ts is a few regexes, so the same sentence always gives the same app. It returns the spec and one line of reasoning per choice, which become the "How this app was made" page.
  • Renderers: src/tab/render.ts draws list, notes, counter, tracker (today's total plus history) and board. Everything is escaped. Nothing a spec says is ever run.
  • Store: an app is a row in the tab's own SQLite (app holds the spec as JSON, rec holds its entries). src/tab/apps.ts has the routes, with every input checked at the boundary and caps on apps and entries.
  • The box: "Make an app" on /tab compiles on every keystroke. The preview is the app's real page in a frame that runs no script. The compiler is a separate file, /tab/make.js, fetched only the first time the box is used. "Make it" starts the forge if needed and keeps the app. Without script, the forge's home page has the same sentence form.
  • What holds: the page and the terminal now also say the data is gone if the site's data is cleared.
  • Reused: src/tab/escape.ts and src/tab/shell.ts are the old esc and page shell, moved out of forge.ts, so apps and issues share them.
  • Styling: the stylesheet uses system colours, because the design lint refuses new hex colours, and it adds no new component class.

Left out:

  • Drawing text, number, choice, result, timer, random, log and chess; they fall under the unknown-kind rule. The result arithmetic evaluator is therefore not built.
  • Importing and exporting the spec file; it is shown as JSON on the app's page only.
  • A model filling the spec.
  • The headless 390 px run, plus a measured size budget for /tab.

Gate: the gate still prints an advisory line that the test helper open in test/tab-apps.test.ts is 0.74 like viaBun in test/tab.test.ts. I did not merge them. The commit uses No door: (the terminal side is the extended palette entry and the how-to is a new section of docs/features/tab.md) and No look: lines.

To try: open /tab, type "track my water" or "a board for my bugs with columns open, fixing, shipped" in Make an app, press Make it, add entries, and reload the frame.

review: [{"go":"/tab","look":"the Make an app box under the facts, at 390 px","expect":"typing shows a framed preview of the app; the facts include the 'gone if this site's data is cleared' line","ask":"does the preview feel live and does nothing shift as it appears?"},{"go":"/tab then Make it","look":"the frame after making a tracker","expect":"today's total, an add box and history; entries survive reloading the frame","ask":"is adding three entries one thumb-friendly tap each?"}]

Closes #18043

4 earlier comments
commented

A sentence on /tab now becomes a working app, with no login and no model. I ran the new and tab tests, tsc, the gate and the design lint here, and all are clean. I did not run the headless 390 px check or open /tab in a browser, so the box, live preview and reload flow are untested in a real browser. The tests cover the same flow without a browser: a tracker made from "track my water" keeps three entries when the page is rebuilt over the same database. Platos was not readable from this sandbox, so I wrote the compiler from the issue's description. Its own compiler tests could not be run against the port.

  • Format: src/tab/spec.ts is the Apple app's Blocks JSON, version 1, with a kind per block. Reading is lenient. A version above 1 is refused in words. An unknown kind is drawn as its label plus "This device cannot show a “kind” block yet."
  • Compiler: src/tab/compile.ts is a few regexes, so the same sentence always gives the same app. It returns the spec and one line of reasoning per choice, which become the "How this app was made" page.
  • Renderers: src/tab/render.ts draws list, notes, counter, tracker (today's total plus history) and board. Everything is escaped. Nothing a spec says is ever run.
  • Store: an app is a row in the tab's own SQLite (app holds the spec as JSON, rec holds its entries). src/tab/apps.ts has the routes, with every input checked at the boundary and caps on apps and entries.
  • The box: "Make an app" on /tab compiles on every keystroke. The preview is the app's real page in a frame that runs no script. The compiler is a separate file, /tab/make.js, fetched only the first time the box is used. "Make it" starts the forge if needed and keeps the app. Without script, the forge's home page has the same sentence form.
  • What holds: the page and the terminal now also say the data is gone if the site's data is cleared.
  • Reused: src/tab/escape.ts and src/tab/shell.ts are the old esc and page shell, moved out of forge.ts, so apps and issues share them.
  • Styling: the stylesheet uses system colours, because the design lint refuses new hex colours, and it adds no new component class.

Left out:

  • Drawing text, number, choice, result, timer, random, log and chess; they fall under the unknown-kind rule. The result arithmetic evaluator is therefore not built.
  • Importing and exporting the spec file; it is shown as JSON on the app's page only.
  • A model filling the spec.
  • The headless 390 px run, plus a measured size budget for /tab.

Gate: the gate still prints an advisory line that the test helper open in test/tab-apps.test.ts is 0.74 like viaBun in test/tab.test.ts. I did not merge them. The commit uses No door: (the terminal side is the extended palette entry and the how-to is a new section of docs/features/tab.md) and No look: lines.

To try: open /tab, type "track my water" or "a board for my bugs with columns open, fixing, shipped" in Make an app, press Make it, add entries, and reload the frame.

review: [{"go":"/tab","look":"the Make an app box under the facts, at 390 px","expect":"typing shows a framed preview of the app; the facts include the 'gone if this site's data is cleared' line","ask":"does the preview feel live and does nothing shift as it appears?"},{"go":"/tab then Make it","look":"the frame after making a tracker","expect":"today's total, an add box and history; entries survive reloading the frame","ask":"is adding three entries one thumb-friendly tap each?"}]

commented

I removed the unused DRAWN_KINDS export from src/tab/spec.ts. It was the only thing the dead-code check named, and nothing referenced it. The dead-code test (test/unused-exports.test.ts) and bun x tsc --noEmit both pass locally. I did not run the rest of the suite, because the forge runs the full check on push.

The commit is pushed to the pull's branch. I did not touch the five "no longer dead" entries the check log lists (pinCrawlLag and others). They only prompt a prune of the allow-list and don't fail the test.

commented

This push fixes the four failing palette-roster tests. I ran test/palette-roster.test.ts alone and it passes (15 tests). I did not run the full suite, bun x tsc --noEmit or bun scripts/design-lint.ts this time.

The cause was that the earlier change made the tab's palette entry hint read "…who can reach it, make an app from a sentence". The roster test pins the old hint exactly. I changed the expected hint in test/palette-roster.test.ts to match, because the test was out of date and the hint change is intended.

bun scripts/gate.ts --fix printed a note that open in test/tab-apps.test.ts looks like viaBun in test/tab.test.ts ("one implementation?"). It was not a failure and I left both helpers as they are.

commented

I merged main into the branch, resolved the five conflicts, and pushed. The merge is commit 330c85e01.

tsc --noEmit is clean, and test/tab.test.ts, test/tab-apps.test.ts and test/palette-roster.test.ts pass (43 tests). I did not run the whole suite; the forge's check does that on the push. scripts/fast.ts exited 2 (too broad to name), so I picked those three files myself.

I also ran bun scripts/gate.ts --fix, which changed nothing. Its only output was the same "one implementation?" note about the test helpers open in test/tab-apps.test.ts and viaBun in test/tab.test.ts.

My design-lint run was cut off, so it is unverified.

I made one mistake: I ran bun test $files with files empty, which started a bare bun test over everything in the background. I couldn't stop it from this sandbox. It shouldn't affect the push, but it may still be running until the forge stops it.

  • Two spec files with the same name: main now has src/tab/spec.ts for the issues-app file (#18045 and #18079: parseSpec, makeSpec, import and download). I kept that one as is. My Blocks spec moved to src/tab/blocks.ts, and render.ts, apps.ts, compile.ts and test/tab-apps.test.ts now import it from there.
  • Two tables called app: main already uses app for the forge's name. My made-apps table is now made.
  • forge.ts: the home page shows the app's name, the "Take this app with you" section and the import form from main. My "Your apps" section follows them. /app.json and /import still work. My esc, ROOT and shell imports stay; I dropped main's copies of them.
  • tab-asset.ts: I kept my block styles and added main's small CSS rules for h2, label, input, textarea and overflow-wrap.
  • words.ts: the terminal sentence now says both: "…One JSON file…, open /tab to start it and to make an app from a sentence."
  • tab.md: both sections are kept ("Make an app" and "Take an app with you").
commented

All eight points are addressed and pushed. The tab tests pass, tsc and the design lint are clean, and I have not run a browser. bun scripts/gate.ts still prints one warning: the test helper open in test/tab-apps.test.ts looks like viaBun in test/tab.test.ts. I left it as a warning.

  1. Typed-name removal. Removing an app now asks for its title in a form field, under a red .danger button, so it works with script off. handleApps checks the typed title against the stored one and answers 422, removing nothing, when it is missing or wrong. Single-entry removal is unchanged.
  2. Boxes.
    • .block is now a hairline and space.
    • .card and the left border on .note are gone; board cards are plain rows.
    • --card is dropped.
    • The empty-state line is deleted, since the form's placeholder already says it.
  3. Tokens.
    • STYLE now inlines the forge's own tokens from design/themes.ts for light and dark, the same way offline.ts does. I used bg, fg, muted-fg, accent, border and danger.
    • The duplicate first-line rules (h2, .muted) are merged into one block.
    • The red button's text colour uses var(--bg).
  4. Caps. APPS_MAX and RECORDS_MAX are removed, along with the LIMITs that used them. Only SAY_MAX stays, as an input bound.
  5. Docs. The Blocks spec now points at src/tab/blocks.ts in docs/features/tab.md. The "Take an app with you" section still names spec.ts, because that one really is the issues-app file.
  6. Broken specs. An app whose spec fails to decode is listed on Home with "cannot be drawn". Its page says the spec cannot be read and offers the same typed-title removal. A new test covers it.
  7. Size budget. A test fails if the /tab boot script is 4096 bytes or more. It measures 2771 bytes today.
  8. Small things.
    • tabFile now checks the name once.
    • The has helper in compile.ts is gone.
    • The how-to says making an app is page-only. It needs the in-tab worker and service worker, and the terminal only names the feature.

The commit carries Direction: … (#18043) and No door: … lines for the gate. I did not touch the process-wide-state, dead-code or during timing rules, because nothing here adds a module-level collection or a new export.

Review steps:

[
 {"go":"/tab, make 'shopping list', open the app","look":"the bottom of the app page","expect":"a field asking for the title and a red Remove button; a wrong title refuses and keeps the app"},
 {"go":"/tab, an app page","look":"blocks, board cards, notes","expect":"hairlines and rows only, no filled boxes, forge colours in light and dark"}
]
Sign in to join this conversation.

Search
↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs