Suppress LocalSend's redundant tray item (#6852)
LocalSend registers an Ayatana item with no ItemIsMenu and no Activate handler, so its primary click is a silent no-op and the menu offers only Open and Quit. Share > Receive already opens it, so drop the item the way Dropbox's is dropped when its dedicated widget owns the surface. Closes #6838 Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5
parent
df708831b6
commit
dc698e5df0
@@ -7,9 +7,10 @@ source "$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" && pwd)/base-test.sh"
|
||||
run_node_test "tray model helpers" <<'JS'
|
||||
const tray = requireFromRoot('shell/plugins/bar/widgets/TrayModel.js')
|
||||
|
||||
assert(tray.isDropboxTrayItem({ id: 'dropbox-client' }), 'tray detects dropbox item ids')
|
||||
assert(tray.isDropboxTrayItem({ title: 'Dropbox' }), 'tray detects dropbox item titles')
|
||||
assert(!tray.isDropboxTrayItem({ id: 'nextcloud' }), 'tray ignores non-dropbox items')
|
||||
assert(tray.itemNamed({ id: 'dropbox-client' }, 'dropbox'), 'tray matches item ids')
|
||||
assert(tray.itemNamed({ title: 'Dropbox' }, 'dropbox'), 'tray matches item titles')
|
||||
assert(tray.itemNamed({ tooltipTitle: 'LocalSend' }, 'localsend'), 'tray matches item tooltips')
|
||||
assert(!tray.itemNamed({ id: 'nextcloud' }, 'dropbox'), 'tray ignores items named for something else')
|
||||
|
||||
const layout = {
|
||||
left: [{ id: 'omarchy.menu' }],
|
||||
@@ -18,7 +19,8 @@ const layout = {
|
||||
}
|
||||
|
||||
assert(tray.layoutHasWidget(layout, 'omarchy.dropbox'), 'tray finds dedicated dropbox widget in layout')
|
||||
assert(tray.ownedByDedicatedWidget({ id: 'dropbox' }, layout), 'tray suppresses dropbox when dedicated widget is in bar')
|
||||
assert(!tray.ownedByDedicatedWidget({ id: 'dropbox' }, { left: [], center: [], right: [] }), 'tray keeps dropbox when dedicated widget is absent')
|
||||
assert(!tray.ownedByDedicatedWidget({ id: 'nextcloud' }, layout), 'tray keeps unrelated tray items')
|
||||
assert(tray.ownedByOmarchy({ id: 'dropbox' }, layout), 'tray suppresses dropbox when dedicated widget is in bar')
|
||||
assert(!tray.ownedByOmarchy({ id: 'dropbox' }, { left: [], center: [], right: [] }), 'tray keeps dropbox when dedicated widget is absent')
|
||||
assert(tray.ownedByOmarchy({ id: 'qlBCprNUqU', title: 'localsend' }, { left: [], center: [], right: [] }), 'tray suppresses localsend regardless of layout')
|
||||
assert(!tray.ownedByOmarchy({ id: 'nextcloud' }, layout), 'tray keeps unrelated tray items')
|
||||
JS
|
||||
|
||||
Reference in New Issue
Block a user