Skip to content
This repository has been archived by the owner on Jun 5, 2024. It is now read-only.

Latest commit

 

History

History
334 lines (248 loc) · 8.85 KB

ROADMAP.md

File metadata and controls

334 lines (248 loc) · 8.85 KB

TODO - MVP

  • Clean up imports

  • Add impl Deref for WidgetRef

  • Add downcast to WidgetRef and WidgetView

  • Add WidgetAdded test

  • Rename ContextState to GlobalPassCtx

  • Sort WidgetState fields

  • Remove ExtendDrain

  • Rewrite tests

  • Create coverage profile

  • Look at coverage of every file, write a list of target coverage

  • Add timers to harness

  • Add action queue

  • Re-add ExtEvent + AppDelegate

  • Use WidgetView everywhere

  • Button

  • Checkbox

  • Flex

  • Image

  • Label

  • SizedBox

  • Spinner

  • Portal

  • Implement TextBox

  • Implement Scroll

  • Add text/IME to harness

  • Port TextBox

  • Write unit tests

  • Refactor ScrollComponent / paint_rect / paint_insets

  • Set paint_rect automatically

  • Check that paint_rect has children paint_rect

  • Disambiguate concept of hidden/stashed widgets

  • Refactor different passes

  • Write a WidgetCtx trait

  • Add a WidgetPod::as_mut(ctx: &impl WidgetCtx) method

  • Fix WidgetView type

  • Rename WidgetView to WidgetMut

  • Split WidgetRef into separate file

  • Create StoreInWidgetMut from (Widget, WidgetCtx)

  • Create declare_widget!() macro to implement boilerplate.

  • Write examples

  • To-do List

  • Fix blocking_function example

  • Copy examples from druid

  • Fix doc tests

  • Split off from Druid repo

  • Rename to Masonry

  • Write remaining tasks in Github

  • Rewrite License bits

  • Write ARCHITECTURE.md

  • Write CONTRIBUTING.md

  • Write README.md and doc root

  • Publish

TODO - Next steps

  • Remove Env type and Data trait (#8)

  • Re-add Dialog feature (#25)

  • Switch to using Vello and Glazier (#24)

  • Refactor TextLayout (#23)

  • Rework Widget trait (#26)

  • Write Widget Inspector

  • Port Panoramix to Masonry

  • Port Xilem to Masonry

TODO - Long term

  • Brainstorm names for AppDelegate, Harness methods, Action, ExtEvent

  • Move debug logger to use tracing infrastructure

  • Refactor Mouse Events and hot status changes

  • Remove impl Widget for Box<dyn Widget>

  • Handle request-layout-in-layout corner case

  • Add logo

  • Create project board

  • Refactor WidgetState

  • Add WidgetTmpState

  • Extract WidgetState fields to WidgetTmpState + global state

  • Rework place_child

  • Fix invalidation when computing layout

  • Write analysis of different layout footguns

  • Flex interacting with viewport

  • Does Tennent's Correspondence principle apply to Wrappers in a Flex container?

  • Difference in Harness(Button) vs Harness(Flex(Button))

  • Flex alignment vs text alignment

  • Refactor AppDelegate

  • Ideally, should be a single function (?)

  • Probably unify on_event, on_command, on_action

  • Add WidgetBuilder trait

  • Switch module file conventions (foobar/mod.rs -> _foobar.rs)

  • Add dev shortcuts:

  • To print Widget tree

  • To print current focused/active Widget

  • To display invalidation rect

  • Trait-ify Glazier

  • ??? Start at the bottom?

  • Glazier

  • Rename WinHandler methods

  • size -> resize

  • scale -> rescale

  • command -> select_menu

  • save_as -> save_dialog_res

  • open_file -> open_dialog_res

  • timer -> timer_complete

  • Add replay mode

  • Record platform events

  • Record timers

  • Add way to rr tests

  • Add ability to select rectangular region, get a list of Widget in return or something.

  • Add "click all visible buttons" method to help test examples.

  • Switch to ECS

  • Remove WidgetId::reserved, move WidgetId::new

  • Drag 'n Drop

  • Add fuzzing

  • Check Masonry invariants

  • Create fuzzing suite

  • Test it with intentional bugs

  • Add profiling

  • Add artinasal timings manager

  • Start in separate crate with artificial benchmarks

  • Add "median/worst FPS" log at the end of each run.

  • Write benchmarks

  • Try to find ways to bust the framework's framerate

  • Huge list

  • Huge list with editable/focusable boxes

  • ???

  • Refactor Command infrastructure

  • Broadcast (used multiple times)

  • Command (used once)

  • ???

  • Add on_command() trait method

  • Unify timers and promises

  • Reintroduce Env type (?)

  • Remove Data trait

  • Make it so that required keys are known at launch time for better error messages.

  • Re-add Localization

  • Get better coverage on Github Actions

  • Take inspiration from druid's Actions

  • Improve how Harness mocks IME

  • Handle in-place editing (eg Kanji input, I think?).

  • Handle movement (eg ctrl+left).

  • Merge WidgetMut and Ctx lifetimes

  • Note: probably requires better language support for implicit lifetime bounds

Tests to write

  • event
  • promise
  • utils
  • widget_pod -> [X] 'active' status -> [X] debug_validate -> [X] check_initialized -> [X] check set_origin -> [X] MouseLeave -> [X] layout changes hot status -> [ ] paint_insets -> [ ] pan_to_child -> [ ] ParentWindowOrigin -> [ ] debug_widget_text -> [x] check for WidgetAdded -> [X] widget utils -> [X] Widgets -> [X] Button -> [X] Checkbox -> [X] Portal -> [X] Flex -> [X] Image -> [X] Label -> [X] SizedBox -> [X] Spinner -> [ ] FillStrat -> [ ] text -> [ ] TextBox

Design stuff

What referential are various values using?

transform_scroll translates mouse events

General note: add hover detection everywhere. It's what makes the UI feel alive.

Flex stuff

Flex algo

  • Does Tennent's Correspondence Principle apply to Wrappers in a Flex container?
  • Visualize how much "spring" each element has

Difference between

  • Window(Button)

  • Window(Flex(Button))

  • Flex(stuff)

  • Portal(Flex(stuff))

Flex alignment vs text alignment

Portal.must_fill, Portal.constrain_horizontal, Portan.constrain_vertical

In druid Spinner needs parent constraints to decide its size. Feels like that shouldn't be allowed.

Use "It's a Wonderful World boardgame"-inspired pass order.

See this thread: https://xi.zulipchat.com/#narrow/stream/147922-new-members/topic/Second.20book.20example.20doesn't.20work/

How does Flex interact with Viewport? -> use call context for debugging (wait, what does that mean again?)

Make library of commonly desired layouts

  • Center object vertically
  • Horizontally
  • Side gutters
  • Document format

How do make easily-readable test of Flex, FillStrat layout?

Passes

Passes have access to

  • on_event -> mut self, mut ContextState, WidgetState., mut WidgetState., mut WidgetState., get_widget_view()
  • on_status_change -> mut self, ContextState, WidgetState., mut WidgetState., WidgetState.
  • lifecycle -> mut self, mut ContextState, WidgetState., mut WidgetState., mut WidgetState., get_widget_view()
  • layout -> self, mut ContextState, mut WidgetState., WidgetState., WidgetState.
  • paint -> self, mut ContextState, mut WidgetState., WidgetState., WidgetState.
  • WidgetView -> mut self, mut ContextState, WidgetState., mut WidgetState., mut WidgetState., get_widget_view()

WidgetAdded and similar events are an anti-pattern. Constructors should stand on their own. (is it actually possible though?)

Pointer status

Default(Option(cursor)) Active(Option(cursor)) Disabled Hidden

See https://xi.zulipchat.com/#narrow/stream/147926-druid/topic/.22hot.22.20in.20the.20presence.20of.20multiple.20pointers/near/254524486

Invariants

Druid invariants

  • layout != .layout => request_layout() has been called
  • child.origin != .child.origin => request_layout() has been called
  • != . => request_paint() has been called
  • children() != .children() => children_changed is set
  • !event.handled && hovered || self.has_focus => recurse event
  • lifecycle => recurse lifecycle
  • !is_hidden() => recurse layout
  • !is_hidden() && is_visible() => recurse paint
  • is_focusable => must be const
  • ids are unique

Profiling

Record spans, with:

  • pass name
  • widget id
  • work type
  • useful/redundant/testing
  • include-recursed-time-in-total-time

-> percentage of work that is useful -> what type of work

Debug info

  • Isolate subgraph of trace during errors

Event debug info:

  • layout during event
  • tree of visited widgets
  • respective mouse pose

Widget Debuggging

  • Need to see the layout tree at any given point
  • Need to see which subwidgets were not rendered and why
  • Need to see the properties of each widget at render time both graphically and in text form

Resource handling

See swift proposal https://github.com/apple/swift-evolution/blob/main/proposals/0271-package-manager-resources.md