Skip to content

Update Panel types#120

Merged
schnz merged 1 commit into
gjsify:mainfrom
AmionSky:panel-50
Jun 25, 2026
Merged

Update Panel types#120
schnz merged 1 commit into
gjsify:mainfrom
AmionSky:panel-50

Conversation

@AmionSky

Copy link
Copy Markdown
Contributor

I made the statusArea items optional since they can be undefined, but this is a breaking change which probably affects a lot of users.

Just the simple:

Main.panel.statusArea.quickSettings.addExternalIndicator(this._indicator);

call would become an error, since quickSettings is now an optional field. Though adding a single ? would fix the error.

I don't know If you want that. Should I make some of the fields non-optional?

@schnz

schnz commented Jun 24, 2026

Copy link
Copy Markdown
Member

I'd be fine with the breaking change. To be honest, I don't quite understand from upstream if all roles are practically optional, or just theoretical.

const PANEL_ITEM_IMPLEMENTATIONS = {
    'activities': ActivitiesButton,
    'quickSettings': QuickSettings,
    'dateMenu': DateMenuButton,
    'a11y': ATIndicator,
    'keyboard': InputSourceIndicator,
    'dwellClick': DwellClickIndicator,
    'screenRecording': ScreenRecordingIndicator,
    'screenSharing': ScreenSharingIndicator,
};

For example: Is the screenRecording role only set, e.g., when actually recording a screen and the icon is visible to the user? Or is it always implicitly part of the panel and just hidden by default?

Because judging from this, they can be instantiated, but hidden.

    _hideIndicators() {
        for (const role in PANEL_ITEM_IMPLEMENTATIONS) {
            const indicator = this.statusArea[role];
            if (!indicator)
                continue;
            indicator.container.hide();
        }
    }

So if there is any chance that they are indeed practically undefined at runtime, this change should be merged (breaking change is expected in that scenario.)

Comment thread packages/gnome-shell/src/ui/panel.d.ts Outdated
@AmionSky

Copy link
Copy Markdown
Contributor Author

https://gitlab.gnome.org/GNOME/gnome-shell/-/blob/main/js/ui/sessionMode.js#L21 seem to indicate that gnome shell can load with not all of them initialized (though I didn't verify what the code actually doing there)

@schnz

schnz commented Jun 24, 2026

Copy link
Copy Markdown
Member

https://gitlab.gnome.org/GNOME/gnome-shell/-/blob/main/js/ui/sessionMode.js#L21 seem to indicate that gnome shell can load with not all of them initialized (though I didn't verify what the code actually doing there)

Looks quite like it.

Approve from my side. I'll let this PR open for others to chime in, though. If nobody objects, I'd merge it by tomorrow.

@schnz schnz merged commit d69e134 into gjsify:main Jun 25, 2026
1 check passed
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.

2 participants