Packages that use the same template name change each other's widgets
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 54/100
Direzione di ricerca
Start with preparePackageDocument in Sources/StableBar/WidgetPackage.swift and expandWidgetTemplate in Sources/StableBar/ConfigurationLoader.swift; trace how package templates are composed and selected for package widgets. Read docs/packages.md to understand the supported root-level customization. Done when widgets use their own package templates while same-named root templates can still customize them; reproduce with two packages both defining Player.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
What happens
Templates from every enabled package and from your own files share one set of names, and templates with the same name merge recursively, later ones winning. When two packages define a template with the same name, the widgets of both draw the merged template, so each package can change the other's widgets.
This matters now that packages pick a template from a setting. Now playing 1.3.0 (stablebar-packages#55) chooses its bar look with "template": "@setting.barLook", so its templates are named after the choices Settings shows, Compact and Player. Any other package with a Player template changes Now playing's bar, and Now playing changes that package's widgets.
Steps to reproduce
-
Enable Now playing from stablebar-packages#55 with Bar look set to Player.
-
Enable a second package, such as this widgets package:
{ "widgets": [{ "id": "other-clock", "type": "clock", "format": "HH:mm", "position": "right", "template": "Player" }], "templates": { "Player": { "layout": { "type": "row", "children": [{ "type": "text", "text": "OTHER PACKAGE LAYOUT" }] } } } }
Expected
Each package's widgets use that package's own templates. A template in your own configuration can still customize a package's template on purpose, as Packages documents ("Root templates, tokens and widget overrides can customize them").
Environment
main at 36c9f858 (0.18.0-beta.20261118065952.1353), drawn offscreen with --render-scenes, macOS 27.
Evidence
Now playing alone:
With the second package, Now playing draws the other package's text, still with its own progress line and 284 pt width, and the other package's clock takes Now playing's width and padding:
Diagnosis
preparePackageDocument in Sources/StableBar/WidgetPackage.swift keeps a package's template names as written. The loader composes every layer into one templates object, merging same-named templates recursively, and expandWidgetTemplate in Sources/StableBar/ConfigurationLoader.swift looks a widget's template up in that merged object. Commands keep their own package's folder: each package widget's own environment.PACKAGE_DIR overrides the template's, so a clash changes layout and style, not where scripts run.
A possible fix: resolve a package widget's template against its own package's templates, then apply a same-named template from your own configuration on top, so the documented customization keeps working and packages no longer reach each other's. Package authors can avoid a clash today with distinctive names, but a name that's also a setting choice shows in Settings exactly as written.
Related
- #601 and #603 (closed, not planned): titles for setting choices in
package.json, declined because older builds reject the manifest. Titles would have let a package use scoped template names with readable choices. - #602: settings in manifest order with labels.
- stablebar-packages#55: Now playing's Bar look setting.
Triaged by Claude Code (Claude Opus 5.5).
- Lingua principale
- Swift
- Stelle
- 184
- Fork
- 12
- Merge medio
- 3h 50m
- PR unite (30g)
- 387
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Ha un modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di Seb-GRAF/StableBar
-
enhancement
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
I maintainer di solito rispondono entro 1 giorno
-
enhancement
Difficoltà 4/5 3-5 giorni Idoneità per principianti 52/100
I maintainer di solito rispondono entro 1 giorno
-
Menu bar items drawn as in the menu bar show the wrong part of the menu bar after a display changeForse già presa @Jonathanm10 l’ha presa oggi. Apertaneeds-triage
Difficoltà 2/5 1-3 ore Idoneità per principianti 35/100
I maintainer di solito rispondono entro 1 giorno
-
enhancement
Difficoltà 5/5 Più di una settimana Idoneità per principianti 30/100
I maintainer di solito rispondono entro 1 giorno
-
Allow the App Menu to display the frontmost app iconForse già presa @khatami10 l’ha presa oggi. Apertaenhancement needs-triage
Difficoltà 3/5 1-2 giorni Idoneità per principianti 35/100
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di Seb-GRAF/StableBar
Issue simili
-
good first issue help wanted testing
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 78/100
-
area:cli documentation good first issue priority:low
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 94/100
isaaclins/freesnitch#430 ·
I maintainer di solito rispondono entro 1 giorno
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
MasterJ93/ATProtoKit#354 ·
-
enhancement help wanted
Difficoltà 2/5 1-3 ore Idoneità per principianti 84/100
heysidhant/appvanish#4 ·
-
bug priority:low status:queued
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
I maintainer di solito rispondono entro 1 giorno