Skip to content

Commit f5195a4

Browse files
duncanmccleanclaudejasonvarga
authored
[6.x] Fix visible he-tree accessibility text in tree view (#14465)
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com> Co-authored-by: Jason Varga <jason@pixelfear.com>
1 parent 8cd4799 commit f5195a4

File tree

4 files changed

+23
-0
lines changed

4 files changed

+23
-0
lines changed

lang/en/messages.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -256,6 +256,7 @@
256256
'theme_share_instructions' => 'Publish this theme through your statamic.com account to make it available to others.',
257257
'try_again_in_seconds' => '{0,1}Try again now.|Try again in :count seconds.',
258258
'try_again_in_minutes' => 'Try again in a minute.|Try again in :count minutes.',
259+
'tree_aria_instructions' => 'Use arrow keys to navigate. Alt plus arrow keys to reorder.',
259260
'two_factor_account_requirement' => 'Your account requires two-factor authentication. Please enable it before proceeding.',
260261
'two_factor_challenge_code_instructions' => 'Enter the 6-digit code from your authenticator app to confirm access to your account.',
261262
'two_factor_enable_introduction' => 'When enabled, you will be prompted for a secure, random token from your phone\'s authenticator app every time you log in.',

resources/css/components/page-tree.css

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,3 +93,7 @@
9393
@apply pt-1 rounded-t-2xl;
9494
}
9595
}
96+
97+
.he-tree-sr-only {
98+
@apply sr-only;
99+
}

resources/js/components/structures/PageTree.vue

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131
:each-droppable="eachDroppable"
3232
:max-level="maxDepth"
3333
:stat-handler="statHandler"
34+
:aria-label="__('Tree Structure')"
3435
@after-drop="afterDrop"
3536
@open:node="nodeOpened"
3637
@close:node="nodeClosed"
@@ -149,6 +150,16 @@ export default {
149150
this.getPages();
150151
},
151152
153+
loading(loading) {
154+
if (!loading) {
155+
this.$nextTick(() => {
156+
if (this.$refs.tree) {
157+
this.$refs.tree.ariaInstructions = __('messages.tree_aria_instructions');
158+
}
159+
});
160+
}
161+
},
162+
152163
collapsedState: {
153164
deep: true,
154165
handler(state) {

resources/js/pages/preferences/nav/Edit.vue

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,7 @@
8686
:indent="24"
8787
:dir="direction"
8888
:stat-handler="statHandler"
89+
:aria-label="__('Tree Structure')"
8990
keep-placeholder
9091
trigger-class="page-move"
9192
:each-droppable="eachDroppable"
@@ -289,6 +290,12 @@ export default {
289290
mounted() {
290291
this.setInitialNav(this.nav);
291292
this.addToCommandPalette();
293+
294+
this.$nextTick(() => {
295+
if (this.$refs.tree) {
296+
this.$refs.tree.ariaInstructions = __('messages.tree_aria_instructions');
297+
}
298+
});
292299
},
293300
294301
computed: {

0 commit comments

Comments
 (0)