Skip to content

Commit 72e503c

Browse files
GarthDBcursoragent
andauthored
fix: make home icon navigate to site root on theme, scales, and tools pages (#277)
* fix: make home icon navigate to site root on theme, scales, and tools pages Replace in-page tab switch with actual navigation to / so the home icon links go to leonardocolor.io/ instead of changing content in-place. Co-authored-by: Cursor <cursoragent@cursor.com> * fix: clean up SPA navigation remnants after static page transition - Remove tab_home partial from theme, scales, and tools pages (unreachable after home icon now navigates to index.html) - Remove welcome.click() calls and openSideNavItem imports from theme.js, scales.js, tools.js - Remove target="_blank" from homepage navigation cards so theme/scales/tools open in the same tab - Normalize home icon href to index.html for consistency with other links - Delete orphaned files: index.js, header.html, tab_home.html, home_sidenav.html Co-authored-by: Cursor <cursoragent@cursor.com> --------- Co-authored-by: Cursor <cursoragent@cursor.com>
1 parent aacab2e commit 72e503c

14 files changed

Lines changed: 18 additions & 192 deletions

docs/ui/src/index.js

Lines changed: 0 additions & 121 deletions
This file was deleted.

docs/ui/src/scales.html

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,6 @@
2626
<div id="page" style="opacity: 0">
2727
{{> header_scales }}
2828

29-
{{> tab_home }}
30-
3129
{{> tab_sequentialScale scaleType="sequential" }}
3230
{{> tab_divergingScale scaleType="diverging" }}
3331
{{> tab_qualitativeScale scaleType="qualitative" }}

docs/ui/src/scales.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ import {_divergingScale} from './js/initialDivergingScale';
7979
import {_qualitativeScale} from './js/initialQualitativeScale';
8080

8181
import {throttle} from './js/utils';
82-
import {openPanelTab, openTab, openAppTab, openScaleTab, openSideNavItem} from './js/tabs';
82+
import {openPanelTab, openTab, openAppTab, openScaleTab} from './js/tabs';
8383

8484
import {colorScaleDiverging} from './js/colorScaleDiverging';
8585
import {colorScaleSequential} from './js/colorScaleSequential';
@@ -121,8 +121,6 @@ document.getElementById('tabsequentialDemo').click();
121121
document.getElementById('tabdivergingDemo').click();
122122
document.getElementById('tabqualitativeDemo').click();
123123

124-
document.getElementById('welcome').click();
125-
126124
colorScaleSequential();
127125
colorScaleDiverging();
128126
colorScaleQualitative();

docs/ui/src/theme.html

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,6 @@
2525
<div id="page" style="opacity: 0">
2626
{{> header_theme }}
2727

28-
{{> tab_home }}
29-
3028
{{> tab_palette }}
3129
{{> tab_accessibility }}
3230
{{> tab_theme }}

docs/ui/src/theme.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ import {showToast, hideToast, exitPreview, neverShowToast} from './js/toast';
8989
import {addFromURL, addFromURLDialog, cancelURL} from './js/addFromURL';
9090
import updateThemeTitle from './js/themeTitle';
9191
import {addRatio, sortRatios} from './js/ratios';
92-
import {openPanelTab, openTab, openDetailTab, openAppTab, openSideNavItem, openColorTab} from './js/tabs';
92+
import {openPanelTab, openTab, openDetailTab, openAppTab, openColorTab} from './js/tabs';
9393
import toggleTooltip from './js/tooltip';
9494
import {downloadUiKit, createSVGuiKit} from './js/createSVGuiKit';
9595
import {toggleSwatchAttributes} from './js/toggleSwatchAttributes';
@@ -174,7 +174,6 @@ document.getElementById('tabPanelColorScales').click();
174174
document.getElementById('tabJSParameters').click();
175175
document.getElementById('tabPalette').click();
176176
document.getElementById('tabContrastingPairs').click();
177-
document.getElementById('welcome').click();
178177
document.getElementById('tabColorWheel').click();
179178

180179
window.onload = function () {

docs/ui/src/tools.html

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@
2525

2626
<div id="page" style="opacity: 0">
2727
{{> header_tools }}
28-
{{> tab_home }}
2928
{{> tab_colorCompare }}
3029
{{> tab_colorConverter }}
3130
</div>

docs/ui/src/tools.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ loadIcons('./spectrum-icons.svg');
7272

7373
// Import local Javascript functions
7474
import {throttle} from './js/utils';
75-
import {openPanelTab, openTab, openAppTab, openSideNavItem} from './js/tabs';
75+
import {openPanelTab, openTab, openAppTab} from './js/tabs';
7676
import toggleTooltip from './js/tooltip';
7777
import {compareColors} from './js/compareColors';
7878
import {convertColors} from './js/convertColors';
@@ -100,7 +100,6 @@ if (mq.matches) {
100100

101101
document.getElementById('tabContrast').click();
102102
document.getElementById('tabSubPanelContrastChart').click();
103-
document.getElementById('welcome').click();
104103

105104
document.getElementById('compareColorOneInput').dispatchEvent(new Event('input'));
106105
document.getElementById('compareColorTwoInput').dispatchEvent(new Event('input'));

docs/ui/src/views/header.html

Lines changed: 0 additions & 19 deletions
This file was deleted.

docs/ui/src/views/header_scales.html

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,13 @@
33
{{> LogoLink }}
44

55
<div class="spectrum-Tabs spectrum-Tabs--horizontal spectrum-Tabs--quiet spectrum-Tabs--fluid">
6-
<div id="tabHome" class="spectrum-Tabs-item app-Tabs-item" tabindex="0" onclick="openAppTab(event, 'home')">
7-
<label class="spectrum-Tabs-itemLabel">
6+
<a href="index.html" class="spectrum-Tabs-item app-Tabs-item" id="tabHome" aria-label="Home">
7+
<span class="spectrum-Tabs-itemLabel">
88
<svg xmlns:xlink="http://www.w3.org/1999/xlink" class="spectrum-Icon spectrum-Icon--sizeS" focusable="false" aria-hidden="true" aria-label="Edit">
99
<use xlink:href="#spectrum-icon-18-Home" />
1010
</svg>
11-
</label>
12-
</div>
11+
</span>
12+
</a>
1313

1414
<div id="tabSequential" class="spectrum-Tabs-item app-Tabs-item" tabindex="0" onclick="openAppTab(event, 'sequential')">
1515
<label class="spectrum-Tabs-itemLabel">Sequential</label>

docs/ui/src/views/header_theme.html

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,13 @@
33
{{> LogoLink }}
44

55
<div role="tablist" class="spectrum-Tabs spectrum-Tabs--horizontal spectrum-Tabs--quiet spectrum-Tabs--fluid">
6-
<div role="tab" id="tabHome" aria-controls="home" tabindex="0" class="spectrum-Tabs-item app-Tabs-item" onclick="openAppTab(event, 'home')">
7-
<label class="spectrum-Tabs-itemLabel">
6+
<a href="index.html" class="spectrum-Tabs-item app-Tabs-item" id="tabHome" aria-label="Home">
7+
<span class="spectrum-Tabs-itemLabel">
88
<svg xmlns:xlink="http://www.w3.org/1999/xlink" class="spectrum-Icon spectrum-Icon--sizeS" focusable="false" aria-hidden="true" aria-label="Edit">
99
<use xlink:href="#spectrum-icon-18-Home" />
1010
</svg>
11-
</label>
12-
</div>
11+
</span>
12+
</a>
1313

1414
<div role="tab" aria-controls="palette" id="tabPalette" class="spectrum-Tabs-item app-Tabs-item" tabindex="0" onclick="openAppTab(event, 'palette')">
1515
<label class="spectrum-Tabs-itemLabel">Create</label>

0 commit comments

Comments
 (0)