Open
Bug 1288347
Opened 8 years ago
Updated 2 years ago
inspector toolsidebar: add addPanelTab method to load react panel
Categories
(DevTools :: Framework, enhancement, P3)
DevTools
Framework
Tracking
(Not tracked)
NEW
People
(Reporter: gasolin, Unassigned)
References
(Blocks 1 open bug)
Details
Attachments
(2 files)
2.55 KB,
patch
|
Honza
:
feedback+
|
Details | Diff | Splinter Review |
5.68 KB,
image/png
|
Details |
As the prework of convert Devtools inspector Sidebar panels to react components,
we need a way to load sidebar panel as react component.
The proposal is add a toolsidebar::addPanelTab method to load the react panel from inspector-panel.js
In toolsidebar.js: add addPanelTab to add react panel into _tabbar
> ...
> addPanelTab: function (id, title, selected, reactPanel) {
> this._tabbar.addTab(id, title, selected, reactPanel);
> this.emit("new-tab-registered", id);
> },
In inspector-panel.js - instance react panels and pass through addExistingTab
> import react panel1
> import react panel2
>
> let rulePanel = this.React.createFactory(panel1({attr}));
>
> this.sidebar.addExistingTab(
> "fontinspector",
> strings.GetStringFromName("inspector.sidebar.fontInspectorTitle"),
> defaultTab == "fontinspector",
> rulePanel);
Then we could make each sidebar react panel instead of using inspector-tab-panel.js.
Honza, does it make sense?
Reporter | ||
Comment 1•8 years ago
|
||
We'd create a meta bug for `convert Devtools inspector Sidebar panels to react components` that contain this one and each react side panel bugs.
Flags: needinfo?(odvarko)
Version: 48 Branch → unspecified
Reporter | ||
Comment 3•8 years ago
|
||
Here's the demo of how tab works with react component
I create a `hello` react component for demo purpose, which will show at the end of the side panel.
Attachment #8773616 -
Flags: feedback?(odvarko)
Reporter | ||
Comment 4•8 years ago
|
||
screenshot of hello side panel (write with react)
Comment 5•8 years ago
|
||
(In reply to Fred Lin [:gasolin] from comment #3)
> Created attachment 8773616 [details] [diff] [review]
> 0001-demo-add-addPanelTab-method-to-load-react-panel.patch
>
> Here's the demo of how tab works with react component
>
> I create a `hello` react component for demo purpose, which will show at the
> end of the side panel.
Looks good to me, but note that bug 1288400 isn't part of the devtools.html track 2 MVP at the moment.
Honza
Updated•8 years ago
|
Attachment #8773616 -
Flags: feedback?(odvarko) → feedback+
Severity: normal → enhancement
Priority: -- → P3
Updated•8 years ago
|
QA Contact: cristian.comorasu
Updated•6 years ago
|
Product: Firefox → DevTools
Updated•2 years ago
|
Severity: normal → S3
You need to log in
before you can comment on or make changes to this bug.
Description
•