-
-
Notifications
You must be signed in to change notification settings - Fork 3
Updates for GNOME Shell 49 and improves logging #20
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: main
Are you sure you want to change the base?
Conversation
Applies formatting changes based on updated Prettier configuration. Refactors code for improved readability and maintainability by removing unnecessary imports and simplifying code structures.
Updates metadata to support GNOME Shell version 49. Replaces direct `console.error` and `console.log` calls with the extension's logger for better debugging and consistency.
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.
Pull Request Overview
This PR updates the extension for GNOME Shell 49 compatibility and standardizes logging through the extension’s logger.
- Bumps
shell-version
andversion-name
in metadata for Shell 49 support - Replaces all
console.log
/console.error
calls withthis.getLogger().log
/.error
- Applies one-line formatting to several
.connect()
calls and adds editor/formatter configs
Reviewed Changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 3 comments.
Show a summary per file
File | Description |
---|---|
prefs.js | Swapped out console.* for this.getLogger() and inlined connects |
extension.js | Replaced console.error with this.getLogger().error and inlined calls |
menu_items.js | Condensed if and removed formatting around array splices |
metadata.json | Updated shell-version to include "49" and bumped version-name |
.prettierrc | Added printWidth and bracketSameLine options |
.editorconfig | Introduced basic EditorConfig rules with indent settings |
Comments suppressed due to low confidence (1)
[email protected]/prefs.js:265
- [nitpick] Variable
buttonfilechooser
uses inconsistent casing compared to other camelCase identifiers. Rename tobuttonFileChooser
for clarity and consistency.
buttonfilechooser.set_tooltip_text(_("Usually located in '/usr/share/applications'"));
_(_settings.get_string("label-menu")), | ||
"" | ||
); | ||
this.menu.setHeader("preferences-other-symbolic", _(_settings.get_string("label-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.
[nitpick] You’ve wrapped a translated string in another translation call (_(_settings.get_string(...))
). Consider using a single _()
invocation or passing the already translated string directly.
Copilot uses AI. Check for mistakes.
(posRel < 0 && index > 0) || | ||
(posRel > 0 && index < items.length - 1) | ||
) { | ||
if ((posRel < 0 && index > 0) || (posRel > 0 && index < items.length - 1)) { | ||
let temp = items[index]; | ||
items.splice(index, 1); | ||
items.splice(parseInt(index) + posRel, 0, temp); |
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.
Using parseInt
on index
(already a number) is unnecessary. You can simplify to items.splice(index + posRel, 0, temp);
.
items.splice(parseInt(index) + posRel, 0, temp); | |
items.splice(index + posRel, 0, temp); |
Copilot uses AI. Check for mistakes.
const errorLog = (...args) => { | ||
this.getLogger().error("Error:", ...args); | ||
}; | ||
const handleError = (error) => { | ||
errorLog(error); | ||
return null; | ||
}; | ||
const appRow = await myAppChooser.showChooser().catch(handleError); |
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’ve redefined errorLog
and handleError
inside this click handler only. Consider extracting them into a shared helper or method to avoid duplication and improve reuse.
const errorLog = (...args) => { | |
this.getLogger().error("Error:", ...args); | |
}; | |
const handleError = (error) => { | |
errorLog(error); | |
return null; | |
}; | |
const appRow = await myAppChooser.showChooser().catch(handleError); | |
const appRow = await myAppChooser.showChooser().catch(this._handleError.bind(this)); |
Copilot uses AI. Check for mistakes.
Extends the install script to allow creating a zip file through the "pack" argument, mirroring the functionality of the "zip" argument. This provides more flexibility in how the extension is packaged.
6a1269a
to
32d95a3
Compare
Corrects the extension installation process by using the correct zip file name, ensuring proper installation and activation. Simplifies menu item parsing by directly accessing the split data, improving code readability and maintainability.
Updates the extension to be compatible with GNOME Shell 49.
console.error
andconsole.log
calls with the extension's logger for better consistency and control over logging.