-
Notifications
You must be signed in to change notification settings - Fork 0
PR_26179_ALFA_010-tool-display-single-line-summary #254
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -73,12 +73,6 @@ | |
| document.querySelectorAll("details.vertical-accordion").forEach(wireVerticalAccordionChevron); | ||
| } | ||
|
|
||
| function updateToolDisplayModeChevron() { | ||
| const iconName = displayMode.open ? "chevron-up" : "chevron-down"; | ||
| const shell = createChevronShell(iconName, "tool-display-mode__chevron", "tool-display-mode__chevron-icon"); | ||
| replaceIconNode(summary, ":scope > .tool-display-mode__chevron", shell); | ||
| } | ||
|
|
||
| function updateToolDisplayModeModeIcon() { | ||
| const iconName = document.body.classList.contains("tool-focus-mode") || document.fullscreenElement | ||
| ? "exit-fullscreen" | ||
|
|
@@ -107,7 +101,6 @@ | |
| function refreshThemeIcons() { | ||
| refreshVerticalAccordionChevrons(); | ||
| updateToolDisplayModeModeIcon(); | ||
| updateToolDisplayModeChevron(); | ||
| refreshHorizontalToggleIcons(); | ||
| } | ||
|
|
||
|
|
@@ -146,67 +139,27 @@ | |
| const summary = document.createElement("summary"); | ||
| summary.setAttribute("aria-label", "Tool Display Mode"); | ||
| summary.title = "Tool Display Mode"; | ||
| summary.appendChild(createThemeIconNode("fullscreen", "layout-icon tool-display-mode__mode-icon")); | ||
|
|
||
| const badge = document.createElement("img"); | ||
| badge.className = "tool-display-mode__badge"; | ||
| badge.src = publicImageSource(slot.dataset.toolIconSrc, "badges"); | ||
| badge.alt = toolName + " badge"; | ||
| summary.appendChild(badge); | ||
|
|
||
| const fullscreenName = document.createElement("span"); | ||
| fullscreenName.className = "tool-display-mode__fullscreen-name"; | ||
| fullscreenName.textContent = toolName; | ||
| summary.appendChild(fullscreenName); | ||
| displayMode.appendChild(summary); | ||
| displayMode.addEventListener("toggle", updateToolDisplayModeChevron); | ||
|
|
||
| const body = document.createElement("div"); | ||
| body.className = "tool-display-mode__body"; | ||
|
|
||
| const identityRow = document.createElement("div"); | ||
| identityRow.className = "tool-display-mode__identity-row content-cluster"; | ||
| identityRow.dataset.toolDisplayModeRow = "identity"; | ||
| const toolNameLabel = document.createElement("span"); | ||
| toolNameLabel.className = "tool-display-mode__tool-name"; | ||
| toolNameLabel.textContent = toolName; | ||
| summary.appendChild(toolNameLabel); | ||
|
|
||
| const character = document.createElement("img"); | ||
| character.className = "tool-display-mode__character"; | ||
| character.src = publicImageSource(slot.dataset.toolCharacterSrc, "characters"); | ||
| character.alt = toolName + " character"; | ||
| identityRow.appendChild(character); | ||
|
|
||
| const description = document.createElement("span"); | ||
| description.className = "tool-display-mode__description"; | ||
| description.textContent = toolName; | ||
| identityRow.appendChild(description); | ||
| body.appendChild(identityRow); | ||
| displayMode.appendChild(body); | ||
| slot.replaceWith(displayMode); | ||
| summary.appendChild(character); | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
When a tool page is viewed on common phone widths, this puts the fixed 225px character into the same non-wrapping summary row as the 64px badge, ~42px fullscreen icon, three 10px gaps, and 20px padding, so the row needs about 381px before the tool name and overflows a 390px viewport's ~354px container. The previous layout kept the character out of the summary row, so this regresses mobile tool pages; add a narrow-viewport rule to shrink/hide the character or otherwise let the row fit. Useful? React with 👍 / 👎. |
||
|
|
||
| function createNavigationControl(direction, target) { | ||
| const controlLabel = direction === "previous" ? "Previous" : "Next"; | ||
| const dataAttribute = direction === "previous" ? "toolNavPrevious" : "toolNavNext"; | ||
| const iconName = direction === "previous" ? "chevron-left" : "chevron-right"; | ||
| const icon = createThemeIconNode(iconName, "layout-icon tool-display-mode__navigation-icon"); | ||
| const label = document.createTextNode(controlLabel + ": " + (target?.label || "Unavailable")); | ||
|
|
||
| if (!target || target.disabled) { | ||
| const disabledText = document.createElement("span"); | ||
| disabledText.className = "pill tool-display-mode__navigation-link tool-display-mode__navigation-link--disabled"; | ||
| disabledText.dataset[dataAttribute] = "disabled"; | ||
| disabledText.append(icon, label); | ||
| return disabledText; | ||
| } | ||
|
|
||
| const link = document.createElement("a"); | ||
| link.className = "tool-display-mode__navigation-link"; | ||
| link.href = target.href; | ||
| link.dataset[dataAttribute] = target.kind; | ||
| if (target.group) { | ||
| link.dataset.toolNavGroup = target.group; | ||
| } | ||
| link.append(icon, label); | ||
| return link; | ||
| } | ||
| summary.appendChild(createThemeIconNode("fullscreen", "layout-icon tool-display-mode__mode-icon")); | ||
| displayMode.appendChild(summary); | ||
| slot.replaceWith(displayMode); | ||
|
|
||
| function applyRegistryImages(registry) { | ||
| const registryTool = registry.getToolBySlug(toolSlug); | ||
|
|
@@ -238,37 +191,26 @@ | |
| leftColumnTitle.textContent = registryName; | ||
| } | ||
| badge.alt = registryName + " badge"; | ||
| fullscreenName.textContent = registryName; | ||
| toolNameLabel.textContent = registryName; | ||
| character.alt = registryName + " character"; | ||
| description.textContent = registryName; | ||
| badge.src = registry.getToolImageSource(registryTool, "badge"); | ||
| character.src = registry.getToolImageSource(registryTool, "tool"); | ||
| } | ||
|
|
||
| async function renderToolNavigation() { | ||
| async function applyRegistryDisplayData() { | ||
| try { | ||
| const registry = await import("/toolbox/tool-registry-api-client.js"); | ||
| const registryDiagnostic = registry.getToolRegistryApiDiagnostic(); | ||
| if (registryDiagnostic) { | ||
| throw new Error(registryDiagnostic); | ||
| } | ||
| const navigation = registry.getToolNavigationTargets(toolSlug); | ||
| applyRegistryImages(registry); | ||
| const navigationRow = document.createElement("nav"); | ||
| navigationRow.className = "tool-display-mode__navigation-row content-cluster"; | ||
| navigationRow.dataset.toolDisplayModeRow = "navigation"; | ||
| navigationRow.setAttribute("aria-label", "Tool build-order navigation"); | ||
| navigationRow.append( | ||
| createNavigationControl("previous", navigation.previous), | ||
| createNavigationControl("next", navigation.next) | ||
| ); | ||
| body.appendChild(navigationRow); | ||
| } catch (error) { | ||
| console.warn("Tool navigation could not be loaded.", error); | ||
| console.warn("Tool display mode registry metadata could not be loaded.", error); | ||
| } | ||
| } | ||
|
|
||
| renderToolNavigation(); | ||
| applyRegistryDisplayData(); | ||
|
|
||
| async function enterToolMode() { | ||
| document.body.classList.add("tool-focus-mode"); | ||
|
|
@@ -317,7 +259,6 @@ | |
| }); | ||
|
|
||
| refreshVerticalAccordionChevrons(); | ||
| updateToolDisplayModeChevron(); | ||
|
|
||
| document.querySelectorAll(".tool-workspace").forEach(function (workspace) { | ||
| const columns = workspace.querySelectorAll(":scope > .tool-column"); | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,20 @@ | ||
| # PR_26179_ALFA_010-tool-display-single-line-summary Branch Validation | ||
|
|
||
| ## Result | ||
|
|
||
| PASS | ||
|
|
||
| ## Checks | ||
|
|
||
| | Check | Result | Notes | | ||
| | --- | --- | --- | | ||
| | Start branch was `main` | PASS | Verified before branch creation. | | ||
| | `main...origin/main` was `0 0` | PASS | Verified before branch creation. | | ||
| | PR branch created from `main` | PASS | `PR_26179_ALFA_010-tool-display-single-line-summary`. | | ||
| | Work stayed on PR branch during implementation | PASS | No commits to `main`. | | ||
| | Old `docs_build/` paths avoided | PASS | Reports generated under `dev/reports/`. | | ||
| | Old `tmp/` ZIP path avoided | PASS | Outcome ZIP path: `dev/workspace/zips/PR_26179_ALFA_010-tool-display-single-line-summary_delta.zip`. | | ||
|
|
||
| ## Branch | ||
|
|
||
| `PR_26179_ALFA_010-tool-display-single-line-summary` |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,29 @@ | ||
| # PR_26179_ALFA_010-tool-display-single-line-summary Manual Validation Notes | ||
|
|
||
| ## Product Owner Checks | ||
|
|
||
| 1. Open `/toolbox/game-design/index.html`. | ||
| 2. Confirm the Tool Display Mode bar shows one direct line: | ||
| - badge | ||
| - Game Design name | ||
| - character image | ||
| - fullscreen icon on the far right | ||
| 3. Confirm the old chevron, identity body, and Previous/Next navigation row are absent. | ||
| 4. Click the fullscreen icon. | ||
| 5. Confirm the icon changes to exit-fullscreen. | ||
| 6. Confirm the badge remains 64x64 in fullscreen mode. | ||
| 7. Confirm the character image is hidden in fullscreen mode. | ||
| 8. Click the exit icon and confirm the normal view returns. | ||
|
|
||
| ## Adjacent Checks | ||
|
|
||
| 1. Open representative tools: | ||
| - `/toolbox/game-hub/index.html` | ||
| - `/toolbox/game-configuration/index.html` | ||
| - `/toolbox/build-game/index.html` | ||
| 2. Confirm each Tool Display Mode bar uses the registry-owned tool name, badge, and character image. | ||
| 3. Confirm no visible Tool Display Mode Previous/Next controls appear. | ||
|
|
||
| ## Notes | ||
|
|
||
| PR #198 remains historical validation input only. Its useful validation intent is represented by the current targeted Playwright coverage in this PR. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For screen-reader users, this new visible tool name is not exposed because the parent summary still has
aria-label="Tool Display Mode", which takes precedence over descendant text when computing the control name. Since this PR also removes the old description/body markup, the fullscreen summary is now announced generically on every tool page instead of identifying the current tool; include the tool name in the summary label or label it from this text node.Useful? React with 👍 / 👎.