Commit created for review - #1
Conversation
| continuation_indent_size = 2 | ||
| charset = utf-8 | ||
| trim_trailing_whitespace = false | ||
| insert_final_newline = false No newline at end of file |
There was a problem hiding this comment.
Add blank last line every place there is this symbol.
| # Owl Chrome extension | ||
|
|
||
| This app contains the code for a chrome extensions. | ||
| It is separated into the popup app and the devtools app. | ||
|
|
||
| ## Install | ||
|
|
||
| ```bash | ||
| git clone https://github.com/juliusc2066/OWL-Devtools-Extension | ||
| ``` | ||
|
|
||
| ```bash | ||
| npm install | ||
| ``` | ||
|
|
||
| ```bash | ||
| npm run dev | ||
| ``` | ||
| or | ||
| ```bash | ||
| npm run watch | ||
| ``` | ||
|
|
||
| For production: | ||
| ```bash | ||
| npm run build | ||
| ``` | ||
|
|
||
| To run the extension, go to your chrome extensions admin panel and click on `Load unpacked`. | ||
| Select your build folder (generated by rollup) and that's it, your extension is active! | ||
| There is a convenient refresh button on the extension card (still on the same admin page) to update your code. | ||
| Note you may have to open another window to see it working. | ||
|
|
||
| ## Roadmap | ||
|
|
||
| - Tree digging | ||
| - Events tracking |
There was a problem hiding this comment.
I guess we'd better write something correct coming up to the first release.
| @fortawesome:registry=https://npm.fontawesome.com/ | ||
| //npm.fontawesome.com/:_authToken=FONT-AWESOME-PACKAGE-FONT-AWESOME-PACKAGE-FONT-AWESOME-PACKAGE-FONT-AWESOME-PACKAGE-TOKEN |
There was a problem hiding this comment.
Do we still use this ? I guess it came with the starter kit template
|
|
||
| export class PopUpApp extends Component { | ||
| setup(){ | ||
| this.status = useState({value: "not_found"}); |
There was a problem hiding this comment.
this.state = useState({ status: "not_found" })
| }); | ||
| } | ||
|
|
||
| static template = "popup.popup_app"; |
There was a problem hiding this comment.
We're used to name the template as the class, so popup.PopUpApp would be better
| this.status = useState({value: "not_found"}); | ||
| onWillStart(async () => { | ||
| let hasOwl = await getOwlStatus(); | ||
| this.status = { value: hasOwl ? "enabled" : "not_found" }; |
There was a problem hiding this comment.
It feels like this.state.enabled would be the best name. So it's just a boolean (unless there are more than two values somewhere else in the code)
There was a problem hiding this comment.
So you would have a nice => this.state.enable = await getOwlStatus();
| this.state = useState({ | ||
| splitPosition: 60 | ||
| }); | ||
| this.root = useState({ | ||
| name: "Test", | ||
| path: "App", | ||
| key: "", | ||
| depth: 0, | ||
| display: true, | ||
| toggled: false, | ||
| selected: false, | ||
| children: [], | ||
| highlighted: false | ||
| }); | ||
|
|
||
| this.activeComponent = useState({ | ||
| path: "App", | ||
| name: "App", | ||
| subscriptions: [], | ||
| properties: {}, | ||
| expandBag: {} | ||
| }); |
| } | ||
|
|
||
| toggleDisplay(ev){ | ||
| ev.stopPropagation(); |
| // }) | ||
| } | ||
| get content(){ | ||
| return this.props.content; |
| expandBag: {} | ||
| }); | ||
|
|
||
| onMounted(async () => { |
There was a problem hiding this comment.
you probably wanna refactor the content into separate functions for readability
| updateTree(component) { | ||
| let path_array = component.path.split('/'); | ||
| let element = this.root; | ||
| for (let i = 1; i < path_array.length; i++) { |
There was a problem hiding this comment.
favor for of loops
| handleMouseDown = (event) => { | ||
| // Add event listeners for mouse move and mouse up events | ||
| // to allow the user to drag the split screen border | ||
| window.addEventListener("mousemove", this.handleMouseMove); | ||
| window.addEventListener("mouseup", this.handleMouseUp); | ||
| } | ||
|
|
||
| handleMouseMove = (event) => { | ||
| this.state.splitPosition = Math.max(Math.min(event.clientX / window.innerWidth * 100, 85), 15); | ||
| } | ||
|
|
||
| handleMouseUp = (event) => { | ||
| // Remove the event listeners when the user releases the mouse button | ||
| window.removeEventListener("mousemove", this.handleMouseMove); | ||
| window.removeEventListener("mouseup", this.handleMouseUp); | ||
| } |
There was a problem hiding this comment.
any reasons those are not the same "type" of methods ?
| <t t-name="devtools.components_tree" owl="1"> | ||
| <div id="container" t-on-mouseover.stop="removeHighlight" t-on-mouseout.stop="removeHighlight"> | ||
| <div class="split-screen-container"> | ||
| <div class="split-screen-left" t-attf-style="width:calc({{state.splitPosition}}% - 1px);"> |
There was a problem hiding this comment.
feels a bit wild to use css fcts in there
| updateObjectTreeElement.bind="updateObjectTreeElements" | ||
| updateBag.bind="updateExpandBag" | ||
| expandSubscriptionsKeys.bind="expandSubscriptionsKeys" | ||
| editReactiveState.bind="editReactiveState"/> |
There was a problem hiding this comment.
some missmatch with the names
| get componentName() { return this.props.activeComponent.name; } | ||
| get activeProperties(){ return this.props.activeComponent.properties; } | ||
| get activeSubscriptions(){ return this.props.activeComponent.subscriptions; } |
Do not merge
Only created to make comments about all the code.