Build a Local-First Revision Log for Floor-Plan Experiments
You have three layout drafts, a folder of images, and a prompt you have already edited twice. Which change produced the version you wanted to keep? The missing piece is often a decision log. Saving the output preserves the picture; saving the brief, the change, and the unresolved question preserves the reasoning. This tutorial builds a small browser app for that second job: an append-only revision log using plain HTML, JavaScript, and localStorage. It requires no framework, account, or backend. As a concrete workflow, consider drafting concepts with Floor Plan AI, which describes text-based floor-plan generation on its website. The log below is a separate, manual companion. It does not call that service, assume an API exists, or read its project data. Define the record before building the form Each revision needs five human-written fields: Label: a stable name that also appears in the saved image filename. Brief: the complete prompt or instructions used for this revi
You have three layout drafts, a folder of images, and a prompt you have already edited twice. Which change produced the version you wanted to keep?
The missing piece is often a decision log. Saving the output preserves the picture; saving the brief, the change, and the unresolved question preserves the reasoning.
This tutorial builds a small browser app for that second job: an append-only revision log using plain HTML, JavaScript, and localStorage. It requires no framework, account, or backend.
As a concrete workflow, consider drafting concepts with Floor Plan AI, which describes text-based floor-plan generation on its website. The log below is a separate, manual companion. It does not call that service, assume an API exists, or read its project data.
Define the record before building the form
Each revision needs five human-written fields:
- Label: a stable name that also appears in the saved image filename.
- Brief: the complete prompt or instructions used for this revision.
- Observation: what changed and what you can actually see.
- Next check: one unresolved question.
- Decision: needs review, keep for discussion, or reject.
An ID and a UTC timestamp are added by the app. Store the full brief even when only one sentence changes. A chain of “same as before, except…” notes is difficult to reconstruct after its context disappears.
Here is a synthetic example, not a report of a generation run:
Label: layout-003
Brief: One bedroom. Separate the work area from the bedroom.
Keep the entry connected to the kitchen.
Observation: Changed only the requested work-area position.
This draft appears to put it beside the living area.
Next check: Confirm the desk and chair dimensions against measurements.
Decision: Needs review
“Appears to” is useful language here. A visual observation does not establish that a dimension is correct. The log records a person's interpretation; it does not certify the drawing.
A complete single-file implementation
Save this as revision-log.html. It includes explicit form labels, a status region, JSON export, and conservative handling of unreadable stored data.
lang="en">
charset="utf-8">
name="viewport" content="width=device-width, initial-scale=1">
Layout revision log
body { font: 1rem/1.6 system-ui; max-width: 48rem; margin: 2rem auto; padding: 0 1rem; }
label { display: block; margin-top: 1rem; }
input, textarea, select, button { font: inherit; }
input, textarea, select { width: 100%; box-sizing: border-box; }
textarea { min-height: 6rem; }
button { margin: 1rem 1rem 0 0; }
li { border-top: 1px solid #aaa; padding: 1rem 0; }
pre { white-space: pre-wrap; overflow-wrap: anywhere; font: inherit; }
Layout revision log
Record one change per revision. This page sends no data to a server.
id="status" role="status" aria-live="polite">
id="entries" aria-label="Saved revisions">
const KEY = 'layout-revisions:v1';
const form = document.querySelector('#entry-form');
const list = document.querySelector('#entries');
const status = document.querySelector('#status');
const save = document.querySelector('#save');
const download = document.querySelector('#export');
const fields = ['id', 'createdAt', 'label', 'brief', 'observation', 'next', 'decision'];
let entries = [];
function validEntry(entry) {
return entry && fields.every(key => typeof entry[key] === 'string')
&& ['review', 'keep', 'reject'].includes(entry.decision);
}
function render() {
list.replaceChildren();
for (const entry of entries) {
const item = document.createElement('li');
const title = document.createElement('h2');
title.textContent = entry.label;
const detail = document.createElement('pre');
detail.textContent = [
entry.createdAt, `Decision: ${entry.decision}`,
`Brief: ${entry.brief}`, `Observation: ${entry.observation}`,
`Next: ${entry.next}`
].join('\n\n');
item.append(title, detail);
list.append(item);
}
}
try {
const raw = localStorage.getItem(KEY);
const loaded = raw === null ? [] : JSON.parse(raw);
if (!Array.isArray(loaded) || !loaded.every(validEntry)) {
throw new Error('Unrecognized saved data');
}
entries = loaded;
render();
status.textContent = `${entries.length} revisions loaded.`;
} catch {
save.disabled = download.disabled = true;
status.textContent = 'Storage unavailable or saved data invalid. Existing storage was not changed.';
}
form.addEventListener('submit', event => {
event.preventDefault();
if (save.disabled) return;
const data = new FormData(form);
const entry = {
id: crypto.randomUUID(), createdAt: new Date().toISOString(),
...Object.fromEntries(['label', 'brief', 'observation', 'next', 'decision']
.map(key => [key, String(data.get(key) ?? '').trim()]))
};
if (!['label', 'brief', 'observation', 'next'].every(key => entry[key])) {
status.textContent = 'Fill in every field.';
return;
}
const updated = [entry, ...entries];
try {
localStorage.setItem(KEY, JSON.stringify(updated));
} catch {
status.textContent = 'Save failed. Your input is still in the form; export earlier entries as a backup.';
return;
}
entries = updated;
render();
form.reset();
status.textContent = 'Revision saved in this browser.';
});
download.addEventListener('click', () => {
if (download.disabled) return;
const blob = new Blob([JSON.stringify({schemaVersion: 1, entries}, null, 2)],
{type: 'application/json'});
const url = URL.createObjectURL(blob);
const link = document.createElement('a');
link.href = url;
link.download = 'layout-revisions.json';
document.body.append(link);
link.click();
link.remove();
setTimeout(() => URL.revokeObjectURL(url), 1000);
status.textContent = 'JSON backup download requested.';
});
Serve the file from a consistent local origin:
python3 -m http.server 8765 --bind 127.0.0.1
Open http://127.0.0.1:8765/revision-log.html in a current browser. Run the command in the directory containing the file. Localhost also provides the secure context used by crypto.randomUUID().
Avoid treating direct file: access as a portable persistence setup. MDN documents that localStorage behavior for file URLs is undefined and can differ between browsers. Storage is tied to an origin, so switching between localhost, 127.0.0.1, or another port creates a different storage context. MDN: localStorage.
Two details that prevent misleading success
The app writes the proposed updated array to storage before clearing the form. If writing fails, the old in-memory list remains in place and the unsaved text stays in the form. The status message reports failure rather than pretending the revision was saved.
Loading also fails conservatively. A missing key means an empty log; malformed JSON or an unexpected record shape disables writing. Silently replacing a corrupted log with an empty array would destroy the evidence needed to investigate it. This minimal version leaves recovery to browser storage inspection; it does not include a recovery UI.
Records are rendered with textContent. A prompt containing or HTML-like room labels should appear as text. It should not become part of the page's markup. This follows the distinction described in MDN: textContent.
Use the log alongside the image folder
Keep a matching filename outside the app, for example layout-003.png, and copy the same label into the form. The app stores text only. Exporting its JSON does not export or embed the floor-plan images.
A useful loop is:
- Write a baseline brief and save a draft image under a revision label.
- Add a record with the full brief and a concrete observation.
- Change one request, save the next draft, and add a new record.
- Compare what changed against the question you were trying to answer.
Changing one request makes the discussion easier to follow. It does not prove causation: a generative tool may vary between runs even when the wording stays the same. Without a controlled model version and generation settings, this is a manual history rather than a reproducible benchmark.
Keep unrelated drafts in separate folders or include a project prefix in each label. This implementation has one log per browser origin and no project selector.
Where this small design stops
localStorage is convenient for a short text log, but it is not a backup or a multi-user database. Clearing site data removes the records. Private browsing has different persistence expectations. Multiple tabs can overwrite one another because the app performs no concurrency control. Use one tab and export JSON periodically.
The backup is readable JSON with a schemaVersion field. This version does not implement import; a restore workflow would need its own validation and conflict policy. For longer-lived tools, IndexedDB and explicit import/export are reasonable next steps.
“No backend” also has a narrow meaning: this sample page contains no network calls. It does not encrypt records or isolate them from other scripts hosted on the same origin. Keep real client details out of this demo, and run it in a dedicated local directory.
A revision log is useful when the question changes from “Which picture do I like?” to “What did we change, what did we learn, and what still needs checking?” The saved text keeps those questions attached to the draft that prompted them.
Share
What's Your Reaction?
Like
0
Dislike
0
Love
0
Funny
0
Angry
0
Sad
0
Wow
0