@@ -90,37 +90,16 @@ function createStatusBar() {
9090 game . className = "toolbox-status-bar__game" ;
9191 game . dataset . toolboxSelectedGame = "" ;
9292
93- const nameField = document . createElement ( "div" ) ;
94- nameField . className = "toolbox-status-bar__field" ;
95- nameField . dataset . toolboxSelectedGameNameField = "" ;
96- const nameLabel = createText ( "span" , "toolbox-status-bar__label" , "toolboxSelectedGameNameLabel" ) ;
97- nameLabel . textContent = "Selected Game Name" ;
9893 const name = createText ( "strong" , "toolbox-status-bar__game-name" , "toolboxSelectedGameName" ) ;
99- nameField . append ( nameLabel , name ) ;
100-
101- const purposeField = document . createElement ( "div" ) ;
102- purposeField . className = "toolbox-status-bar__field" ;
103- purposeField . dataset . toolboxSelectedGamePurposeField = "" ;
104- const purposeLabel = createText ( "span" , "toolbox-status-bar__label" , "toolboxSelectedGamePurposeLabel" ) ;
105- purposeLabel . textContent = "Selected Game Purpose" ;
106- const purpose = createText ( "span" , "toolbox-status-bar__purpose" , "toolboxSelectedGamePurpose" ) ;
107- purpose . dataset . toolboxSelectedGameMeta = "" ;
108- purposeField . append ( purposeLabel , purpose ) ;
109- game . append ( nameField , purposeField ) ;
94+ game . append ( name ) ;
11095
11196 const center = document . createElement ( "div" ) ;
11297 center . className = "toolbox-status-bar__center" ;
11398 center . dataset . toolboxStatusCenter = "" ;
11499
115- const contextType = createText ( "span" , "pill toolbox-status-bar__context-type" , "toolboxStatusContextType" ) ;
116100 const message = createText ( "p" , "toolbox-status-bar__message status" , "toolboxStatusMessage" ) ;
117101 message . setAttribute ( "role" , "status" ) ;
118- const action = document . createElement ( "a" ) ;
119- action . className = "btn btn--compact toolbox-status-bar__action" ;
120- action . dataset . toolboxStatusAction = "" ;
121- action . href = mountOptions . gameHubHref ;
122- action . textContent = "Open Game Hub" ;
123- center . append ( contextType , message , action ) ;
102+ center . append ( message ) ;
124103
125104 inner . append ( game , center ) ;
126105 bar . append ( inner ) ;
@@ -234,33 +213,30 @@ function publishSelectedGameContext(selectedGame, state) {
234213function classifyToolContext ( messageText , state , required ) {
235214 const text = String ( messageText || "" ) . trim ( ) ;
236215 if ( state === "error" ) {
237- return { kind : "error" , label : "Error" } ;
216+ return { kind : "error" } ;
238217 }
239218 if ( required && state === "missing" ) {
240- return { kind : "action" , label : "Tool Action" } ;
219+ return { kind : "action" } ;
241220 }
242221 if ( / \b ( e r r o r | f a i l e d | m a l f o r m e d | u n a v a i l a b l e | c o u l d n o t ) \b / i. test ( text ) ) {
243- return { kind : "error" , label : "Error" } ;
222+ return { kind : "error" } ;
244223 }
245224 if ( / \b ( s i g n i n | r e f r e s h | t r y a g a i n | t e m p o r a r i l y | b l o c k e d ) \b / i. test ( text ) ) {
246- return { kind : "warning" , label : "Warning" } ;
225+ return { kind : "warning" } ;
247226 }
248227 if ( / \b ( v a l i d a t i o n | r e q u i r e m e n t | r e q u i r e m e n t s | m i s s i n g | r e q u i r e d | o p e n o r s e e d ) \b / i. test ( text ) ) {
249- return { kind : "validation" , label : "Validation" } ;
228+ return { kind : "validation" } ;
250229 }
251230 if ( / \b ( s a v e d | c r e a t e d | d e l e t e d | u p d a t e d | l o a d e d | s a v e c h a n g e s ) \b / i. test ( text ) ) {
252- return { kind : "save" , label : "Save State" } ;
231+ return { kind : "save" } ;
253232 }
254- return { kind : "action" , label : "Tool Action" } ;
233+ return { kind : "action" } ;
255234}
256235
257236function renderSelectedGame ( bar , selectedGame , state , messageText ) {
258237 const required = pageRequiresSelectedGame ( ) ;
259238 const name = bar . querySelector ( "[data-toolbox-selected-game-name]" ) ;
260- const purpose = bar . querySelector ( "[data-toolbox-selected-game-purpose]" ) ;
261- const contextType = bar . querySelector ( "[data-toolbox-status-context-type]" ) ;
262239 const message = bar . querySelector ( "[data-toolbox-status-message]" ) ;
263- const action = bar . querySelector ( "[data-toolbox-status-action]" ) ;
264240 const nextMessage = messageText || latestToolMessage || ( selectedGame
265241 ? `Tool context is filtered to ${ selectedGame . name } .`
266242 : required
@@ -271,38 +247,27 @@ function renderSelectedGame(bar, selectedGame, state, messageText) {
271247 bar . dataset . selectedGameState = state ;
272248 bar . dataset . selectedGameRequired = String ( required ) ;
273249 bar . dataset . toolboxStatusContextKind = context . kind ;
274- contextType . textContent = context . label ;
275- action . hidden = false ;
276- action . href = mountOptions . gameHubHref ;
277250
278251 if ( selectedGame ) {
279252 name . textContent = selectedGame . name ;
280- purpose . textContent = selectedGame . purpose || "Game" ;
281253 message . textContent = nextMessage ;
282- action . textContent = "Open Game Hub" ;
283254 return ;
284255 }
285256
286257 if ( ! required ) {
287258 name . textContent = "No game selected" ;
288- purpose . textContent = "Idea Board optional" ;
289259 message . textContent = nextMessage ;
290- action . textContent = "Open Game Hub" ;
291260 return ;
292261 }
293262
294263 if ( state === "error" ) {
295264 name . textContent = "Unavailable" ;
296- purpose . textContent = "Game Hub selected game could not be read" ;
297265 message . textContent = nextMessage ;
298- action . textContent = "Open Game Hub" ;
299266 return ;
300267 }
301268
302269 name . textContent = "No game selected" ;
303- purpose . textContent = "Game Hub owns game selection" ;
304270 message . textContent = "Select or create a game in Game Hub before using this toolbox page." ;
305- action . textContent = "Select or Create in Game Hub" ;
306271}
307272
308273export function refreshToolboxStatusBar ( ) {
0 commit comments