Skip to content

STU-376: Wire the redesigned prompt composer, attachments and local suggestions - #81

Merged
sgardoll merged 12 commits into
milestone/stu-implement-updated-ui-uxfrom
sgardoll/stu-376-wire-the-redesigned-prompt-composer-attachments-and-local
Sep 23, 2026
Merged

sgardoll merged 12 commits into
milestone/stu-implement-updated-ui-uxfrom
sgardoll/stu-376-wire-the-redesigned-prompt-composer-attachments-and-local

Conversation

@sgardoll

@sgardoll sgardoll commented Sep 22, 2026 •

Copy link
Copy Markdown
Owner

Fixes STU-376 (Linear: https://linear.app/stuart-gardoll/issue/STU-376/wire-the-redesigned-prompt-composer-attachments-and-local)

Summary

  • Wire the redesigned composer: ghost suggestion layer with all 13 local prototype suggestion patterns (no completion provider, no network), live announcement via #suggest-status, tab-hint shown only while a suggestion is active
  • Tab accepts only an active suggestion (otherwise focus moves normally); Escape dismisses; Enter submits unless Shift is held or IME is composing
  • Exact three example chips fill their full source prompt behind the prototype's demo caret
  • Submission through the existing runThinkingPipeline contract exactly once per action: whitespace-only cannot submit, duplicate submission disabled in flight, prompt/images preserved on error
  • Image attach/remove keep the existing handlePromptImageSelect/removePromptImage validation; settings icon still opens the real generation settings
  • Guard the retired #btn-run-pipeline reference that crashed every submission since the hero shell replaced it
  • Unit tests for patterns/gates/state machine + browser suite at 360×800 and 1440×900 (typing, Tab/Escape, chips, whitespace guard, duplicate-submission guard, attachments validation, touch)

Test evidence

  • npm test: 303 pass / 0 fail
  • npm run test:ui: 32 passed (13 existing + 19 new)
  • npm run build: clean; deploy guard 9/9; leak scan clean; proxies 30/30

Devin Review

…estions

The redesigned hero shell shipped the composer markup but never wired it:
#hero-send invoked runThinkingPipeline through an inline handler while the
pipeline still dereferenced the retired #btn-run-pipeline button outside its
try block, so every submission crashed silently and left
pipelineState.isRunning stuck true. Chips only copied their prompt, and the
ghost layer, tab hint and live announcement were inert markup.

Add src/composerAdapter.js and bind it from app.js (initComposer replaces
bindHeroChips): the ghost layer mirrors the textarea and surfaces the 13
local prototype suggestion patterns after the prototype's 220ms debounce
and six-character gate — no completion provider, credential or network
request is involved. Tab accepts only an active suggestion and otherwise
moves focus; Escape dismisses; Enter submits unless Shift is held or an IME
is composing, so Shift+Enter keeps its newline. Acceptance records the
accepted text and cannot re-trigger on it in a loop.

Submission goes through the existing pipeline exactly once per action: send
follows canSubmit (non-whitespace prompt, idle pipeline), hands its arrow
to the spinner while in flight, blocks duplicate submission, and never
touches the prompt or attached images, so an error preserves the user's
work. Attach and settings keep their existing wiring — the size/count
validation in handlePromptImageSelect is untouched and the settings icon
still opens the real generation settings. Chips fill their full source
prompt behind the demo caret with a settled aria-pressed state, exactly as
the prototype specifies.

Also define .sr-only inline (the composer label and live region leaned on
the Tailwind CDN for it), port the demo caret and busy-field styles with
their reduced-motion handling, and guard the legacy run button so surfaces
without it stay functional.

Cover the wiring with unit tests for the patterns, gates and the
tab-accept/escape-dismiss state machine, and a browser suite exercising
typing, Tab/Escape, chips, whitespace and duplicate-submission guards,
settings, attachment validation and touch controls at 360px and desktop.

STU-376
@sgardoll

Copy link
Copy Markdown
Owner Author

@greptileai — please review this PR.

@greptile-apps

greptile-apps Bot commented Sep 22, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerConfidence Score: 5/5

The PR appears safe to merge; no actionable new issue remains in the changes since the previous review.

Summary

The PR wires the redesigned prompt composer into the existing generation pipeline, adds local suggestions and keyboard behavior, reconnects image attachments and generation settings, guards the retired run button, and updates verification handling and generated assets.

  • Preserves the existing single-request pipeline contract while blocking blank and overlapping submissions.
  • Adds local suggestion acceptance and dismissal behavior, example-chip animation, accessibility announcements, and responsive browser coverage.
  • Restores attachment previews, removal controls, model-capability handling, and the existing image request contract.
  • Adds unit and browser tests for composer state, submission gates, attachment behavior, and responsive interactions.

Greptile automatically discovered a related ticket that helped explain the purpose of this PR: wire the redesigned composer while preserving existing submission, attachment, model-capability, and local-suggestion behavior.

Reviews (4) · Last reviewed commit: "build: add rebuilt dist bundle"

greptile-apps[bot]

This comment was marked as resolved.

@sgardoll
sgardoll changed the base branch from main to milestone/stu-implement-updated-ui-ux September 22, 2026 09:59
…cy graph cannot be reproduced exactly

Co-Authored-By: bot_apk <apk@cognition.ai>
@sgardoll

Copy link
Copy Markdown
Owner Author

@greptileai review

@sgardoll

sgardoll commented Sep 22, 2026 •

Copy link
Copy Markdown
Owner Author

@greptileai please do full PR and confirm Confidence Score

devin-ai-integration[bot]

This comment was marked as resolved.

devin-ai-integration Bot and others added 2 commits September 23, 2026 10:03
…designed composer and cancel pending suggestion on Escape

Co-Authored-By: bot_apk <apk@cognition.ai>
Co-Authored-By: bot_apk <apk@cognition.ai>
@devin-ai-integration

Copy link
Copy Markdown
Contributor

@greptileai review

Addressed both prior findings: the redesigned composer now wraps the attach control in #prompt-image-upload with #prompt-image-thumbnails (so thumbnails/remove buttons render and non-vision models hide the control and clear attachments), and Escape now cancels the pending suggestion debounce before clearing.

devin-ai-integration Bot and others added 2 commits September 23, 2026 10:13
Resolve conflicts in app.js (keep provisionSucceeded + runId epoch refactor, drop removed approximate plumbing), regenerate-side dist conflicts resolved via rebuild to follow.

Co-Authored-By: Stuart Gardoll <sgardoll@gmail.com>
…te submit during chip typing, restore disclosed-approximation verification

- initComposer now runs before the first awaited startup call (initializeAuth), so the send button's listener exists while auth/subscription requests are in flight; early clicks are no longer dropped.\n- Chip demo-typing now counts as busy: send stays disabled, Enter is rejected while a chip types its prompt, and doSubmit re-checks the state, so a half-typed chip prompt can never submit.\n- Restore the disclosed-approximation verification policy (planCustomCodeVerification returns approximate notices plumbed to the deploy result and success modal) instead of skipping every package-importing class — matching the approach defended in this PR's review thread.\n\nCo-Authored-By: Stuart Gardoll <sgardoll@gmail.com>

Co-Authored-By: Stuart Gardoll <sgardoll@gmail.com>
@devin-ai-integration

Copy link
Copy Markdown
Contributor

Addressed all four Devin Review findings in 8f99fa3 (plus merged the latest milestone/stu-implement-updated-ui-ux, which also clears the merge conflict):

  • Early composer submissions dropped (app.js): initComposer now binds before the first awaited startup call (initializeAuth), so the send button's listener exists while auth/subscription requests are still in flight.
  • Chip animation submits partial prompts (composerAdapter.js): chip demo-typing is now a distinct busy state — Send stays disabled, Enter is rejected until the chip finishes typing, and doSubmit re-checks the state before submitting.
  • Attachment removal lacks a visible surface (index.html): already resolved by 5f8bf04 (#prompt-image-upload + #prompt-image-thumbnails restored); verified on the merged tree.
  • Verification coverage change out of scope (customCodeVerification.js): restored the disclosed-approximation policy — planCustomCodeVerification again returns approximate notices plumbed through to the deploy result and the success modal, rather than skipping every package:-importing class. This matches the approach defended earlier in this thread (blanket-skipping was explicitly rejected for disabling the compile check across nearly the whole deploy).

Verification: npm test 346/346 · npm run test:ui 174/174 · npm run build clean · deploy guard 9/9 · leak scan clean. (Proxy tests not run — no PHP on this machine.)

@devin-ai-integration

Copy link
Copy Markdown
Contributor

Fixed in 8f99fa3 — initComposer now binds before await initializeAuth(), so early clicks are captured rather than dropped.

@devin-ai-integration

Copy link
Copy Markdown
Contributor

Fixed in 8f99fa3 — chip typing is now tracked as a busy state: Send is disabled, Enter is rejected mid-animation, and doSubmit guards on it, so a half-typed chip prompt can't submit.

@devin-ai-integration

Copy link
Copy Markdown
Contributor

Already addressed by 5f8bf04 — the composer wraps the attach control in #prompt-image-upload with #prompt-image-thumbnails, so previews and remove buttons render and non-vision models hide the control and clear attachments. Verified present on the merged tree.

@devin-ai-integration

Copy link
Copy Markdown
Contributor

Reverted the skip-all policy in 8f99fa3: planCustomCodeVerification again returns approximate notices (plumbed to the deploy result and the success modal's "Verified approximately" row), so the compile check keeps running on representable imports with the limitation disclosed — matching the earlier review-thread decision that blanket-skipping disabled the check across nearly the whole deploy.

devin-ai-integration[bot]

This comment was marked as resolved.

…checks, cancel stale suggestion timer on chip fill

Co-Authored-By: Stuart Gardoll <sgardoll@gmail.com>
@devin-ai-integration

Copy link
Copy Markdown
Contributor

Resolving — fix pushed and verified (npm test 346/346, stu376 e2e 19/19).

1 similar comment
@devin-ai-integration

Copy link
Copy Markdown
Contributor

Resolving — fix pushed and verified (npm test 346/346, stu376 e2e 19/19).

devin-ai-integration[bot]

This comment was marked as resolved.

…pending uploads, resync composer on prompt restore

Co-Authored-By: Stuart Gardoll <sgardoll@gmail.com>
@devin-ai-integration

Copy link
Copy Markdown
Contributor

Resolving — fix pushed and verified (npm test 346/346, stu376 e2e 19/19).

2 similar comments
@devin-ai-integration

Copy link
Copy Markdown
Contributor

Resolving — fix pushed and verified (npm test 346/346, stu376 e2e 19/19).

@devin-ai-integration

Copy link
Copy Markdown
Contributor

Resolving — fix pushed and verified (npm test 346/346, stu376 e2e 19/19).

devin-ai-integration[bot]

This comment was marked as resolved.

…controls during a run

Co-Authored-By: Stuart Gardoll <sgardoll@gmail.com>
@devin-ai-integration

Copy link
Copy Markdown
Contributor

Resolving — fix pushed and verified (npm test 346/346, stu376 e2e 19/19).

1 similar comment
@devin-ai-integration

Copy link
Copy Markdown
Contributor

Resolving — fix pushed and verified (npm test 346/346, stu376 e2e 19/19).

@devin-ai-integration

Copy link
Copy Markdown
Contributor

Resolving — acknowledged as intended behavior; re-entry is guarded by pipelineState.isRunning.

devin-ai-integration[bot]

This comment was marked as resolved.

…e busy composer inert

Co-Authored-By: Stuart Gardoll <sgardoll@gmail.com>
@devin-ai-integration

Copy link
Copy Markdown
Contributor

Resolving — fix pushed and verified (npm test 346/346, stu376 e2e 19/19).

1 similar comment
@devin-ai-integration

Copy link
Copy Markdown
Contributor

Resolving — fix pushed and verified (npm test 346/346, stu376 e2e 19/19).

devin-ai-integration[bot]

This comment was marked as resolved.

…ight awaits

Co-Authored-By: Stuart Gardoll <sgardoll@gmail.com>
@devin-ai-integration

Copy link
Copy Markdown
Contributor

Resolving — fix pushed and verified (npm test 346/346, stu376 e2e 19/19).

devin-ai-integration[bot]

This comment was marked as resolved.

Co-Authored-By: Stuart Gardoll <sgardoll@gmail.com>
@devin-ai-integration

Copy link
Copy Markdown
Contributor

Resolving — fix pushed (pure CSS, verified with the pending-thumbnail state the spinner paints over).

@sgardoll
sgardoll merged commit 5a7b7ba into milestone/stu-implement-updated-ui-ux Sep 23, 2026
2 checks passed
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