Skip to content

Record keypress gestures in Record Browser - #8481

Open
cindehaa wants to merge 7 commits into
mainfrom
repo-sync/main
Open

Record keypress gestures in Record Browser#8481
cindehaa wants to merge 7 commits into
mainfrom
repo-sync/main

Conversation

@cindehaa

@cindehaa cindehaa commented Sep 8, 2026

Copy link
Copy Markdown
Contributor

Sync PR: 16454
Sync SHA: 93913c443bc94e1437f3d4ba3aa7e01479aa92d4

Sync PR: 16454
Sync SHA: 93913c443bc94e1437f3d4ba3aa7e01479aa92d4
Sync PR: 16454
Sync SHA: 93913c443bc94e1437f3d4ba3aa7e01479aa92d4
…src/'

Sync PR: 16454
Sync SHA: 93913c443bc94e1437f3d4ba3aa7e01479aa92d4
Sync PR: 16454
Sync SHA: 93913c443bc94e1437f3d4ba3aa7e01479aa92d4
Sync PR: 16454
Sync SHA: 93913c443bc94e1437f3d4ba3aa7e01479aa92d4
Sync PR: 16454
Sync SHA: 93913c443bc94e1437f3d4ba3aa7e01479aa92d4
@cindehaa

cindehaa commented Sep 8, 2026

Copy link
Copy Markdown
Contributor Author

Migration Auto-Generated

An alembic migration was automatically generated from the source migration.
Please verify the migration is correct before merging.

Sync PR: 16454

return false;
}
return (
candidate.toLowerCase().includes("drive.google.com") ||

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

Copy link
Copy Markdown

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: 0bcb63a1f4

ℹ️ About Codex in GitHub

Your team has set up Codex to 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 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

sm.Select(),
# After InputText: an Enter that submits a field must record as the fill
# followed by the keypress, not replace it.
sm.PressKey(),

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 Include the key value in press-action deduplication

When two different keypresses target the same element within 250 ms, such as Ctrl+A followed by Ctrl+C, enabling this state machine sends both through _is_duplicate_action, but _action_identity does not include ActionPressKey.key; every press therefore has the same identity and the second gesture is discarded. Include the key expression in the identity so duplicate transport events still collapse without merging distinct shortcuts.

Useful? React with 👍 / 👎.

# shifted in KeyboardEvent.key, and Shift+Tab / Shift+ArrowLeft are the same focus and
# selection noise as their bare forms. It does qualify a gesture already being recorded,
# where it changes what the key means -- Shift+Enter is a newline, not a submit.
shifted = modifiers.shift and not is_character_key(key)

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 Preserve Shift in character shortcuts

Whenever a Ctrl/Alt/Meta shortcut also includes Shift and a character key, such as Ctrl+Shift+T, this sets shifted to false and records Control+T. Capitalizing KeyboardEvent.key does not preserve the modifier during replay—the repository's shortcut parser only holds modifiers explicitly listed before +—so the replay can perform a different action, such as opening a new tab instead of reopening one. Preserve Shift for retained modifier shortcuts while continuing to ignore Shift-only typing.

Useful? React with 👍 / 👎.

Comment on lines +34 to +39
# Alt composes characters -- macOS Option, and Windows/Linux AltGr, which reports as
# ctrl+alt. KeyboardEvent.key is then the composed output rather than the base key, so an
# Alt-held single character is typed text, not a shortcut. Layouts that need AltGr to reach
# "@" would otherwise lose every email field to a bogus Control+Alt+@ press.
if modifiers.alt and is_character_key(key):
return None

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Distinguish Alt shortcuts from composed input

On pages that bind Alt+letter shortcuts, the browser reports a one-character key with altKey=true, so this condition drops the intended gesture entirely. AltGr or macOS Option composition is not equivalent to every Alt-modified character; capture composition/AltGraph information or the physical key code and suppress only composed input rather than all Alt+character shortcuts.

Useful? React with 👍 / 👎.

Comment on lines +30 to +32
key = (key or "").strip()
if not key or key in MODIFIER_KEYS:
return None

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Preserve modified Space gestures

For Ctrl+Space, Meta+Space, or Alt+Space, KeyboardEvent.key is a literal space, and stripping it here produces an empty string before modifier processing. These common shortcuts therefore vanish instead of producing an ActionPressKey; normalize the literal space to the supported Space key name before applying whitespace validation.

Useful? React with 👍 / 👎.

Comment on lines +219 to +224
granted_minutes = min(additional_minutes, headroom_minutes)
updated = await database.browser_sessions.update_persistent_browser_session(
session_id,
organization_id=organization_id,
timeout_minutes=current_timeout_minutes + granted_minutes,
)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Make browser-session extension increments atomic

When two extension requests overlap, both can read the same current_timeout_minutes, compute the same new value, and then assign it through update_persistent_browser_session, whose separate transaction does not lock or compare the previously read row. Both requests return success but the last write wins—for example, two concurrent 30-minute extensions add only 30 minutes—so perform an atomic capped increment or lock the row across the read-modify-write operation.

Useful? React with 👍 / 👎.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants