Skip to content

Commit 26b2834

Browse files
fix(copilot): address code review comments for screen reader announcers, visual emoji ordering, and visually-hidden clip-path
1 parent 62687d8 commit 26b2834

5 files changed

Lines changed: 23 additions & 15 deletions

File tree

desktop-app/resources/js/script.js

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3064,7 +3064,10 @@ This is a fully client-side application. Your content never leaves your browser
30643064

30653065
function insertEmojis() {
30663066
if (!emojiSelection.size) return;
3067-
const ordered = Array.from(emojiSelection);
3067+
// Retain the modal's visual/definition order of emojis, consistent with the Symbols modal
3068+
const ordered = emojiItems
3069+
.filter(item => emojiSelection.has(item.shortcode))
3070+
.map(item => item.shortcode);
30683071
const insertion = ordered.join(' ');
30693072
modal.style.display = 'none';
30703073
cleanup();
@@ -7195,12 +7198,12 @@ This is a fully client-side application. Your content never leaves your browser
71957198
// Accessibility dynamic screen reader announcer helper
71967199
function announceToScreenReader(message) {
71977200
const announcer = document.getElementById('app-accessibility-announcer');
7198-
if (announcer) {
7199-
announcer.textContent = '';
7200-
setTimeout(() => {
7201-
announcer.textContent = message;
7202-
}, 50);
7203-
}
7201+
if (!announcer) return;
7202+
announcer.textContent = '';
7203+
clearTimeout(announceToScreenReader._timeoutId);
7204+
announceToScreenReader._timeoutId = setTimeout(() => {
7205+
announcer.textContent = message;
7206+
}, 50);
72047207
}
72057208

72067209
// Visual skeleton loader generator for emoji list

desktop-app/resources/styles.css

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3487,6 +3487,7 @@ html[lang="ko"] .markdown-body h1, html[lang="ko"] .markdown-body h2, html[lang=
34873487
margin: -1px !important;
34883488
overflow: hidden !important;
34893489
clip: rect(0, 0, 0, 0) !important;
3490+
clip-path: inset(50%) !important;
34903491
white-space: nowrap !important;
34913492
border: 0 !important;
34923493
}

script.js

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3064,7 +3064,10 @@ This is a fully client-side application. Your content never leaves your browser
30643064

30653065
function insertEmojis() {
30663066
if (!emojiSelection.size) return;
3067-
const ordered = Array.from(emojiSelection);
3067+
// Retain the modal's visual/definition order of emojis, consistent with the Symbols modal
3068+
const ordered = emojiItems
3069+
.filter(item => emojiSelection.has(item.shortcode))
3070+
.map(item => item.shortcode);
30683071
const insertion = ordered.join(' ');
30693072
modal.style.display = 'none';
30703073
cleanup();
@@ -7195,12 +7198,12 @@ This is a fully client-side application. Your content never leaves your browser
71957198
// Accessibility dynamic screen reader announcer helper
71967199
function announceToScreenReader(message) {
71977200
const announcer = document.getElementById('app-accessibility-announcer');
7198-
if (announcer) {
7199-
announcer.textContent = '';
7200-
setTimeout(() => {
7201-
announcer.textContent = message;
7202-
}, 50);
7203-
}
7201+
if (!announcer) return;
7202+
announcer.textContent = '';
7203+
clearTimeout(announceToScreenReader._timeoutId);
7204+
announceToScreenReader._timeoutId = setTimeout(() => {
7205+
announcer.textContent = message;
7206+
}, 50);
72047207
}
72057208

72067209
// Visual skeleton loader generator for emoji list

styles.css

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3487,6 +3487,7 @@ html[lang="ko"] .markdown-body h1, html[lang="ko"] .markdown-body h2, html[lang=
34873487
margin: -1px !important;
34883488
overflow: hidden !important;
34893489
clip: rect(0, 0, 0, 0) !important;
3490+
clip-path: inset(50%) !important;
34903491
white-space: nowrap !important;
34913492
border: 0 !important;
34923493
}

sw.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
const CACHE_NAME = 'markdown-viewer-cache-v3.6.9';
1+
const CACHE_NAME = 'markdown-viewer-cache-v3.7.0';
22
const ASSETS = [
33
'./',
44
'./index.html',

0 commit comments

Comments
 (0)