Skip to content

refactor(web/chat): drop transcript-scroll experiment, rename deprecated hook#32374

Merged
dvargasfuertes merged 1 commit into
mainfrom
apollo/transcript-scroll-rename
May 28, 2026
Merged

refactor(web/chat): drop transcript-scroll experiment, rename deprecated hook#32374
dvargasfuertes merged 1 commit into
mainfrom
apollo/transcript-scroll-rename

Conversation

@vellum-apollo-bot
Copy link
Copy Markdown
Contributor

What

Rip out the parallel imperative scroll experiment and rename the canonical hook.

Why

The transcript-scroll.ts / transcript-scroll-flag.ts module was meant as the migration target for useDeprecatedTranscriptScroll. In practice — after #32239 (snap-to-bottom on switch) landed and #32306 explored load-older — the simplified shape ended up functionally equivalent to a chunk of the existing hook, just split across files. Migration cost without architectural win.

Better path: keep the hook that works, drop the parallel module, rename it to its canonical name, and progressively simplify in place after a QA pass on the remaining bugs.

Deletions

  • apps/web/src/domains/chat/transcript/transcript-scroll.ts
  • apps/web/src/domains/chat/transcript/transcript-scroll-flag.ts
  • apps/web/src/domains/chat/transcript/transcript-scroll.test.ts

In-place edits

  • use-deprecated-transcript-scroll.ts → drop the kill-switch + DISABLED_RESULT short-circuit and the flag import.
  • transcript.tsx → drop useTranscriptScrollOnAttach import + callback-ref plumbing; restore plain ref={scrollRef} / ref={contentRef}.
  • debug-api.ts → drop toggleTranscriptScrollController from VellumDebugFlagsApi and its setter import.
  • impersonate-version-flag.ts → update stale doc reference.

Renames

  • use-deprecated-transcript-scroll.tsuse-transcript-scroll.ts
  • useDeprecatedTranscriptScrolluseTranscriptScroll
  • UseDeprecatedTranscriptScrollArgs / UseDeprecatedTranscriptScrollReturnUseTranscriptScrollArgs / UseTranscriptScrollReturn
  • All import sites updated.

Stat

10 files changed, 16 insertions(+), 480 deletions(-) — net -464 lines.

Tests

  • tsc --noEmit clean.
  • eslint --max-warnings=0 clean.
  • bun test src/domains/chat/transcript/ — 120 pass / 4 fail. Same 4 pre-existing TranscriptMessageBody failures present on origin/main. No regressions.
  • bun test src/domains/chat/ — 1365 pass / 72 fail (matches main's 72; 6 fewer passes correspond to the deleted transcript-scroll.test.ts's 6 tests).

Behavioral impact

Zero. The flag was OFF by default; the parallel path never ran for any user. The hook that was running before is the hook that's running after, just under the canonical name.

Forward plan

@dvargasfuertes QA pass on the remaining bugs in the (now-canonical) useTranscriptScroll hook, then progressive simplification in place.

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: bd9ca40f96

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

/** Persist the flag, log the new value, and reload the page so the
* dispatcher re-resolves. `value === undefined` flips the current
* value (the most common interactive case). */
export function setTranscriptScrollControllerEnabled(value?: boolean): boolean {
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Update remaining callers before deleting scroll modules

In this commit's target tree, live code still imports the deleted/renamed modules: transcript.tsx imports transcript-scroll, use-transcript-scroll.ts and debug-api.ts import transcript-scroll-flag, and several files still import use-deprecated-transcript-scroll. Because these files are removed/renamed here without updating those callers, apps/web cannot resolve the modules during Vite/TypeScript builds, so the chat bundle is broken until the import sites and exported hook names are migrated in the same change.

Useful? React with 👍 / 👎.

…ted hook

The parallel imperative scroll module (`transcript-scroll.ts` +
`transcript-scroll-flag.ts`) was an experiment to migrate
`useDeprecatedTranscriptScroll` to a stateless attachable model. In
practice the simplified shape ended up functionally equivalent to a
chunk of the existing hook, just split across files — migration cost
without an architectural win.

Reverting that direction:

- Delete `transcript-scroll.ts`, `transcript-scroll-flag.ts`, and
  `transcript-scroll.test.ts` (introduced in PR #32239, extended +
  reverted in PR #32306).
- Remove the kill-switch + `DISABLED_RESULT` short-circuit at the
  top of the hook — there's no parallel implementation to flag-gate
  anymore.
- Remove the callback-ref plumbing in `transcript.tsx` (PR #32239
  shape) and go back to direct `ref={scrollRef}` / `ref={contentRef}`
  attachment.
- Drop `toggleTranscriptScrollController` from the debug-api surface
  and its setter import.
- Update the doc reference in `impersonate-version-flag.ts`.

Rename the deprecated hook to the canonical name now that there's no
migration in flight:

- `use-deprecated-transcript-scroll.ts` → `use-transcript-scroll.ts`
- `useDeprecatedTranscriptScroll` → `useTranscriptScroll`
- `UseDeprecatedTranscriptScrollArgs/Return` types renamed accordingly
- All import sites updated (`chat-route-content.tsx`, `debug-api.ts`,
  `debug-api.test.ts`, the hook's own test file)

Forward plan: QA the remaining bugs in the existing hook and
progressively simplify in place.
@vellum-apollo-bot vellum-apollo-bot Bot force-pushed the apollo/transcript-scroll-rename branch from bd9ca40 to 18c956f Compare May 28, 2026 12:51
@dvargasfuertes dvargasfuertes merged commit f9d2a6e into main May 28, 2026
7 checks passed
@dvargasfuertes dvargasfuertes deleted the apollo/transcript-scroll-rename branch May 28, 2026 13:03
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