I wonder if there is a checklist somewhere for a r...
# compose-desktop
o
I wonder if there is a checklist somewhere for a reusable desktop component to check against. Like, accessibility, focus, RTL, etc. If anyone has their own, can you share it maybe?
j
Other good ones: • Can the widget be rendered side-by-side with itself (no global state) • Can the widget be removed from the hierarchy and re-added somewhere else without losing important information (no local state / don't use
remember
for anything important)
🙏 2
o
Last one about removed/re-added I didn’t quite get, could you elaborate? Do you mean using it as an item in lazy list and alike?
j
Yeah, lazy-list is one example, "shared element transition" is another. You can manually test by creating two different parents (eg. a row and a column), and try moving the widget from the row to the column and see if any important state gets lost or anything about the widget visually changes.
Copy code
if(myBoolean) Row { MyWidget(data) } else Column { MyWidget(data) }
Interact with the widget (enter some text, click some buttons, interact with your widget, whatever your widget does). Anything that changes the state of your widget. Then flip the boolean. If anything changes when you flip the boolean, you've got a problem.
o
Got it, thanks. Any other ideas? 🙂