nus-cs2103-AY2223S2 / forum

12 stars 0 forks source link

Fixing bug in Ui by refactoring Ui implementation #328

Closed arkarsg closed 1 year ago

arkarsg commented 1 year ago

Our application has multiple tabs for different views implemented by TabPane which has a StackPane containing a ListView (ie multiple tabs of how AB was implemented, put simply).

We have the following command tab t/TAB which switches to view to TAB that works as intended. However, this breaks when user uses mouse followed by tab command or vice versa, where different StackPanes overlap.

Example of “bug” with overlapping views when users use a mix of CLI and mouse-click: Screenshot 2023-04-04 at 11 52 39 PM

I suspect that this unintended behaviour maybe due to our implementation where TabPane extends UiPart<Region> while Tab is declared within the TabPane (without its own fxml file), causing Tab to have a different Controller vs TabPane’s controller from T extends UiPart<Region>.

I would like to clarify if this is considered a bug or a feature flaw, and which of the following “fix” should be recommended:

  1. Clearly state in the UG to only use CLI command.
  2. State in the UG and set tab as unclickable (technically a Ui change?)
  3. Refactor Tab to extend UiPart<Region> (with additional fxml files) so that both mouse click and CLI command is handled with the same Controller.
damithc commented 1 year ago

@arkarsg Based on the screenshot, the impact of the glitch seems too severe to ignore. Asking users to use only the CLI when the tabs are clickable (and clicking on tabs is second nature to users) does not sound reasonable either. So, you may go for 2 or 3 but keep in mind that the more you change the code, the higher the risk of regressions.

arkarsg commented 1 year ago

Thank you Prof for the quick reply!