fix(settings): preserve key format cursor position#105
Conversation
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
WalkthroughThe key-format editor now delegates completion insertion and click handling to CodeMirror, preserves cursor placement and completion metadata, renders placeholder badges locally, and adds a skipped Cypress regression scenario. Repository ignore rules also include ChangesKey format cursor completion
Worktree ignore configuration
Estimated code review effort: 3 (Moderate) | ~20 minutes Sequence Diagram(s)sequenceDiagram
participant User
participant StringsEditor
participant CodeMirror
User->>StringsEditor: Click key-format editor
StringsEditor->>CodeMirror: Start completion
User->>CodeMirror: Select placeholder
CodeMirror->>StringsEditor: Apply text and cursor selection
StringsEditor->>CodeMirror: Render placeholder badge
Suggested reviewers: Poem
🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (2 warnings)
✅ Passed checks (3 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@src/ui/views/Settings/StringsEditor.tsx`:
- Around line 65-69: Remove the unused catch parameter in the try/catch around
getPlaceholders within the StringsEditor component, changing it to an optional
catch binding while preserving the existing fallback of assigning an empty array
to placeholders.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: cc05d099-50f4-477c-a4ab-685d1abf784b
📒 Files selected for processing (2)
cypress/e2e/keyFormatEditor.cy.tssrc/ui/views/Settings/StringsEditor.tsx
🚧 Files skipped from review as they are similar to previous changes (1)
- cypress/e2e/keyFormatEditor.cy.ts
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 555c1047f0
ℹ️ 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".
What changed
Why
Fixes #104.
The key-format editor restarted explicit completion before each typed character
and used a custom insertion transaction outside CodeMirror's completion
lifecycle. This kept stale completion ranges active and made the cursor jump
while composing formats such as
artboard.component.Validation
bunx cypress run --spec cypress/e2e/keyFormatEditor.cy.tsbun run tscbun run buildbunx eslint src/ui/views/Settings/StringsEditor.tsxbunx prettier --check src/ui/views/Settings/StringsEditor.tsx cypress/e2e/keyFormatEditor.cy.ts docs/superpowers/plans/2026-07-10-key-format-cursor.md docs/superpowers/specs/2026-07-10-key-format-cursor-design.mdSummary by CodeRabbit