Skip to content

Added Preview Tab Feature#2474

Merged
skylot merged 3 commits intoskylot:masterfrom
MrIkso:preview_tab
May 4, 2025
Merged

Added Preview Tab Feature#2474
skylot merged 3 commits intoskylot:masterfrom
MrIkso:preview_tab

Conversation

@MrIkso
Copy link
Copy Markdown
Contributor

@MrIkso MrIkso commented May 3, 2025

This PR adds feature named as "Enable Prewiew Tab" taken from Inteliji Idea. Tab is opened with the content of the node, but if we click on another node, the content of these tab is replaced by the new one and if existing opened node , we a jumped to it.
Close #756

java_FZccUA0NEg.mp4

@skylot
Copy link
Copy Markdown
Owner

skylot commented May 4, 2025

@MrIkso looks good, thank you 👍

Some possible improvements for future 🤣:

  • add toolbar icon to switch and view 'preview tab' state
  • after reload tab lost a 'preview' state and click on class in tree will open a new preview tab
  • 'pin' and 'bookmark' states on preview tab also lost after opening new class
  • improve code to reduce boolean fromTree, boolean preview and other boolean flags in many methods, such code harder to understand. Possible solution is a flags enum or additional class to hold all open tab options.

@skylot skylot merged commit 47647bb into skylot:master May 4, 2025
4 checks passed
@MrIkso
Copy link
Copy Markdown
Contributor Author

MrIkso commented May 4, 2025

@skylot

add toolbar icon to switch and view 'preview tab' state

I dont like if toolbar has more buttons. Maybe use hot keys

'pin' and 'bookmark' states on preview tab also lost after opening new class

maybe it need (?)

after reload tab lost a 'preview' state and click on class in tree will open a new preview tab

improve code to reduce boolean fromTree, boolean preview

these problems are interconnected, I was trying to come up with logic to implement a preview only for opening from the tree, so I quickly wrote it so as not to break the other tab logic, which is somehow strangely implemented

@skylot
Copy link
Copy Markdown
Owner

skylot commented May 4, 2025

I dont like if toolbar has more buttons. Maybe use hot keys

One additional icon will not hurt.
Also, a new icon is the only way to let users discover this new feature, because no one will check all menus for new entries 🤣

maybe it need (?)

Not sure what you mean, but pin and bookmark actions just don't work for preview tabs right now, and this is definitely not good. Especially for bookmark because it lost after open another class 😢

tab logic, which is somehow strangely implemented

Well, current approach with listeners of tab events needed because there are many listeners, so I don't know a better solution for now. And 'preview' should be just an additional tab state along with 'pin' and 'bookmark' which passes in these tab events.

@MrIkso MrIkso deleted the preview_tab branch May 14, 2025 22:15
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.

[feature] Add an option to have a "preview mode"

2 participants