Skip to content

fix: Cleared the query string for the room view model when switching tabs#166

Draft
floormatgen wants to merge 1 commit intomainfrom
BUG#145-filtering-in-rooms-tab-also-filters-rooms-in-buildings-tab
Draft

fix: Cleared the query string for the room view model when switching tabs#166
floormatgen wants to merge 1 commit intomainfrom
BUG#145-filtering-in-rooms-tab-also-filters-rooms-in-buildings-tab

Conversation

@floormatgen
Copy link
Copy Markdown
Collaborator

What

The search query for rooms is reset when leaving the rooms tab, which prevents it from affecting building room results in the buildings tab.

This is a temporary solution, as the tabs should not be sharing a view model. A more permanent solution would be to use VISOR ViewModel factories. That would be a more permanent solution.

Why

If the user entered a search query for rooms in the rooms tab, it would persist to the rooms tab as they shared a view model. By resetting the search query when the tab is switched, it can't affect room results in the Building tab.

How

Added the .onDisappear(_:) view modifier to RoomTabView, which sets the search text to an empty string.

Key checks:

  • 🚩Attached screenshot or recording of the changes in related tickets
  • Code comments where needed
  • No new warnings

Automated tests:

  • 🚩Unit tests added

Manual tests:

  • Big iPhone (iPhone 17 Pro Max)
  • Small iPhone (iPhone SE)

Screenshot / Recording

N/A

…tabs

This is a temporary solution, as the tabs should not be sharing a view model. A more permenant solution would be to use VISOR ViewModel factories.
Copy link
Copy Markdown
Contributor

@DickoEvaldo DickoEvaldo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

temporary fix for the issue keep the issue up on github. you already have the right idea to seperate the view model maybe you can do that after this

@floormatgen
Copy link
Copy Markdown
Collaborator Author

Might ask @avdn-dev if this is already fixed in the VISOR refactor or if I should do it instead.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

BUG: Filtering in rooms tab also filters rooms in buildings tab

2 participants