Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Activate tab on clicking tree node #148

Closed
Yuu-Han opened this issue Jan 28, 2024 · 3 comments
Closed

Activate tab on clicking tree node #148

Yuu-Han opened this issue Jan 28, 2024 · 3 comments

Comments

@Yuu-Han
Copy link
Collaborator

Yuu-Han commented Jan 28, 2024

No description provided.

@Yuu-Han
Copy link
Collaborator Author

Yuu-Han commented Jan 28, 2024

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:

  • Option 1: update that tab with p1's url, so that we do not need to update the tab id of p1
  • Option 2: open a new tab and update the tab id of p1
  • Option 3: open a new tab and add it as a new node in the tree

(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
Copy link
Collaborator

kaidatavis commented Jan 29, 2024

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
Copy link
Collaborator Author

Yuu-Han commented May 25, 2024

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).

@Yuu-Han Yuu-Han closed this as completed May 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants