A diamond’s page
Every diamond is drawn by a page of its own. By default that page renders what the diamond knows. Ask, and it becomes a small application, something you tap that records what you tapped.
The page is a real file, crystal.html, in the diamond's own folder. Every diamond has one from the day it is made, and the same rules cover the plain one and the elaborate one.
Asking for one
Open the diamond and choose Redesign page… in the row above the crystal. The message box fills with one line, Change how this page looks:, with the caret at the end of it. Finish the sentence and send.
The rules the page must obey ride with that turn and are never shown to you. They are the app's contract with the page, identical every time, and you cannot reword them. Delete the opening line and you are asking something else, so they do not ride.
Say what you tap and what it should record. "A tile for each of the foods I eat: tapping one records it with today's date, and the day's total is at the top." A daimon cannot guess whether an entry is a count, a weight or a time, so say which.
What the page can do
- Draw what the diamond knows. Everything is handed to it on load, and again whenever you change how Daimond looks, so it can dress itself to match.
- Read the files in its own diamond. A table it charts, an index it maintains, yesterday's log.
- Write files there. This is what makes it an application. A tap is recorded, and it is still there tomorrow.
- Ask Daimond to open a link, through the same gate every other outward request goes through.
Writing appends by default, so two taps in the same instant both survive. One write is capped at half a megabyte, and the file itself has no ceiling and grows a line at a time.
What it cannot do
The page runs in a sealed frame, and none of the limits here is a setting. The page was written by a model, it is not part of what the diamond knows, and it travels to every device you have linked.
- No network. No fetch of any kind and no image from a server, so it cannot call an API and cannot send anywhere what you put in it.
- No libraries. One self-contained file, with pictures drawn or inlined and code of its own. It cannot build fresh code out of text while it runs.
- 512 KB for the whole page. Page size limit in Settings raises it.
- No storage of its own. Nothing survives between loads except the files it asks Daimond to write, which you can read.
- It cannot rewrite itself, nor the memory, nor the version history.
- It cannot leave its diamond. Every path resolves inside that one folder, so one page cannot read another diamond's files, and none of them reaches your workspace.
Where what you record goes
It goes into the diamond, beside the page, in the browser's own storage. That storage is on your machine, but it is not a folder you can open in a file manager, and it is not the folder you have open as your workspace. You read it in the Workspace panel.
Deleting the page does not delete what it recorded. The files stay, and a new page can read them.
The files travel with the diamond, so a log kept on your phone is on your laptop. Two things follow.
- A diamond travels whole, from whichever device touched it last. Log on two devices between two syncs and the later one wins, so log in one place at a time.
- Bulk data competes. Your diamonds share a few megabytes in a parcel, and one that outgrows what is left is left out of the sync instead of being trimmed. A log of what you did stays small for years, while a reference table of tens of megabytes belongs in the workspace.
Changing it, and putting it back
Ask for changes the same way. Every version of the page is kept, History lists them, and any can be restored.
A page that will not load is not a dead end. Daimond puts its own rendering up instead, says which way it failed, and offers to put the standard page back.
On a phone
At the right-hand end of the row above the page is a button drawn as four corners, Full screen. It takes away the rail, the top bar, the dock, the message box and the page's own row of buttons, and gives the whole display to the page.
The same button, now Exit full screen, brings them back, and so does Esc when Daimond has the keyboard. Full screen is never entered on your behalf and is not remembered.
A worked example
One such page ships with Daimond. The button here makes a diamond called Log Life and puts the page inside it, furnished and ready to record. Daimond asks first, and offers to open the one you have instead of making a second.
Ask for a variation from inside Log Life itself. Redesign page… there, and "the same, but for practice sessions instead of meals", gives the daimon a worked example in front of it. A daimon in another diamond cannot see this page and will start from nothing.