tg icon indicating copy to clipboard operation
tg copied to clipboard

Load the last visited application view upon startup with a default URI

Open 01es opened this issue 2 years ago • 0 comments

Description

If a user loads a TG-based application with a default URI, such as https://tgdev.com, the application should immediately open the last visited view. Such "last visited view" could be the main menu itself or any of the module menus, opening an Entity Centre or a Custom View. Such support would provide users with a convenience of "returning to where they were last".

The restriction to perform such automatic navigation only upon loading the application using the default URI, is critical not to upset the functionality of opening specific parts of an application using URIs.

The last navigated to or used view should be stored in a local store for the currently logged in user. However, it would be best if users could control this behaviour, and if not to their liking, be able to turn it off.

image

Persistent entity UserSettings (one-2-one with User) should be introduced and have a simple master, which would get invoked when the "user" icon is tapped. At this stage, there needs to be 2 boolean properties openLastNavigatedTo: boolean and openLastUsed: boolean, which can both be false, but not true. The compound User Master should include an embedded master for UserSettings.

UserDao.save needs to be updated to create and persist an instance of UserSettings for every new user. UserDao.batchDelete needs to be updated to delete UserSettings before deleting a user.

Expected outcome

A convenience of returning to where the user was last.

01es avatar Mar 29 '23 03:03 01es