diff --git a/.Jules/palette.md b/.Jules/palette.md index 049f738..9f776c7 100644 --- a/.Jules/palette.md +++ b/.Jules/palette.md @@ -50,3 +50,7 @@ ## 2025-05-14 - Social Sharing Implementation **Learning:** Placeholders for social sharing buttons significantly degrade UX when users expect to share discovered content. Standardizing these intents with popup windows (550x450) provides a "premium" feel while keeping users on the platform. **Action:** Always verify if sharing icons in modals are functional; if not, implement standardized platform intents using centered popups. + +## 2025-05-30 - Accessible Icon-Only Buttons +**Learning:** Icon-only buttons (such as those in view controls or custom side headers) require both descriptive `aria-label` for screen reader accessibility and consistent `title` attributes to act as visual tooltips for mouse users. Failing to include these leads to poor discoverability and an inaccessible interactive state. +**Action:** Always audit interface control buttons and ensure all icon-only buttons have descriptive `aria-label` and `title` attributes, keeping cryptographic shortcuts out of the screen reader label but included in the visual tooltip hint. diff --git a/fix_app.py b/fix_app.py index 247998d..22f09fa 100644 --- a/fix_app.py +++ b/fix_app.py @@ -1,35 +1,42 @@ -import sys +from pathlib import Path -filepath = 'js/app.js' -with open(filepath, 'r') as f: - lines = f.readlines() +filepath = Path("js/app.js") +if filepath.exists(): + with filepath.open("r") as f: + lines = f.readlines() -# Part 1: DOM elements -for i, line in enumerate(lines): - if "themeMenu: document.getElementById('themeMenu')," in line: - lines.insert(i + 1, " episodesNavBtn: document.querySelector('[data-action=\"scroll-to-episodes\"]'),\n") - lines.insert(i + 2, " episodesSection: document.getElementById('episodesSection'),\n") - break + # Part 1: DOM elements + for i, line in enumerate(lines): + if "themeMenu: document.getElementById('themeMenu')," in line: + lines.insert( + i + 1, + " episodesNavBtn: document.querySelector('[data-action=\"scroll-to-episodes\"]'),\n", + ) + lines.insert( + i + 2, + " episodesSection: document.getElementById('episodesSection'),\n", + ) + break -# Part 2: bindEvents -for i, line in enumerate(lines): - if "if (DOM.heroBtn) DOM.heroBtn.addEventListener('click'" in line: - scroll_listener = [ - " // Navbar Episodes Scroll\n", - " if (DOM.episodesNavBtn && DOM.episodesSection) {\n", - " DOM.episodesNavBtn.addEventListener('click', () => {\n", - " DOM.episodesSection.scrollIntoView({ behavior: 'smooth' });\n", - " if (document.body.classList.contains('mobile-nav-active')) {\n", + # Part 2: bindEvents + for i, line in enumerate(lines): + if "if (DOM.heroBtn) DOM.heroBtn.addEventListener('click'" in line: + scroll_listener = [ + " // Navbar Episodes Scroll\n", + " if (DOM.episodesNavBtn && DOM.episodesSection) {\n", + " DOM.episodesNavBtn.addEventListener('click', () => {\n", + " DOM.episodesSection.scrollIntoView({ behavior: 'smooth' });\n", + " if (document.body.classList.contains('mobile-nav-active')) {\n", " document.body.classList.remove('mobile-nav-active');\n", - " if (DOM.menuToggle) DOM.menuToggle.setAttribute('aria-expanded', 'false');\n", - " }\n", - " });\n", - " }\n", - "\n" - ] - for idx, new_line in enumerate(scroll_listener): - lines.insert(i + idx, new_line) - break + " if (DOM.menuToggle) DOM.menuToggle.setAttribute('aria-expanded', 'false');\n", + " }\n", + " });\n", + " }\n", + "\n", + ] + for idx, new_line in enumerate(scroll_listener): + lines.insert(i + idx, new_line) + break -with open(filepath, 'w') as f: - f.writelines(lines) + with filepath.open("w") as f: + f.writelines(lines) diff --git a/fix_deps.py b/fix_deps.py index 34cbd97..f59b27b 100644 --- a/fix_deps.py +++ b/fix_deps.py @@ -15,12 +15,12 @@ # Maybe the CI is running against a different state of the PR? # Let's just make sure trigger-circleci-pipeline and circletui are in package.json if they are in the lockfile. -if 'dependencies' not in pkg: - pkg['dependencies'] = {} +if "dependencies" not in pkg: + pkg["dependencies"] = {} -pkg['dependencies']['trigger-circleci-pipeline'] = '^1.12.1' -pkg['dependencies']['circletui'] = '^1.0.3' -pkg['dependencies']['@circleci/circleci-config-sdk'] = '^0.12.5' +pkg["dependencies"]["trigger-circleci-pipeline"] = "^1.12.1" +pkg["dependencies"]["circletui"] = "^1.0.3" +pkg["dependencies"]["@circleci/circleci-config-sdk"] = "^0.12.5" with Path("package.json").open("w") as f: json.dump(pkg, f, indent=2) diff --git a/fix_index.py b/fix_index.py index 353b69c..1f50e52 100644 --- a/fix_index.py +++ b/fix_index.py @@ -1,10 +1,20 @@ -with open('index.html', 'r') as f: - content = f.read() +from pathlib import Path -# Add title attribute to search button -old_search = ' - @@ -115,7 +115,7 @@

Ruh Al Tarikh

-
@@ -348,8 +348,8 @@

Live A

Active Projects

- - + +
@@ -365,7 +365,7 @@

Active Projects