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

fix(gui): Quick Tabs Optimization #2242

Merged
merged 6 commits into from
Aug 30, 2024
Merged

Conversation

Mino260806
Copy link
Contributor

Follow-up to PR #2241

  • Optimize tabs reorder
  • Redirect all calls that open tabs to TabsController

Should we also move JumpManager, navBack and navForward to TabsController ? I'm hesitating because it's something particular to TabbedPane

@skylot
Copy link
Owner

skylot commented Aug 7, 2024

Should we also move JumpManager, navBack and navForward to TabsController ?

I think we can make it independent: new class (JumpsController?) to listen tabs changes and code jumps with ITabsStatesListener, record these jumps into JumpManager, and on back/forward actions calls TabsController methods. One downside here is that we need to use currentPosition() from TabbedPane to save jump origin, but current position is tied to editor actually not to tabs, so it is already weird to have such method in TabbedPane 🤣 So maybe we can move this method to new JumpsController 🤔

@Mino260806
Copy link
Contributor Author

(added NavigationController in last commit, sorry for wrong commit message)

Anything else that needs refactoring ?

@skylot
Copy link
Owner

skylot commented Aug 13, 2024

Anything else that needs refactoring ?

No, I think all good now.
I will review and test current changes (maybe tomorrow, actually) and we can merge this PR.

@skylot
Copy link
Owner

skylot commented Aug 14, 2024

I think all good now

And next I trigger some error without exception and spend lots of time debugging it 🤣
Exception was lost in the threads of background executor, adding more try/catch helps to reveal it (fix in de26dc9).
Anyway, I made some changes:

  • use of default methods in ITabStatesListener helps to reduce empty methods in implementations
  • make NavigationController listen tabs events, so it is really independent now
  • move code of "sync with editor" feature into separate class
  • add LogTabStates class to debug tab states events (helps understand order of similar action like select, open, codejump)
  • another attempt to impove onTabsReorder
  • resolve some NPEs
  • resolve merge conflict

@skylot
Copy link
Owner

skylot commented Aug 14, 2024

@Mino260806 please check my changes, I think we can merge this PR 🙂

@skylot
Copy link
Owner

skylot commented Aug 30, 2024

@Mino260806 I will merge this PR. It contains a lot of good changes and fixes.

@skylot skylot marked this pull request as ready for review August 30, 2024 19:32
@skylot skylot merged commit 9a39b70 into skylot:master Aug 30, 2024
5 checks passed
@Mino260806
Copy link
Contributor Author

Sorry I had no time to check it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants