Currently, RoomInputbar is at the same level in the widget tree as replying_preview, location_preview and editing_pane, they all are inside the keyboard_view:
|
keyboard_view = <KeyboardView> { |
To avoid more and more bloat, duplicate code written on matching MessageAction, it is time to make replying_preview, editing_pane and location_preview a widget of RoomInputBar seperately:
|
match action.as_widget_action().widget_uid_eq(room_screen_widget_uid).cast() { |
Currently,
RoomInputbaris at the same level in the widget tree asreplying_preview,location_previewandediting_pane, they all are inside thekeyboard_view:robrix/src/home/room_screen.rs
Line 619 in 7f68065
To avoid more and more bloat, duplicate code written on matching
MessageAction, it is time to makereplying_preview,editing_paneandlocation_previewa widget ofRoomInputBarseperately:robrix/src/home/room_screen.rs
Line 1780 in 7f68065
Step1, hide other widgets (visible to be false) when any one of the three new widgets is about to show, e.g., when
replying_previewis about to be shown, if any one ofediting_paneandlocation_previewis already opened, and then save its state some where and hide they two widget.Step2, after user finished one widget, the previous widget should be reopened with its latest state we saved some where automatically.