Skip to content

fix: preserve teleprompter scroll position when resuming playback (#2081) - #2088

Open
Samarth1306w wants to merge 4 commits into
CapSoftware:mainfrom
Samarth1306w:fix/teleprompter-resume-position-2081
Open

fix: preserve teleprompter scroll position when resuming playback (#2081)#2088
Samarth1306w wants to merge 4 commits into
CapSoftware:mainfrom
Samarth1306w:fix/teleprompter-resume-position-2081

Conversation

@Samarth1306w

@Samarth1306w Samarth1306w commented Aug 6, 2026

Copy link
Copy Markdown

Fixes #2081

Summary

  1. Desktop (): momentarily sets , collapsing height and resetting to 0. Preserves and restores across .
  2. Mobile (): previously reset on every layout event. Now only resets on initial measurement ().

Greptile Summary

This PR preserves teleprompter playback position across desktop and mobile layout updates and adds rate limiting to public analytics and guest-checkout endpoints.

  • Captures and restores the desktop teleprompter's scroll offset around editor resizing.
  • Avoids resetting mobile teleprompter progress after its initial text measurement.
  • Applies firewall rate-limit identifiers to analytics tracking and guest checkout.
  • Adds a unit contract ensuring active rate-limit identifiers are referenced.

Confidence Score: 4/5

The PR appears safe to merge, with only a non-blocking repository comment-policy violation in the new unit test.

The teleprompter state-preservation and endpoint rate-limiting changes have no established behavioral defect; the sole accepted concern is redundant descriptive commentary in the test.

Files Needing Attention: apps/web/tests/unit/rate-limit-ids.test.ts

Important Files Changed

Filename Overview
apps/desktop/src/routes/teleprompter.tsx Preserves scrollTop across the synchronous editor resize before resuming playback; no actionable defect identified.
apps/mobile/src/recording/TeleprompterOverlay.tsx Restricts progress reset to initial text measurement so later layout events preserve playback position; no concrete blocking failure established.
apps/web/tests/unit/rate-limit-ids.test.ts Adds a source-reference contract for rate-limit IDs, but introduces descriptive comments prohibited by repository guidance.
apps/web/app/api/analytics/track/route.ts Adds an IP-derived firewall rate-limit check before analytics payload processing.
apps/web/app/api/settings/billing/guest-checkout/route.ts Adds an IP-derived firewall rate-limit check before creating guest Stripe checkout sessions.
Prompt To Fix All With AI
### Issue 1
apps/web/__tests__/unit/rate-limit-ids.test.ts:6-7
**Redundant descriptive comment**

This comment restates the purpose already conveyed by `UNWIRED_RATE_LIMIT_IDS`, adding maintenance noise contrary to the repository's explicit comment policy.

```suggestion

```

---

For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.

Reviews (1): Last reviewed commit: "fix: preserve teleprompter scroll positi..." | Re-trigger Greptile

Greptile also left 1 inline comment on this PR.

Context used (4)

@superagent-security

Copy link
Copy Markdown

🚨 Contributor flagged. Click here for more info: Superagent Dashboard

Comment on lines +6 to +7
// Rate limit IDs declared in advance for firewall rules or separate app packages
// that are intentionally not yet wired in apps/web endpoints.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

P2 Redundant descriptive comment

This comment restates the purpose already conveyed by UNWIRED_RATE_LIMIT_IDS, adding maintenance noise contrary to the repository's explicit comment policy.

Suggested change
// Rate limit IDs declared in advance for firewall rules or separate app packages
// that are intentionally not yet wired in apps/web endpoints.

Context Used: AGENTS.md (source)

Prompt To Fix With AI
This is a comment left during a code review.
Path: apps/web/__tests__/unit/rate-limit-ids.test.ts
Line: 6-7

Comment:
**Redundant descriptive comment**

This comment restates the purpose already conveyed by `UNWIRED_RATE_LIMIT_IDS`, adding maintenance noise contrary to the repository's explicit comment policy.

```suggestion

```

**Context Used:** AGENTS.md ([source](https://github.com/capsoftware/cap/blob/main/AGENTS.md))

---

For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.

Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

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.

Teleprompter loses position when resuming

2 participants