Skip to content

Comments

Preset app icon #61#64

Open
itota wants to merge 2 commits intobitfocus:masterfrom
itota:feature/app-icon
Open

Preset app icon #61#64
itota wants to merge 2 commits intobitfocus:masterfrom
itota:feature/app-icon

Conversation

@itota
Copy link
Contributor

@itota itota commented Sep 18, 2025

Implemented without using external modules.
Overlaying text on icons poses a challenge: depending on the icon's color, the text may become unreadable. For now, I'll open a pull request for sharing code.

@peternewman peternewman linked an issue Sep 20, 2025 that may be closed by this pull request
Copy link
Collaborator

@peternewman peternewman left a comment

Choose a reason for hiding this comment

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

Just some minor comments

}
}

;(async () => {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Is the leading semicolon some weird prettier quirk (I've seen similar before)?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes

Comment on lines +224 to +227
;(async () => {
await Promise.allSettled(promises)
self.initPresets()
})()
Copy link
Collaborator

Choose a reason for hiding this comment

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

I'm not hot enough on my async/promise stuff; will this function block until the promise is resolved and not allow program flow to continue, or will it do it in the background as it's async? Are we fine because the await is inside an async?

I was just thinking it would be good to initPresets beforehand too, but that's irrelevant if it runs in the background...

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Once all promises are resolved, the presets will be updated. Since this is local communication, it is assumed that all promises resolve immediately, allowing the presets to be updated in bulk.
Before retrieving icons, initPresets is executed. Once all icons have been successfully retrieved, initPresets is executed again.

for (let i = 0; i < (this.CHOICES_APPS || []).length; i++) {
let app = this.CHOICES_APPS[i]
presets[`select_app_${i}`] = {
const preset = {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Ah, the mutable Javascript const!

Out of curiosity, what's the benefit of the preset over just putting the properties directly into the one we were creating before?

Co-authored-by: Peter Newman <peternewman@users.noreply.github.com>
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.

Add image support for apps

2 participants