What is the current Panel Architecture at v5? #1763
Unanswered
swiftness9
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I am trying to make a patch that allows to have the tabs globally referenced as in point 2. of #1732 (comment) but have been having problems identifying how are panels created and destroyed.
By some browser inspecting I managed to track-down the new panel popup to the file
src/sidebar/components/popup.panel-config.vue
, which contains the functiononSave
which creates a new panel, add it to the variableSidebar.panelsById
, callsSidebar.recalcPanels()
, then goes toSidebar.recalcTabsPanels()
(in the relevant case), which both look live recalculate the GUI, finally callsSidebar.saveSidebar(300)
, which looks like updates the global storage of sidebar configuration, as well sends the notification of the change to every window.Tracking down this signal I found it is finally handler by
storageChangeListener
fromsrc/services/storage.ts
, which looks like a dead end in all ways, as modifies suchchangeHandlers
which is basically an empty set. (Problem 1)I noted that tabs are stored by sidebar page at the "global" variable
Sidebar.Tabs
, which is manipulated by operations likemove
atsrc/services/tabs.fg.move.ts
, which for example for bringing tabs from another windows indirectly relies indetachTabs
fromsrc/services/tabs.fg.move.ts
, which relies inSidebar.recalcTabsPanels()
to update the panel local panel state of the window that will have their tab deattached, as well asmove
relies inSidebar.recalcTabsPanels()
to update panel GUI of local sidebar page.I think that I now more of less how tabs are managed in this codebase, thus I think that I have a very clear idea of what do to with them to implement this feature, but have not very clear how panels are managed, specially how they are activated or disable with respect of when they are enabled and disable, thinks like
recalcTabsPanels
atsrc/services/sidebar.actions.ts
, can look prima facie that do the work, and probably are part of the work, but give no much of a hint of the procedure, this is not made easier by the fact that is basically impossible to set a Firefox debug session does not make it easier. (Also the templates don't give a very good hint of what is happening, maybe because is my first real time with Vue).Thus the question: How are managed the panels is this codebase/ What is the architecture?
For what I have seen, looks a massive work would be have to be done to move the state from being individual between the different windows, to be a global state managed by the background process. (Maybe some help would be appreciated, some partner?)
Beta Was this translation helpful? Give feedback.
All reactions