tongkangwangтаl0ng-ai a2498f096a fix(code-insight): stabilize Show Usages popup sizing and placement (#8080)
* fix(code-insight): stabilize Show Usages popup sizing and placement

The popup used a fixed 680px width and 14-row limit. Restoring a saved
size also prevented it from adapting to incoming results. Follow the
IntelliJ popup sizing and placement flow while limiting the filename
column to 25% of the popup width to leave space for code.

Sizing and columns:
- Restore both saved dimensions while waiting for results. Once results
  arrive, cap the natural width at the saved width and calculate the
  height from content. Only preview mode also uses the saved height.
- Measure filenames, line numbers and code with the actual fonts, with
  a 500px natural width limit per column. Fit short filenames to their
  content and ellipsize long names at 25% of the row width. Reserve 5ch
  for line numbers and at least 8em for code, which fills the remaining
  space.
- Include the filename cap, code minimum width, header, controls, borders
  and gaps in the natural popup width. Do not widen the popup for text
  that the filename column will clip.
- Cache maximum natural widths during streaming and filtering. After a
  manual resize, keep updating filename measurements but stop resizing
  the popup automatically until it is reopened or preview is toggled.
- Show up to 30 rows normally or 20 with preview. Leave half a row when
  the list scrolls, and let the list fill the available height.
- Preserve the 360x160 minimum size and existing storage keys. Fit the
  viewport when it is smaller, and save the actual size on close.

Placement and preview:
- Open below the caret. When it is outside the visible editor, use a
  point one third across and halfway down the visible editing area.
- Add optional fitToScreen placement to Popup. Keep the fitted position
  when content shrinks, and move only when necessary to stay visible.
  Reset placement when the anchor changes or preview rebuilds the popup.
- Reuse the shared split panels with a default 60/40 list/preview split,
  persisted proportions, mouse dragging and keyboard adjustment. Set the
  preview minimum to five actual editor lines and update it after font
  or editor geometry changes.
- Preserve the preview's pixel height while manually resizing the outer
  popup. Wait for the splitter's final measurement before restoring it.
- Add onResizeStart on the first pointer movement. Clicking the resize
  handle alone does not lock preview height. Toggling preview clears
  saved dimensions, measurements, manual size and drag position, and
  cancels pending resize callbacks.
- Add a translated accessible label to the preview divider and preserve
  its keyboard controls alongside usage-list navigation.

Verification:
- 17 Playwright layout and demo tests passed in local Google Chrome,
  covering both themes, the 25% cap, narrow windows, filtering, saved
  dimensions, position stability, preview, keyboard controls and resize.
  Both filename-cap regression cases failed before the fix and passed
  afterward.
- Wait for fonts and entry animations before dragging the one-pixel
  divider or measuring dimensions. Account for popup growth when the
  search caption changes while checking the filename cap.
- 49 Popup and Show Usages unit tests passed on the final version.
- pnpm typecheck and pnpm build passed, including Safari 15.4 checks.
  Changed-file oxlint, oxfmt and git diff --check passed.
- An earlier full test run had 20,483 passed, 65 skipped and two existing
  translation-check failures in color-preview/varColors.ts and
  vcs/rebase.tsx. Earlier full lint and knip checks passed. Full format
  checking failed on an existing untracked .workbuddy memory file.
- Before/after screenshots for both themes and narrow windows, plus
  interaction recordings, are retained in temporary verification folders.
  Tests used browser fixtures; the native Tauri webview was not tested
  because no Tauri MCP bridge was available.

* fix(code-insight): restore focus across preview toggle, avoid width ratchet, and clean up cancelled resizes

---------

Co-authored-by: l0ng-ai <[email protected]>
2026-12-05 00:29:34 +08:00
2026-12-03 12:09:33 +08:00
2026-10-22 18:55:10 +08:00
2026-12-03 12:09:33 +08:00
2026-10-22 18:55:10 +08:00
2026-10-22 18:55:10 +08:00

OpenIDEA

The IDE you know, rebuilt in Rust.

English · 简体中文 · Türkçe · Русский

Download  ·  Docs  ·  Benchmark  ·  Plugins  ·  Community

https://github.com/user-attachments/assets/234dd54c-1255-4b3a-b35c-533d78d737c0

OpenIDEA brings the IntelliJ IDEA way of working — its keymap, its tool windows, its search-everything habits — to a native app with a Rust core.

Editor, code insight, debugger, Git, terminal, database and HTTP clients, for 60+ languages. Builds for macOS, Windows and Linux.

On macOS you can also install it with Homebrew:

brew install --cask l0ng-ai/tap/openidea

Benchmark

Opening freqtrade (Python, ~770 files) with warm caches, median of 5 runs:

OpenIDEA IntelliJ IDEA 2026.2.3
Window with the project 0.9 s 3.1 s
Ready (CPU settled) 1.1 s 13.2 s
Memory (USS, all processes) 169 MB 2011 MB
CPU time until ready 2.4 s 47.9 s
Idle CPU 4 % of a core 7 % of a core
Quit 0.3 s 5.9 s

A release build of OpenIDEA from main and IDEA with default settings and plugins, on Windows 11, 32-core AMD, 62 GB RAM. IDEA analyses Python more deeply, so "ready" doesn't mean the same work on both sides. Both are measured from the outside, the same way: see perf/compare to run it on your machine and projects.

Plugins

Plugins add actions, completion, quick fixes, tool windows, custom editors, themes, file icons and languages. They run as sandboxed WebAssembly components; themes, icon themes and languages need no code at all.

Install them from Settings › Plugins, or start your own with openidea-plugin new — see Writing OpenIDEA plugins and the official plugins. The plugin API is still a preview.

Community

License

Apache 2.0. Bundled third-party assets are listed in THIRD_PARTY_LICENSES.md.

Not affiliated with JetBrains. IntelliJ IDEA is a trademark of JetBrains s.r.o.

Мови
TypeScript 54.7%
Rust 42%
CSS 1.6%
Java 0.7%
Python 0.6%
Інші 0.2%