Skip to content

Commit created for review - #1

Open
SimonGenin wants to merge 1 commit into
mainfrom
review
Open

Commit created for review#1
SimonGenin wants to merge 1 commit into
mainfrom
review

Conversation

@SimonGenin

@SimonGenin SimonGenin commented Jan 10, 2023

Copy link
Copy Markdown
Collaborator

Do not merge

Only created to make comments about all the code.

Comment thread .editorconfig
continuation_indent_size = 2
charset = utf-8
trim_trailing_whitespace = false
insert_final_newline = false No newline at end of file

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add blank last line every place there is this symbol.

Comment thread README.md
Comment on lines +1 to +37
# 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

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess we'd better write something correct coming up to the first release.

Comment thread .npmrc
Comment on lines +1 to +2
@fortawesome:registry=https://npm.fontawesome.com/
//npm.fontawesome.com/:_authToken=FONT-AWESOME-PACKAGE-FONT-AWESOME-PACKAGE-FONT-AWESOME-PACKAGE-FONT-AWESOME-PACKAGE-TOKEN

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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"});

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this.state = useState({ status: "not_found" })

});
}

static template = "popup.popup_app";

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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" };

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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)

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So you would have a nice => this.state.enable = await getOwlStatus();

Comment on lines +9 to +30
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: {}
});

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

state

}

toggleDisplay(ev){
ev.stopPropagation();

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

.stop

// })
}
get content(){
return this.props.content;

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

useless

expandBag: {}
});

onMounted(async () => {

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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++) {

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

favor for of loops

Comment on lines +197 to +212
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);
}

@SimonGenin SimonGenin Jan 11, 2023

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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);">

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

feels a bit wild to use css fcts in there

Comment on lines +26 to +29
updateObjectTreeElement.bind="updateObjectTreeElements"
updateBag.bind="updateExpandBag"
expandSubscriptionsKeys.bind="expandSubscriptionsKeys"
editReactiveState.bind="editReactiveState"/>

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

some missmatch with the names

Comment on lines +10 to +12
get componentName() { return this.props.activeComponent.name; }
get activeProperties(){ return this.props.activeComponent.properties; }
get activeSubscriptions(){ return this.props.activeComponent.subscriptions; }

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

meh

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.

1 participant