Title: improvement(variables): focus the new variable's name field after adding it by mofopeadegoke · Pull Request #10065 · simstudioai/sim · GitHub
Open Graph Title: improvement(variables): focus the new variable's name field after adding it by mofopeadegoke · Pull Request #10065 · simstudioai/sim
X Title: improvement(variables): focus the new variable's name field after adding it by mofopeadegoke · Pull Request #10065 · simstudioai/sim
Description: Summary Clicking + ("Add new variable") in the Variables panel adds a variable with a default name (variableN) but leaves focus on the button, so typing goes nowhere and you have to find and click the new row. This focuses the new variable's Name input and selects its default name, so the first keystroke replaces it. collaborativeAddVariable already returns the new id; handleAddVariable now keeps it in a ref, and a ref callback on the Name input focuses and selects that one row when it mounts (no effect needed). The pending id is cleared after use, so it fires once, and only in the client that clicked +: variables added by collaborators don't move focus. focus() also scrolls the row into view inside the panel. One file, +12 / −2. Fixes #10064 Product update (if relevant) Anyone adding workflow variables can name a new variable straight away, and the add flow now works from the keyboard (Tab → + → Enter → type). Type of Change Bug fix New feature Breaking change Documentation Other: UX improvement (focus management) Testing Manually in dev mode (bun run dev:full:capped), Windows 11, Google Chrome: Click + → new variable's name is selected; typing replaces it. Long list (panel scrolls) → + scrolls to and focuses the new row. Keyboard only: Tab → + → Enter → type → text lands in the new field. Editing an existing variable's name doesn't move focus to another row. Second tab on the same workflow adds a variable → the first tab doesn't take focus. Delete a variable, then + → new one still gets focus. Local gate: bun run lint: passes. type-check: apps/sim passes (0 errors). The full parallel run ran out of memory on my machine (15 GB RAM), so I ran it with tsc --noEmit --singleThreaded. The docs workspace fails on Windows for an unrelated reason (page paths are built with path.relative, which gives backslashes); happy to open a separate issue. check:audits: 11 audits fail on Windows, and the same 11 fail on unmodified staging on my machine (Windows path handling), so none come from this change. vitest related on the changed file: 1 file, 6 tests pass. check-block-registry.ts: passes (no block changes). Pushed with --no-verify: the pre-push hook's lint:check passed, but its type-check always fails on Windows because of the docs issue above, whatever the change. No new unit test: per the repo's testing guidance, this is a focus/interaction change that's better shown by the clips below than by a test that restates the implementation. Happy to add one if you'd prefer. Checklist Code follows project style guidelines Self-reviewed my changes Tests added/updated and passing (existing related tests pass; no new test, see Testing) No new warnings introduced I confirm that I have read and agree to the terms outlined in the Contributor License Agreement (CLA) Screenshots/Videos Before: focus stays on +; typing does nothing. before-fix.mp4 After: the new variable's name is selected; typing replaces it. after-fix.mp4
Open Graph Description: Summary Clicking + ("Add new variable") in the Variables panel adds a variable with a default name (variableN) but leaves focus on the button, so typing goes nowhere and you have to find ...
X Description: Summary Clicking + ("Add new variable") in the Variables panel adds a variable with a default name (variableN) but leaves focus on the button, so typing goes nowhere and you have ...
Opengraph URL: https://github.com/simstudioai/sim/pull/10065
X: @github
Domain: github.com
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react-reconciler,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@d5750093facf |
| route-pattern | /:user_id/:repository/pull/:id/files(.:format) |
| route-controller | pull_requests |
| route-action | files |
| fetch-nonce | v2:9a6f90bf-4f0a-e7e0-a54f-40428dc20df6 |
| current-catalog-service-hash | ae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b |
| request-id | 9758:3D53D8:1A15B2E:236C36D:6AFB8A36 |
| html-safe-nonce | 945bf4bafb9591a6dfb9a94d9e8f0d2d3e78252ec97f39cee14abcbef894736f |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5NzU4OjNENTNEODoxQTE1QjJFOjIzNkMzNkQ6NkFGQjhBMzYiLCJ2aXNpdG9yX2lkIjoiNTQ5NjQzMjQ3Njk5MTIyODQ3MSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 90ffed7f044af278579c5127e2419333232311a1c3230c0472ae29a752eca38b |
| hovercard-subject-tag | pull_request:5318798457 |
| github-keyboard-shortcuts | repository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/simstudioai/sim/pull/10065/files |
| twitter:image | https://avatars.githubusercontent.com/u/110726038?s=400&v=4 |
| twitter:card | summary_large_image |
| og:image | https://avatars.githubusercontent.com/u/110726038?s=400&v=4 |
| og:image:alt | Summary Clicking + ("Add new variable") in the Variables panel adds a variable with a default name (variableN) but leaves focus on the button, so typing goes nowhere and you have to find ... |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | 9694464143465782ecae2a97650b2a2b0708d5c31c74f41ee86da57e315e2735 |
| turbo-cache-control | no-preview |
| diff-view | unified |
| go-import | github.com/simstudioai/sim git https://github.com/simstudioai/sim.git |
| octolytics-dimension-user_id | 199344406 |
| octolytics-dimension-user_login | simstudioai |
| octolytics-dimension-repository_id | 912559512 |
| octolytics-dimension-repository_nwo | simstudioai/sim |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 912559512 |
| octolytics-dimension-repository_network_root_nwo | simstudioai/sim |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | true |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 05d967182208691fc7f2e6af52e82fa7fabf6bd5 |
| ui-target | canary-2 |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width