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

Encode visible tab on historymap #169

Closed
Yuu-Han opened this issue May 29, 2024 · 5 comments
Closed

Encode visible tab on historymap #169

Yuu-Han opened this issue May 29, 2024 · 5 comments

Comments

@Yuu-Han
Copy link
Collaborator

Yuu-Han commented May 29, 2024

This helps to locate the current tab on historymap.

@Yuu-Han
Copy link
Collaborator Author

Yuu-Han commented Jun 8, 2024

b0b1136

When a tab is activated, try to locate the page in hmPages

  • If the page is found (same tab id, same url), set the node as visible and scroll to it
  • Otherwise, add a virtual node to the bottom of the hm tree
    • How to save the node? Automatically add it to the array or let the user decide?
  • Related to Remind user when a new tab use the same URL as an existing one. #171, ideally if a page with the same url but different tab id is found, we should remind the user.

Issues:

  • The chrome.tabs.onActivated event might be fired earlier than chrome.webNavigation.onCommitted event. In this case, when a new page is opened, both the newly added node and the virtual node are displayed.
    • Fixed, not using virtual node (ffc7522), update visibility of reopened page (d2b1369)
  • The visible node is not updated when the new page is opened in the same tab (as no new tab is created, there is no tab activate event).

@kaidatavis
Copy link
Collaborator

Is it possible that an activated tab is not a node in history map?

@Yuu-Han
Copy link
Collaborator Author

Yuu-Han commented Jun 10, 2024

Yes. The current behaviour is adding a virtual node.

  • Otherwise, add a virtual node to the bottom of the hm tree
    • How to save the node? Automatically add it to the array or let the user decide?

I haven't decided whether to directly add it to hmPages or add on user's demand.

@Yuu-Han
Copy link
Collaborator Author

Yuu-Han commented Jun 11, 2024

Decision: add the page to hmPages on activating the tab.

@Yuu-Han
Copy link
Collaborator Author

Yuu-Han commented Jun 11, 2024

Fixed issues in #169 (comment).

@Yuu-Han Yuu-Han closed this as completed Jun 11, 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