Repository navigation
merge: bring the window, menu and markdown patches onto main - #11
Merged
Merged
Conversation
listArea declared its ScrollArea, which takes the offset the state had, and applied ScrollTo, ScrollIntoView or ScrollToEnd only afterwards. The rows were placed for the new offset while the layout still scrolled the area by the old one, so the paint that applied a far request showed the rows out of view: a blank list until something else repainted it. ScrollAt already writes the offset to the node for this reason; the List now does the same. A request past the end is brought only as far as the rows go, and ScrollToEnd places the last rows, so neither needs a second paint either.
# Conflicts: # ui/list.go
macOS sets the NSWindow title on the main thread; Windows posts the change to the window thread and applies it with SetWindowTextW (a direct call from another thread would block on WM_SETTEXT); Linux sets the GTK toplevel title on the GTK thread; the headless host records it in its windows listing. Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Native windows already hear the loss of focus to release held keys; the application now hears it too, after the release, so it can save or hide what only makes sense while the window has the user's attention. Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
For a menu the application opens itself where no control stands for it, such as a mark painted inside a custom-drawn view. It looks and behaves as a ContextMenu. Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
The parser makes  a Span whose Image is the destination as written. MarkdownStyle.Image asks the application for each image's bitmap; the view lays it out inline, scaled down to the column and never up, makes a line as tall as its tallest image, keeps a linked image a link, and paints it. Without a bitmap the alt text shows, as before. The framework never reads files or the network. Closes the need of vivaui#220 in this fork. Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Setting the window title lays the titlebar out again, and AppKit puts the zoom button back at the system's height without posting the frame change keepTrafficLightsCentered listens for. In a custom titlebar taller than the system's, the green button then sits above the other two until the next resize. setWindowTitle: now places the buttons again itself.
A Menu opened from a row of a list or popup covered the rows under it, since it could only open under or over its anchor. Beside places it to the right of the anchor, its top at the anchor's, flipping to the left when there is no room, and slides it in from that edge. The side a Menu opens on is now asked again in every paint, so a menu that stops calling Above or Beside opens under its anchor again.
A List with Follow(true) chose the rows it declares from the offset the area had in the paint before, and the layout then pinned the area to the new end. When more rows arrived at once than the viewport holds, the declared rows sat far above the viewport and the paint that added them was blank; a long list that started following stayed blank until something else repainted it. The list now reads whether the area keeps to its end before ScrollArea resets Follow for the paint, places its rows for the end the layout will pin to, and asks for a bounded number of paints when a following list still did not reach its last row (its first paint, or estimated heights that fell short).
The fork's main never carried the six patches Lithe pins (Window.SetTitle, Config.OnFocusLost, ui.MenuAt, MarkdownView images, centered traffic lights and MenuItems.Beside); they lived on the list-follow-end line, which is what v0.6.1-0.20261111102951-7850516be532 points at. Merging that line into main makes one line carry both the patches and the new control options, so Lithe can pin a single commit again. ui/list.go's conflict is resolved to the snapped-offset version, which also stores the offset on the layout node so the paint that adds rows shows the requested end; it subsumes the change-guarded assignment from the other side, and the code below reads the same offset. Co-Authored-By: AtomCode (deepseek-v4.1-flash) <noreply@atomgit.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
为什么
main上一直没有 Lithe 固定的那 6 个 fork 补丁(Window.SetTitle、Config.OnFocusLost、ui.MenuAt、MarkdownView 图片、改标题后红绿灯居中、MenuItems.Beside),它们只在fix/list-follow-end那条线上(也就是v0.6.1-0.20261111102951-7850516be532指向的提交)。#10 是基于main做的,合并后main缺这些补丁,Lithe 侧一提升 pin 就编译失败。本 PR 把那条线合进
main,让main同时带上 6 个补丁和 #10 的控件扩展,Lithe 可以重新只固定一个提交。冲突处理
只有
ui/list.go冲突:两边都在修“列表请求的滚动要在同一帧生效”。if end := max(...); end != scroll.Offset { ... }的带变更判断写法main)是snapScroll吸附整像素并把 offset 写回布局节点取
main的写法:它同时满足两边意图(既在同一帧显示请求的终点,又保住字形纹理),且下方bottom := offset + viewport读的就是同一个offset。验证
go build ./...通过go test ./ui/ ./components/ ./gfx/通过