Vis4Sense / HistoryMap

http://sensemap.io
45 stars 7 forks source link

Activate tab on clicking tree node #148

Closed Yuu-Han closed 1 month ago

Yuu-Han commented 5 months ago

It is easy to find and activate a page that has the same url with the node (or create a new one if it is already closed), but a bit tricky to maintain hmPages. My major concern is how to maintain tabId.

Considering the following scenario:

The user navigated through multiple pages (i.e., p1, p2, ...) within the tab, which results in multiple hmPages with the same (tab) id. When the user clicks node p1, the page is closed but the tab is still active, so there are some options:

(There are similar issues with opening a closed page.)

For option 1 & 2, new nodes are to be added from p1, but what if the user opens another p2' that has the same url with p2? is p2' going to be a new child node or should it be merged with p2? Also, if the tab id is changed, hmPages might not be enough for saving the session (for debug aim)?

kaidatavis commented 5 months ago

Very good point. I think there are two parts of this, 1) where to (re)open the page/url, and 2) how to update the (internal) data structure (hmPages).

For 1), my preference is probably open it in a new tab; updating an existing tab may cause the user to lose something that he/she still needs.

For 2), it is a bit trickers. First, if user opens the same url in a new tab, I think this should be treated as a new node in historyMap. For example, user can open multiple google search pages and each for a different topic; it does not make much sense to me to include all the google search starting page as one node.

I am not sure how best to update hmPages; maybe branch off from the old node will be the better option? We can discuss this at the meeting.

Yuu-Han commented 1 month ago

This is completed. Clicking an opened page will activate the corresponding tab and clicking a closed page will open a new tab. The original hmPage object is updated (not adding a new node to hmPages).