feat(pixel): prepare local drafts while the runtime is unavailable - #5008
Open
0xacee wants to merge 1 commit into
Open
feat(pixel): prepare local drafts while the runtime is unavailable#50080xacee wants to merge 1 commit into
0xacee wants to merge 1 commit into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
sendMessageguard 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
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 buildpasses. Focused ESLint has zero errors and 39 existing JSX warnings.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.