Skip to content

feat(pixel): prepare local drafts while the runtime is unavailable - #5008

Open
0xacee wants to merge 1 commit into
Osmantic:public-betafrom
0xacee:feat/pixel-draft-messages-while-runtime-is-unavailable
Open

feat(pixel): prepare local drafts while the runtime is unavailable#5008
0xacee wants to merge 1 commit into
Osmantic:public-betafrom
0xacee:feat/pixel-draft-messages-while-runtime-is-unavailable

Conversation

@0xacee

@0xacee 0xacee commented Sep 14, 2026

Copy link
Copy Markdown

Why this matters

Pixel currently disables its text composer while service health is connecting, unreachable, or switching models. Users cannot prepare a local message during that wait even though drafting and persistence require no model request.

Separate the active-task editing lock from runtime readiness. Text entry, local prompt commands and confirmed text-file insertion stay available while the backend is unavailable. Send and dictation retain their readiness gate. The existing sendMessage guard also rejects Enter while unavailable; readiness returning never submits automatically.

The contract is: edit locally → existing draft autosave → reload restores the same draft → wait for an available runtime → explicitly send through the existing authenticated stream. Sending, stopping, and restored active/checking tasks still lock editing. No storage schema or request format changes; reverting restores the earlier UI gate and leaves saved drafts readable.

Regression evidence and validation

  • Five of six new mounted-page tests fail on the base. Fixed cases cover connecting/unreachable/switching, local prompt insertion, readiness recovery without auto-send, and restored active-task locking. Six focused files: 119 tests pass.
  • node scripts/check-unavailable-draft.mjs: actual Chromium 153 against the production page with controlled API routes. The base disables editing in both unavailable modes. The fix preserves a Vietnamese/Unicode draft across reload, sends nothing on Enter or readiness recovery, and sends exactly once with the original content after clicking Send.
  • npm run build passes. Focused ESLint has zero errors and 39 existing JSX warnings.
  • Applied the exact fix(pixel): restore the authoritative legacy conversation before autosave #4970, fix(history): restore keyboard focus after confirmed chat deletion #4974 and fix(pixel): preserve newer conversations from stale editors #5004 changes together with this patch: 10 files / 139 tests pass. Both Chromium scripts pass on that combined tree, preserving newer saved data, downloading unsaved recovery text, rejecting stale sends, and retaining explicit-send-only behavior during backend recovery.

The browser fixture serves the UI normally and makes the backend unreachable; it does not establish offline site loading or an installed PWA lifecycle. An installed ODS runtime and native macOS browser were not exercised. Ready for review; deployed lifecycle checks and independent review remain pending before merge.

Overlap check

Searched live open/closed PR titles and production-file changes for Pixel composer, draft, offline/unavailable, switching and persistence. #4951 changes prompt-space calculation; #4770/#4769 concern badge/rewind behavior; #4396 identity; #4255 conversation finding; #4220/#4219 context selection and scrolling; #4218/#4213 local commands. None enables local drafting during runtime unavailability.

#4970 restores legacy conversation authority, #4974 restores deletion focus, and #5004 rejects already-visible stale writes. They solve separate behaviors in shared Pixel files. Use merge order #4970#4974#5004 → this PR and retain all regressions. #4970's lock assertion was updated to query the textbox role rather than the old unavailable placeholder, without weakening the active-task requirement.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant