Skip to content

isKeyRepeated + real Windows clipboard/file dialogs/window title + unloadModel wrapper - #122

Merged
proggeramlug merged 1 commit into
mainfrom
feat/clipboard-repeat-unload
Jul 17, 2026
Merged

isKeyRepeated + real Windows clipboard/file dialogs/window title + unloadModel wrapper#122
proggeramlug merged 1 commit into
mainfrom
feat/clipboard-repeat-unload

Conversation

@proggeramlug

@proggeramlugproggeramlug commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

See commit message. One manifest addition (bloom_is_key_repeated) — consumers must clear .perry-cache/node_modules/.cache/perry on update. Everything else is stub-to-real on the Windows platform crate (clipboard, GetOpen/SaveFileNameW with OFN_NOCHANGEDIR, SetWindowTextW) plus the long-missing unloadModel TS wrapper.

Verified live in the editor (clipboard paste into a filtered outliner, real window title); 158 editor tests + ui-smoke green.

https://claude.ai/code/session_01PmL9WgNMkAgvpYSHEZga8K

Summary by CodeRabbit

  • New Features

    • Added key auto-repeat detection through the public input API.
    • Added Windows support for updating window titles.
    • Added native Windows clipboard read/write support.
    • Added native Windows open and save file dialogs.
    • Added an API to unload models and release their resources.
  • Bug Fixes

    • Windows keyboard auto-repeat events are now reported separately from initial key presses.

…le dialogs, and window title; unloadModel TS wrapper
- isKeyRepeated: OS key auto-repeat surfaced as its OWN one-frame edge
(new FFI bloom_is_key_repeated + manifest entry — consumers must clear
.perry-cache). isKeyPressed stays initial-press-only, so a held jump
key never machine-guns; caret navigation is the consumer. Windows
queues repeats off lParam bit 30 in both window procs.
- Windows clipboard was a STUB: bloom_get/set_clipboard_text now speak
CF_UNICODETEXT for real. So were the file dialogs — the editor's
Open/Save buttons have silently done nothing on Windows ever —
GetOpenFileNameW/GetSaveFileNameW now run with OFN_NOCHANGEDIR
(load-bearing: common dialogs change the process CWD by default,
which would break every relative asset path afterward). So was
setWindowTitle (read the string, discarded it) — SetWindowTextW now.
- unloadModel: the FFI existed for years with no TS wrapper, so nothing
could ever call it (the root index even re-exported the nonexistent
name). Wrapper added; long-lived tools can finally free models.
Verified live in the editor: paste into a text field from the system
clipboard, filtered outliner, real window title. 158 editor tests +
ui-smoke green.
Claude-Session: https://claude.ai/code/session_01PmL9WgNMkAgvpYSHEZga8K
@coderabbitai

coderabbitaiBot commented Jul 17, 2026

Copy link
Copy Markdown

Review Change Stack

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 3ceb1d4a-d05c-4fb4-94f5-e3b8564f56e2

📥 Commits

Reviewing files that changed from the base of the PR and between 5fec89f and d1249ec.

📒 Files selected for processing (8)
  • native/shared/src/ffi_core/input.rs
  • native/shared/src/input.rs
  • native/windows/Cargo.toml
  • native/windows/src/lib.rs
  • package.json
  • src/core/index.ts
  • src/index.ts
  • src/models/index.ts

📝 Walkthrough

Walkthrough

The PR adds one-frame OS key-repeat tracking across Windows, native FFI, and TypeScript APIs; implements Windows window title, clipboard, and file dialog operations; and exposes a TypeScript model-unload wrapper.

Changes

Key repeat input

Layer / File(s)Summary
Repeat state lifecycle
native/shared/src/input.rs
InputState stages queued repeats, publishes them during begin_frame, and exposes the active repeat edge.
Windows repeat detection
native/windows/src/lib.rs
Standalone and embedded window procedures queue repeats detected from repeated WM_KEYDOWN messages.
Repeat API exposure
native/shared/src/ffi_core/input.rs, package.json, src/core/index.ts, src/index.ts
The repeat query is exported through native bindings and the public TypeScript API.

Windows native integrations

Layer / File(s)Summary
Windows window and system APIs
native/windows/Cargo.toml, native/windows/src/lib.rs
Additional Win32 features support main-window title updates, Unicode clipboard access, and native open/save file dialogs.

Model lifecycle binding

Layer / File(s)Summary
Model unload API
src/models/index.ts
Adds unloadModel, forwarding a model handle to bloom_unload_model.

Estimated code review effort: 3 (Moderate) | ~25 minutes

Sequence Diagram(s)

sequenceDiagram
participant WindowsWndProc
participant InputState
participant NativeFFI
participant TypeScriptAPI
WindowsWndProc->>InputState: queue_key_repeat(key)
InputState->>InputState: publish repeat edge in begin_frame
TypeScriptAPI->>NativeFFI: bloom_is_key_repeated(key)
NativeFFI->>InputState: is_key_repeated(key)
InputState-->>TypeScriptAPI: 1.0 or 0.0
Loading

Possibly related PRs

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/clipboard-repeat-unload

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

Sign up for freeto 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

@proggeramlug