nex_shift/src/lib
mula.liu 680b4f159e fix(pin): give a pinned image a working enlarge control
Reported: "钉在屏幕上的图片放大按钮无效." There was no enlarge button to
be ineffective — the pin window shipped exactly two actions, copy and
close, so the third press a user went looking for did not exist.

One button now covers both directions: fill the screen, or return to the
size the image was pinned at. An enlarged pin that cannot be shrunk back
is no longer usable as a reference, and a second control for that would
spend hover space on the less common half of the gesture.

Sizing and placement are the whole feature, and both are pinned by tests
because each is correct on the machine that builds it and wrong elsewhere:

- the bound is the monitor's work area, not its size, or the window grows
  under the menu bar and a borderless window cannot be dragged back onto
  itself;
- `set_size` is told in logical pixels and `set_position` in physical
  ones, which on a 2x display is the difference between filling the screen
  and filling it twice from the wrong corner;
- size is set before position, because on a mixed-DPI desktop resizing can
  move a window onto another monitor and change its own scale factor;
- growth is capped at 3x, since the preview is already capped at 1040 px
  and past that the button delivers mosaic, not detail;
- the window grows from its centre and is clamped inside the work area, so
  a pin parked against a screen edge grows inward rather than off.

A fresh pin always opens at the small size. The window is reused rather
than rebuilt, so without that a user who enlarged once would find every
later pin arriving full-screen and soft.

Co-Authored-By: Codex <noreply@openai.com>
2026-11-19 17:49:30 +08:00
..
api.ts fix(pin): give a pinned image a working enlarge control 2026-11-19 17:49:30 +08:00
conversionFormats.test.ts 修复bug 2026-10-25 18:23:08 +08:00
conversionFormats.ts 修复bug 2026-10-25 18:23:08 +08:00
dragImage.ts fix(drop): stop the drag-end fallback from eating the drop it waits for 2026-11-07 00:53:09 +08:00
dragOut.test.ts release: prepare Shift 0.1.8 2026-10-27 18:45:32 +08:00
dragOut.ts release: prepare Shift 0.1.8 2026-10-27 18:45:32 +08:00
dropCapabilities.test.ts fix(drop): disable a spent button and mark it, so both drag paths agree 2026-11-07 02:34:44 +08:00
dropCapabilities.ts fix(drop): disable a spent button and mark it, so both drag paths agree 2026-11-07 02:34:44 +08:00
dropTargets.test.ts fix(drop): stop the drag-end fallback from eating the drop it waits for 2026-11-07 00:53:09 +08:00
dropTargets.ts fix(drop): stop the drag-end fallback from eating the drop it waits for 2026-11-07 00:53:09 +08:00
feedback.test.ts feat(ui): spend the OCR button instead of explaining it, and unify how the app speaks 2026-11-01 16:18:20 +08:00
feedback.ts feat(ui): spend the OCR button instead of explaining it, and unify how the app speaks 2026-11-01 16:18:20 +08:00
history.ts feat(ui): drop onto a button, and read the panels again 2026-11-01 12:02:24 +08:00
ocr.ts release: prepare Shift 0.1.8 2026-10-27 18:45:32 +08:00
radialOrder.test.ts release: prepare Shift 0.1.8 2026-10-27 18:45:32 +08:00
radialOrder.ts release: prepare Shift 0.1.8 2026-10-27 18:45:32 +08:00
recent.test.ts release: 0.1.3 — the Recent list survives an upgrade 2026-10-26 04:02:31 +08:00
useUpdate.ts feat(ui): spend the OCR button instead of explaining it, and unify how the app speaks 2026-11-01 16:18:20 +08:00
utils.ts feat(ui): spend the OCR button instead of explaining it, and unify how the app speaks 2026-11-01 16:18:20 +08:00