-
Notifications
You must be signed in to change notification settings - Fork 9
Analyze plugin #147
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: release/v3
Are you sure you want to change the base?
Analyze plugin #147
Conversation
|
Important Installation incomplete: to start using Gemini Code Assist, please ask the organization owner(s) to visit the Gemini Code Assist Admin Console and sign the Terms of Services. |
Aiosa
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good code quality and mostly respects the viewer API. Good job! just a few fixes. Also, please, lets discuss whether SidePanel is really a valid new component, or whether it is something that the UI system already provides before mergning.
| "version": "1.0.0", | ||
| "description": "Plugin for creating and running jobs", | ||
| "icon": null, | ||
| "includes" : ["newAppForm.mjs", "analyzeDropdown.mjs"], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can include only main file, import/export is handled by browser automatically. This will preload the files no matter whether they are needed or not, browser will do it dynamically. Just FYI no need to change.
| super(id); | ||
| this.params = params || {}; | ||
| // plugin-level stored recent jobs can be configured via params or saved options | ||
| this.recentJobs = this.getOption('recentJobs') || this.params.recentJobs || []; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Params are already read from using getOption so avoid touching params directly for this matter.
| pluginReady() { | ||
| const register = () => { | ||
|
|
||
| if (!window.USER_INTERFACE || !USER_INTERFACE.AppBar || !USER_INTERFACE.AppBar.menu) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bad alignment.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, user interface should be already available, if it is not, it is a bug.
| } | ||
|
|
||
| // safe translation helper: return translated value or fallback when missing | ||
| const tOr = (key, fallback) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you need this generic 'safe' utility, we should put this function to the CORE api, not here... Why is typeof $?.t === 'function' needed? It should be always defined.
| return false; | ||
| }; | ||
| // Try immediate attach; if DOM not present yet, retry shortly | ||
| if (!attachToggle()) setTimeout(attachToggle, 50); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Again, DOM should be already ready at pluginReady
| attachTo(element) { | ||
| this.refreshClassState(); | ||
| this.refreshPropertiesState(); | ||
| this.refreshClassState(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Padding
| return; | ||
| } | ||
|
|
||
| if (!(mount instanceof Node) && typeof mount.append !== 'function') { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Duplicated code, it should be possible to get a reference to a node element to attach above, and resolve this logics just once.
| * | ||
| * @param {...any} properties - functions to set the state of the component | ||
| */ | ||
| set(...properties) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is this method removed? Did you check that it is not used?
| */ | ||
| _applyOptions(options, ...names) { | ||
| // internal helper: call provided option functions in the component context | ||
| try { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Useless try-catch
| * SidePanel: small reusable fixed-position panel that plugins can show near an anchor. | ||
| * Simple API: constructor(options), attachToBody(), setBody(node|string), showAt({left,top}), hide(), remove(). | ||
| */ | ||
| class SidePanel extends BaseComponent { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you show me usage of this panel? Is it nececssary to have this menu-like component, or are there other components already that implement this logics? Form the name it sounds to me like there are.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, you are right. After reviewing the other components, it seems like Menu should be sufficient for this use case.
|
So what are we going to do with this PR? Is it used somehow? |
|
Analyze dropdown is used for selecting app via 'Apps' tab (not pushed yet). 'Run recent jobs' and 'Create new app' tabs do not have functionality as of now. |
|
there are still many issues not resolved from my last comments. Please fix all of them. Reolsve the conflicts here, and add a PR with all your logics implemented up till now so I can give a good feedback, |
No description provided.