https://kotlinlang.org logo
#compose-desktop
Title
# compose-desktop
o

orangy

07/15/2022, 8:28 AM
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

jim

07/15/2022, 9:05 AM
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

orangy

07/15/2022, 9:08 AM
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

jim

07/15/2022, 9:17 AM
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

orangy

07/15/2022, 11:38 AM
Got it, thanks. Any other ideas? 🙂
2 Views