Commit Graph

16 Commits (706ff6fb264bd5f7e8663b76c827fae85f2a2ea9)

Author SHA1 Message Date
mula.liu 706ff6fb26 fix(icons): orange ground and white mark, as the product has always been
Reported: "你改的标注应用图标不对啊,我之前是橙底、白线的风格(参考 squid 的
图标)."

The previous commit inverted the figure/ground relationship. Chasing
consistency with the alpha-only tray mark, the app tile went to espresso
with a warm mark — technically consistent geometry, and it passed every
contrast check I ran, but those checks were pointed at the wrong axis.
Consistency has two of them here, geometry and light/dark, and the one a
returning user actually recognises is "orange tile".

Now the app icon is literally the tray mark with a colour turned on:
`#FF6B35` ground, which is the orange this project's own master already
carried, and `#FFF4EA` mark, the cream the app's panels are drawn on. The
plus stays a punched hole showing the ground rather than a third colour,
so both icons are one drawing on two different grounds. Two colours also
removes the failure mode the last version needed a rule to defend.

Tray PNG is byte-identical again; the .ico ladder (16/24/32/48/64/256) and
.icns entry set are unchanged, and every tracked PNG still matches its
committed dimensions.

Co-Authored-By: Codex <noreply@openai.com>
2026-11-19 21:49:05 +08:00
mula.liu c8a5d41eca docs: document the release banner and the shared icon geometry
Two ledger sections, the README paragraphs for the banner, and the 0.1.13
version row.

「升级提示跨启动存活」records the constraint that is invisible in the code:
the probe is throttled to one a day, so a notice held only in memory is
visible on the morning a release is found and invisible on every launch
after — including the launch right after an update installs. It also
records why a restored notice is re-judged rather than trusted, since
remembering a claim is how you end up advertising the version the user is
already running.

「所有图标共用一份几何」records that the consistency the request asked for is
geometric, not chromatic: the tray mark must be flat and alpha-only
because the shell tints it, and the app mark must be coloured because
nothing tints a dock tile. What made the old icon read as another product
was the gradient, the shine, the shadow and six pastel wedge tints — not
the presence of colour.

Co-Authored-By: Codex <noreply@openai.com>
2026-11-19 21:28:31 +08:00
mula.liu a95aebe1d0 docs: record the measured idle-cost A/B behind the sampling changes
The section quoted the sidecar's own micro-benchmark, which is not a
number anyone can reproduce. Replaced with a per-process A/B against the
installed 0.1.11 over 60 s idle: the sidecar drops 140 ms to 40 ms, and
that row is the only one that can be attributed cleanly, because the
sidecar has no window and so cannot be confounded by whether the main
window is open.

The main-process row is explicitly not offered as "the discovery thread
saved 40%": repeated runs of the same build swing by about 40 ms, the same
order as the difference itself. Saying so is cheaper than letting the next
person quote a coin flip.

Co-Authored-By: Codex <noreply@openai.com>
2026-11-19 18:24:58 +08:00
mula.liu ef68121aeb docs: record the release's constraints in the ledger and the READMEs
Three ledger sections, the 0.1.12 version row, and the user-facing lines
they describe.

「Windows 一键安装运行组件」is the fullest of them: four independent defects
hid in ten lines, and each one reads as "安装失败" from the UI, so the
section records which signal decides the outcome (exit code first, prose
only to break a tie) and why the attempt ladder starts on the command line
0.1.11 already sent.

「钉图窗口的放大与还原」and 「闲置时的取样节奏」record constraints that are
invisible in the code and easy to simplify back into a bug: sizing off
`monitor.size()` instead of the work area, mixing logical and physical
pixels between `set_size` and `set_position`, making a silent Shift copy
deaf in order to save 0.03%, and restoring `default_window_icon()` on the
tray because the colour wheel looked friendlier in the source.

Co-Authored-By: Codex <noreply@openai.com>
2026-11-19 17:52:01 +08:00
mula.liu 85de468bc3 fix(drop): 拒绝改由光标表达,不再往按钮上叠禁止图标
按钮处理不了这次拖拽时保持 disable,鼠标光标换成禁止符号;能服务的光标仍是
AppKit 画的「+文件」。页面上那一层 .drop-ban 叠加层删掉了。

macOS 上外部文件走原生拖放通道,而 wry 的 draggingEntered:/draggingUpdated:
固定回报 NSDragOperation::Copy,页面改不动那条通道的光标。新增
src-tauri/src/drop_cursor.rs:页面把判定用 set_drop_refusal 交下来,原生侧在
运行时替换 wry 私有类的这两条方法(类名带 crate 版本,按前缀扫描),把 Copy
收窄成 NSDragOperationNone。两次都先调用 wry 自己的实现再改返回值——那次调用
正是 over/dragover 的投递入口,拒绝时提前 return 会让页面再也收不到指针移动,
一次拒绝就粘到整段手势结束。回报 None 时既没有 performDragOperation: 也没有
draggingExited:,所以拒绝期间盯一次鼠标松开,用 drop://cancelled 收起面板状态。
Windows 不需要这套:OLE 的回报跟随页面设置的 dropEffect。

实测:PDF 从「最近使用」和从访达分别拖到「文字识别」,两处都是按钮禁用+光标
禁止、无 hover、松手静默;中途拖到能服务的按钮立刻恢复并正常弹出圆环。
2026-11-07 12:43:06 +08:00
mula.liu 935de413d8 docs: 收录 2026-11 全面评审的修复与约束
评审轮改动此前只在本地:更新链路的下载与校验收紧、分享接收的失败上报与
「完成后在访达中显示」、截图/录屏/文件读取的边界处理,以及新增的
ARCHITECTURE / SPECIFICATION / SECURITY / CONTRIBUTING 四份文档和
publish-release、CI 的调整。 ENGINEERING-NOTES 补上「更新、分享与读取边界」
一节,把这些不应被简化掉的约束写进台账。

这些改动已随 0.1.11 构建物发布,此提交只是让源码与产物在服务器上保持一致。
2026-11-07 12:42:35 +08:00
mula.liu cb758c6a03 fix(drop): disable a spent button and mark it, so both drag paths agree
A file from the file manager arrives through the native drag channel, where wry fixes the macOS drag operation to Copy, so the cursor could never carry the refusal. The answer now lives on the button: it is disabled for the length of the gesture, shows a prohibition sign over its own label, and takes no hover feedback. A Recent row also stops being reported as 'no files' by the native enter, which had lit all three buttons for a file two of them could not serve.
2026-11-07 02:34:44 +08:00
mula.liu f625832856 fix(drop): show a forbidden cursor for spent buttons 2026-11-07 01:15:10 +08:00
mula.liu 3057c65d27 fix(drop): stop the drag-end fallback from eating the drop it waits for
0.1.11 made a dragged row do nothing on every button. The release added to
`dragEnd` landed the gesture immediately, and on macOS the native drop is
reported *after* the button is up: the fallback consumed the gesture with
`dragEnd`'s own position - which Chromium reports as the origin, not as where
the pointer stopped - and the drop that followed was read as a finished
gesture and thrown away. Three buttons, no feedback, on both platforms.

The fallback now waits, and only claims the gesture when it can actually name
a button. A release that aims nowhere stands back, so a real drop that arrives
later still runs, and `landed` keeps the two from both acting. A position of
(0, 0) is treated as no position reported, which is what it is on Chromium, and
answered with the last position the drag moved through.

A row dragged out of the window now carries the file rather than the row. Left
alone the engine photographs whatever is under the pointer, and a Recent row is
a thumbnail, a name, an age, a folder path and five hover buttons - a strip of
the list, which reads as the whole list coming along. The ghost is the file: the
picture the list already decoded, or the extension when there is no picture,
with the name under it, matching the figure the ring draws for a file it is
about to convert.

Rebuilt both 0.1.11 installers from this tree.
2026-11-07 00:53:09 +08:00
mula.liu be84d5640f release: prepare Shift 0.1.11
Versions, release docs and the ledger's version row for the two installers.

Both artifacts were built from this tree with the release key baked in, so
either one can verify the signed channel: `Shift-0.1.11-macOS-universal.dmg`
(ad-hoc signed, `hdiutil verify` valid, no notarization) and
`Shift-Setup-0.1.11-win-x64.exe` (cross-compiled, PE machine `0x8664` checked,
frontend confirmed embedded).

The Windows drop fix needs a real Windows host before it can be called done:
this forge has no second machine, and the two delivery paths that went silent
are exactly the ones only WebView2 exercises.
2026-11-06 23:14:57 +08:00
mula.liu 2bf63f2366 fix(drop): let Windows finish a row dropped on a button, and spend every button alike
A row dragged from Recent onto any of the three buttons did nothing on
Windows, and reported itself as a refusal. Both delivery paths can stay
silent on that platform, so the gesture now ends in `dragEnd`, which always
arrives and carries a point to hit-test.

The two paths are silent for two separate reasons. A Recent row is a real
file drag, and WebView2 registers its own OLE drop target on the window, so
the DOM drop never reaches the page; that target then reads only `CF_HDROP`,
which an in-page drag does not carry, so `enter_is_valid` stays false and the
native `over`/`drop`/`leave` are withheld too. `landed` keeps the fallback an
execution rather than a second one, and a release outside the window runs
nothing, because the hit-test has slack around every button and the row was
meant for Explorer.

An idle ring also stops getting in the way. It is borderless and always on
top, so one left open from a previous drop sits over the buttons; macOS
passes mouse events through its transparent pixels and Windows hands the
gesture to whichever HWND is under the pointer. Starting a row drag now puts
such a ring aside, while a ring owned by an in-flight Shift-drag gesture keeps
waiting for the release that decides its fate.

The availability rule stops being OCR's alone. `lib/dropCapabilities` answers
one question - can this button serve these files - and the button's spent
state, its candidacy while a drag is in flight, and the drop itself all ask
it, so Convert spends for a `.key` the way OCR spends for a PDF, on both
platforms, whichever drag source carried the file. Tools never spends: its
ring ends in Open, Reveal and Send. An unknown payload is not a refusal,
because spending on an empty path list would disable a gesture that works.

Two other reports this round were not about the drag at all:

- A file received over the LAN now reveals itself only when "show results in
  Finder" is on, the way a finished conversion already behaves, and a batch
  reveals once at its last file rather than once per file.
- Missing runtime components install as one request. Installs run one after
  another because the package managers hold a single lock, and one package
  answering two rows - Poppler for both PDF rows on Windows - is installed
  once. The panel re-reads the machine afterwards either way, since a batch
  that stopped at its first failure may have landed everything before it.
2026-11-06 23:13:53 +08:00
mula.liu 84c4056a0d feat(ui): spend the OCR button instead of explaining it, and unify how the app speaks
Two changes, one goal: the same gesture and the same news should look and read the
same way wherever they happen.

Dropping a file OCR cannot read used to be answered after the fact - the drop ran,
refused, and popped "文字识别仅支持图片格式". The user had to do the wrong thing
first and then be told. Now the decision happens when the drag starts: MainWindow
records the files in flight (`dragPaths`, from the native `enter` payload or from a
Recent row's `dragstart`) and marks the button spent for the whole gesture with
`is-drop-unavailable`, so the refusal is visible before the pointer is committed and
releasing on it is inert and silent. Both drag sources were verified in a production
build, including the reverse case: an image still lights the button and opens the
editor. `over` carries no paths and `dataTransfer` is unreadable during `dragover`,
so the paths have to be registered at the start - a later refactor that reads them
from the move event gets nothing.

The audit that followed found the same class of problem in the messaging, and worse:
the app said one thing three ways.

Prompts were the largest gap. A Rust-authored sentence reached the screen verbatim,
so a Chinese interface answered Convert with `Saved 1 file.`, and macOS's first-run
write-permission failure was one long English line. Rust now names the outcome or the
failure (`outcomeSaved`, `errCaptureBlocked`) and the interface words it; `translate`
still returns an unknown key unchanged, so genuine technical detail - `ffmpeg exited
with status 137` - is reported as it is rather than flattened into a generic line.
`feedback.test.ts` scans the Rust sources and fails on any code without wording in
both languages, and on any outcome the worder does not know; both directions were
checked by breaking them. It also asserts the two dictionaries list identical keys,
which was silently false before.

Durations were arbitrary: the identical share result showed for 2.6s in the ring and
3.6s in the main window, one file's `processing` message lived 12s in one branch and
120s in another, and generic errors used 2200/2400/3000/3200/3800. `FEEDBACK` is now
the only ladder, and `hold` is reserved for tasks that report progress and must not
expire mid-task.

Error text had three normalisation idioms, two inside the same file; `messageFrom()`
is the only one left. Share failures reported twice at once - a banner saying "could
not send" plus a toast naming a different reason - and now report once, in the panel,
with the real reason. The editor's failure notices wore a green check and lasted 1.4s;
a clipboard refusal was silent, and an OCR failure printed into the text box as though
it had been read from the image.

Disabled controls were dimmed at nine different opacities across the app, three
buttons were disabled in JS with no CSS at all, and several `:hover` rules answered a
disabled control. `--dimmed` plus `cursor: default` and `:not(:disabled)` hovers is now
the single treatment, and the OCR drop-target state joins it. Every transient message
is a live region, three unlabeled icon buttons are named, Escape closes the settings
sheet and the first-run panel, the main toast is raised above every sheet of its
window, and nine raw px font sizes went back onto the type ladder.

Out of scope, deliberately: the accent is still ~87 literals rather than one variable,
and the muted warm greys are still written many ways. Both need a visual pass, not a
search and replace.
2026-11-01 16:18:20 +08:00
mula.liu 75405d84c4 release: prepare Shift 0.1.10
Version and release docs for the two installers.

The ledger's drop-gesture section now says which release did what: 0.1.9 removed
the action-ring fallback and added the explaining toast, 0.1.10 removed the toast
and the panel's own drag animation. Both were written as one change until the
published 0.1.9 tree was checked, and it still had the toast and the is-dragging
rule.
2026-11-01 12:48:57 +08:00
mula.liu b524b69fc8 release: prepare Shift 0.1.9
Version, the release docs and the engineering ledger for the two installers.

The ledger gains a section on the Runtime components panel, because the bug it
records was invisible rather than broken: a dropped `return` made macOS answer
the document-PDF row with a Pandoc pipeline it never uses, so the panel reported
a missing component with no way to install it. The section states the invariant
that a row may not read as missing unless it also offers a way forward, which is
the part a future refactor is most likely to lose again.

README sections that described dropping files as "opens the action ring" now
describe the aimed rule, and the capture-behaviour option is gone from the
Settings tour.
2026-11-01 12:04:03 +08:00
mula.liu df35111326 release: prepare Shift 0.1.8 2026-10-27 18:45:32 +08:00
mula.liu d9bb079ec2 docs: record discovery, conversion and macOS packaging regressions 2026-10-26 20:24:21 +08:00