Skip to content

Conversation

@FilipVrubel
Copy link
Collaborator

No description provided.

@gemini-code-assist
Copy link

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.

@FilipVrubel FilipVrubel requested a review from Aiosa November 4, 2025 09:37
Copy link
Member

@Aiosa Aiosa left a 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"],
Copy link
Member

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 || [];
Copy link
Member

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) {
Copy link
Member

Choose a reason for hiding this comment

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

Bad alignment.

Copy link
Member

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) => {
Copy link
Member

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);
Copy link
Member

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();
Copy link
Member

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') {
Copy link
Member

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) {
Copy link
Member

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 {
Copy link
Member

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 {
Copy link
Member

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.

Copy link
Collaborator Author

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.

@Aiosa
Copy link
Member

Aiosa commented Dec 18, 2025

So what are we going to do with this PR? Is it used somehow?

@FilipVrubel
Copy link
Collaborator Author

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.

@Aiosa
Copy link
Member

Aiosa commented Dec 19, 2025

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,

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.

3 participants