As currently implemented, features like whether to bring up new tabs vs. windows are tied specifically to whether it is running on mobile or desktop. For example, this line of code:
If we want to change the behavior on a device, e.g., make it do tabs on the desktop, we have to go in and change many lines of code, everywhere this is checked.
If we want to make it dynamic, e.g., by adding an option in the options page to let the user pick which they want, we can't do that since it is hard coded everywhere by device type.
Propose:
Any such feature should be triggered with a specific flag for just that feature. In this case some sort of flag for new window type, which can be new tab or new window (and maybe in the future could be current page, in case we need that?)
The defaults for each feature can be set by device type, as currently detected, but then this is done in only one place.
With that setup, the two problems listed above are resolved, and the code is much more flexible.
@21satvik Are there other such things we have effectively hard coded in this way? If so, work items should be logged for them as well.
As currently implemented, features like whether to bring up new tabs vs. windows are tied specifically to whether it is running on mobile or desktop. For example, this line of code:
https://github.com/Shared-Reality-Lab/IMAGE-browser/pull/350/files#diff-11db236acd6b02b1229e7d325e9bf8edb521032e6388f68b6a884ec24bbe291fR475
This has two problems:
Propose:
With that setup, the two problems listed above are resolved, and the code is much more flexible.
@21satvik Are there other such things we have effectively hard coded in this way? If so, work items should be logged for them as well.