v0.8.0 #16
kungfusheep
announced in
Announcements
v0.8.0
#16
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
glyph v0.8.0
Happy to announce Glyph 0.8.0 - it's a much larger release than usual with lots of new stuff and fixes. The new features have been led by things I'm building that are putting it through its paces in complex real-world scenarios, but I think the best part of the release is how much more stable and predictable it feels compared to 0.7.0.
Upgrading from 0.7.0
Three behaviour changes can break working code with no compile error.
go fixcannot help with these.OverflowHiddenis the zero value, so a container with an explicitHeightwhose content overflowed silently loses the overflow..Overflow(visible)restores the old behaviour. Most likely of the three to bite.Deprecated, removed in 0.9.0
22 renamed identifiers, all still working in 0.8.0. Each carries a
//go:fix inlinedirective, sogo fix ./...or a gopls quick-fix migrates call sites automatically - the whole list is a one-command job.Added
Components
Complete- native autocomplete over any field: anchored dropdown, prefix filter, single-router navigation. Esc and arrows fall through to the parent when the dropdown is closed.KeyHelpand named bindings -Key(...).Named(),App.ActiveBindings, live what's-bound-now help styled withKeyFG,DescFG,GapandRaw.App.LoadKeyBindingsreads a user rebind config.Trigger- focusable form control withActivate,OnActivateandBindFocus.term(experimental) - embeddable pty-backed terminal in its own package.term.New()forks a shell;term.Stream(rw, onResize)drives a byte stream the caller owns. A VT interpreter renders pty output into a cell grid composited as an ordinary Layer-backed component: SGR to truecolor, UTF-8 and DEC special graphics, double-width cells, the alternate screen, cursor-position and device-attribute replies. The API may change.Animation and rendering
Osc(hz)value nodes bindable to widths and parameters, withSine,Saw,Square,Triangle,Steps,Phase,Range,Speed,EaseandLerpshaping. Self-animating spinner viaSpinnerC.Fps; effects can request animation throughPostContext.RequestAnimation.App.EnablePaintFrames(opt-in): an animation tick that proves nothing geometric moved skips the two geometry passes and repaints from the last layout.App.Apply(fn)- render-thread closure queue drained at frame top, so off-thread state changes marshal safely onto the render goroutine.Template.ExecutePaintandTemplate.RunEffectEvals- the paint-only and effect-only entry points.App.ForceRedraw;App.SetViewDiagnosticsilences the view-redefine nudge.Buffer.PushClip/PopClip- explicit clip-rect stack.Layout and text
MaxWidthon VBox and HBox - a pure upper-bound cap: containers wrap at a bound and hug the longest line..Overflow(visible)- opt out of the new fixed-height clip.TruncateWidth/TruncateWidthEllipsis- display-width-aware clip that never splits a wide rune.Rich(&s).Markdown()- bound inline markdown (bold, italic, code, strike, bullet), parse-on-change cached, ForEach-composable.MarkdownWidthmeasures for content-hug sizing;MarkdownSpansand the zero-allocMarkdownSpansIntoexpose the spans.PreserveBGon text and rich text - a write mode that keeps the destination cell background.TextViewC.WordWrapand an explicit wrap text mode; char-wrap chainable on rich text.RichTextNode,OverflowMode,StyleRange,ForEachFn.Limitand remaining bindings via the configure-then-call chain.ScrollView, Layer and List
Layer.SetFeatherfor raw layers.ScrollState/ScrollOffset) - Animate can drive scrolling from a single source of truth.AnchorBottom- hug underflowing content to the bottom edge.ListC.ScrollStateplusScrollbarDynso a List carries a live scrollbar like a Layer.ListC.BindHalfPageNav- half-page up and down.ListC.ScrollEase- a list paints through an eased row offset instead of snapping to its window;Layer.DisplayedScrollYexposes the displayed offset.ScrollbarForLayer, and on ScrollViewScrollbar,ScrollbarVisible,ScrollbarOpacity,ScrollbarOpacityMode,ScrollbarThumbStyle,ScrollbarTrackStyle;ScrollbarC.OpacityandOpacityMode.ScrollViewC.ScrollTo,ScrollViewFn.Height,LayerViewC.HeightPtr.Input and focus
InputC.MultiLine- wrap long text across lines instead of horizontal scroll, with alt+enter / ctrl+j newlines wired toAllowNewlines.Input.StyleRanges- style sub-ranges of the live editable value (mention or search highlight); zero cost when unset.CheckListC.Selection(*int)- external-selection setter, parity with List.FilterListC.OnFilterChange/OnSelect.Jump mode
App.EnterJumpScope- restrict jump targets to NodeRef regions;JumpItem/JumpItemRefper-item constructors;App.JumpScopeKey.JumpMode.Activate()/Deactivate().App and diagnostics
App.Suspend/App.Resume- gate rendering while an external program owns the terminal.App.LastInputUnixNano()- last-input stamp for idle detection.App.CurrentView();Screen.FrontBuffer(); rich span rendered refs; whole-frame guardrail benches.Changed
cmd/toexamples/, all 60 in one place;go run ./cmd/xbecomesgo run ./examples/x..Overflow(visible)opts out, and the blit honours the clip.WidthPctfails loud on a wrong type at build; static over/under-percent is accepted for animation headroom, and the [0,1] range clamp is gone.MaxWidthis a pure upper-bound cap, decoupled from content-hug;maxwidthpctremoved before it ever shipped.Style/SelectedStyleaccept live*Style, restoring theme-reactivity in build-once views.OnFilterChangefires on every query-mutation path with changed-only semantics; a FilterList query change resets selection to the top.Stopis callable from any goroutine.Fixed
Races, deadlocks and memory
Layout and rendering
MaxVisiblecould not scroll back up once clipped. It scrolls both ways.MaxWidthcap was ignored when the parent sized itself from content, so parent and child disagreed on width. Both sizing paths clamp.Per-item (ForEach) binding
OnCompletecould fire mid-frame, so mutating bound state from the callback raced the render. It fires at the end of the frame.Focus, modals and forms
This discussion was created from the release v0.8.0.
All reactions