Repository source: docs/plans/post_location_composer/post_location_composer_one_shot.md
Cycle: v3/post_location_composer; Mode: one-shot; Record: this file; Index: plans index; Predecessor: post_location (PR #560, merged)
Debug mode: enabled (project marker .railspike_debug_on)
Effort study: railspike-effort / v3/post_location_composer; host ledger post_location_composer.md; standing P2 enrollment
Extended estimates: enabled (no real alternatives or work units; no unit estimates)
Cycle estimate: 0.2
Status: implemented; PR pending
Storage changes: none.
Original request
2026-12-04, by voice: "merge it as is for now, and let's work on the UI for posting a location." (PR #560 added the Post-Location line and quill.py --location, with no browser control.)
Authorization
The request authorizes a follow-up one-shot for a composer control. Excluded: place names and map links (saved unfinished on wip/post-location-place-names, not part of this cycle), merging and deploying.
Outcome and work type
Application change. Normal entry: the composer's ··· menu on any page with a composer.
"Add location" sits in the ··· menu beside Attach image and Attach audio, while
FORUM_POST_LOCATION_ENABLEDis on.Tapping it closes the menu, asks the device for a fresh position and writes
Post-Location: LAT LON(five decimals, about a metre) at the end of the body, on its own line. A second tap replaces the line rather than adding one.The line stays visible and editable in the text box; deleting it removes the location. No change to signing, the Outbox or anonymous posting: the line is ordinary body text.
A status line under the body says what happened: added, permission off (with how to allow it), timed out, not https, or not found.
Without JavaScript, or in a browser without geolocation, the item stays disabled with a title saying why.
Approach and risks
Writing into the textarea, instead of a hidden field added at signing, keeps every submit path unchanged and lets the writer see exactly what will be posted.
Risk: a cached position from minutes ago while driving. Mitigation:
maximumAge: 0, high accuracy, 20-second timeout.Risk: a precise home location posted by accident. Mitigation: nothing is added without a tap, the line is visible before posting, and the browser's own permission prompt comes first.
Reuse decisions
Menu item: the ··· menu in
templates/partials/composer.php(compose_action_menu.php), next to Attach audio; same disabled-without-scripts pattern.Format:
PostLocation's line; the script writes the same textquill.py --locationwrites.Script loading: the
TemplateRendererscript list, added where composer pages loadbrowser_signing.js, as the audio scripts are.
Completion conditions
End to end: on an iPhone, ··· → Add location → allow → the line appears → Post → the page shows "Location …" under the post.
Recovery: permission refused or slow fix → nothing is written and the status says what to do; tapping again retries.
Release: PR merged and deployed by the maintainer.
Concepts touched
Post location: gains the composer entry. Shared composer: one more ··· item.
Verification and recovery plan
tests/browser/post_location_compose.mjs (granted and refused permission, replace on second tap, menu closes); PostLocationTest gains a page check that the item and script appear only with the flag on; smoke set. A real iPhone check after deploy.
Starting revision and branch: feat/post-location-composer from 2bf2fc1.
Planning commit: cd6decb, made after implementation had begun (see execution history).
Dated execution history
2026-12-04: Historical omission, disclosed: the menu item, script, styles and tests were written before this record and its planning commit existed, because the request arrived mid-call and the implementation was started straight away. The plan commit is made now, separately and before the implementation commit, without backdating; the implementation commit follows.
2026-12-04: Browser test found a second tap returned the cached first position; set
maximumAge: 0so every tap asks for a fresh fix (correction).2026-12-04: Script loads on composer pages (where
browser_signing.jsloads) while the flag is on;postLocationEnabledis passed to templates besideaudioContentEnabled.
Outcome
Delivered as planned. Limitations: not tried on a real iPhone; place names and map links remain on the unmerged wip/post-location-place-names branch.
Verification
CHROMIUM_PATH=… node tests/browser/post_location_compose.mjs: passed (granted: line written, menu closes, second tap replaces; refused: nothing written, status explains)../v3 test --smoke PostLocationTest FeatureFlagEvaluatorTest: 509 run, 509 passed (includes the new page check that the item and script appear only with the flag on).Not run: the full suite; a real iPhone (Safari asks for location permission per site).
Final review
Diff checked: one new script and one menu item reusing the existing menu; no change to signing or storage; files within scope plus concept page and tests.
Commit/merge/publication status
Implementation commit: pending at time of writing; PR follows; merge and deploy need the maintainer's OK.
— Claude · 2026-12-04 UTC · Model: claude-opus-5-5