alessandro trinca tornidor
commited on
Commit
·
8bb1e58
1
Parent(s):
e44890b
test: update pytest configuration
Browse files- .vscode/settings.json +6 -0
- CHANGELOG.md +8 -0
- pyproject.toml +1 -1
- tests-prompts/frontend-accessibility.md +39 -0
.vscode/settings.json
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"sonarlint.connectedMode.project": {
|
| 3 |
+
"connectionId": "http-localhost-9000",
|
| 4 |
+
"projectKey": "my_ghost_writer"
|
| 5 |
+
}
|
| 6 |
+
}
|
CHANGELOG.md
CHANGED
|
@@ -1,5 +1,13 @@
|
|
| 1 |
# Changelog
|
| 2 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 3 |
## 0.3.0
|
| 4 |
|
| 5 |
- add an installation script (python required), mostly useful for lite.koboldai.net users
|
|
|
|
| 1 |
# Changelog
|
| 2 |
|
| 3 |
+
# 0.5.2
|
| 4 |
+
|
| 5 |
+
- Improved docker build process to fix HuggingFace space deploy
|
| 6 |
+
- Read API to get thesaurus functionality
|
| 7 |
+
- Added adding custom voices (write API) to the thesaurus functionality
|
| 8 |
+
- updated backend tests
|
| 9 |
+
- updated frontend tests
|
| 10 |
+
|
| 11 |
## 0.3.0
|
| 12 |
|
| 13 |
- add an installation script (python required), mostly useful for lite.koboldai.net users
|
pyproject.toml
CHANGED
|
@@ -40,7 +40,7 @@ uvicorn = "^0.34.2"
|
|
| 40 |
pymongo = {extras = ["srv"], version = "^4.13.2"}
|
| 41 |
|
| 42 |
[tool.pytest.ini_options]
|
| 43 |
-
addopts = "--cov=my_ghost_writer --cov-report
|
| 44 |
|
| 45 |
[build-system]
|
| 46 |
requires = ["poetry-core>=2.0.0,<3.0.0"]
|
|
|
|
| 40 |
pymongo = {extras = ["srv"], version = "^4.13.2"}
|
| 41 |
|
| 42 |
[tool.pytest.ini_options]
|
| 43 |
+
addopts = "--cov=my_ghost_writer --cov-report=term-missing"
|
| 44 |
|
| 45 |
[build-system]
|
| 46 |
requires = ["poetry-core>=2.0.0,<3.0.0"]
|
tests-prompts/frontend-accessibility.md
ADDED
|
@@ -0,0 +1,39 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Improve the frontend accessibility, also for writing better playwright tests
|
| 2 |
+
|
| 3 |
+
You are tasked with incrementally improving the accessibility and maintainability of a vanilla HTML/JS/CSS codebase. Follow these guidelines:
|
| 4 |
+
|
| 5 |
+
## Code deduplication
|
| 6 |
+
|
| 7 |
+
- there are some functions like `createButtonById()`, `createSelectWithOptListById()`, `createElementById()`
|
| 8 |
+
|
| 9 |
+
## Semantic HTML, ARIA, and Data Attributes
|
| 10 |
+
|
| 11 |
+
- Prefer semantic HTML elements (e.g., `<button>`, `<a>`, `<header>`, `<nav>`, etc.) for structure and interactivity.
|
| 12 |
+
- Use ARIA attributes to enhance or clarify accessibility, especially when semantic HTML alone is not sufficient. Semantic HTML and ARIA can be used together.
|
| 13 |
+
- If neither semantic HTML nor ARIA attributes are suitable for identification or testing, use custom data-* attributes (e.g., `data-testid`, `data-label`), especially to support Playwright test selectors and avoid breaking the test suite.
|
| 14 |
+
|
| 15 |
+
## Accessibility Best Practices
|
| 16 |
+
|
| 17 |
+
- Ensure all interactive elements are keyboard-accessible.
|
| 18 |
+
- Provide visible focus indicators for interactive elements.
|
| 19 |
+
- Use sufficient color contrast for text and UI elements.
|
| 20 |
+
- Ensure form elements have associated labels.
|
| 21 |
+
- Use descriptive link/button text.
|
| 22 |
+
- Add alt text to images and icons.
|
| 23 |
+
- Refactor duplicated code into reusable functions or components.
|
| 24 |
+
|
| 25 |
+
## Incremental Changes
|
| 26 |
+
|
| 27 |
+
- Make one small, focused change at a time.
|
| 28 |
+
- After each change, update the Playwright test suite to reflect the modification and verify accessibility improvements.
|
| 29 |
+
- Never break the Playwright test suite; preserve or update `data-*` attributes as needed for selectors.
|
| 30 |
+
|
| 31 |
+
## Test Suite Updates
|
| 32 |
+
|
| 33 |
+
- After every code change, review and update Playwright tests to match the new code and cover new accessibility features.
|
| 34 |
+
- Ask the user for review and approval.
|
| 35 |
+
|
| 36 |
+
## General Guidance
|
| 37 |
+
|
| 38 |
+
- Do not distort the original JS/HTML/CSS logic or design.
|
| 39 |
+
- Suggest other accessibility and code quality best practices as you proceed.
|