Spaces:
Sleeping
Sleeping
Commit History
-
fix_pptx_lang_tags: stop counting noProof as a language tag
ClaudeUnverified signaturenoProof is a boolean spell-check toggle (value '1'/'0'), not a language code. The tool already declined to rewrite it, but it was being counted in the findings — invisible before, but the new per-XML-part table surfaces it clearly as confusing rows like 'Slide 12 | 1 | 1'. Removed noProof from LANG_ATTRS so it's no longer scanned at all; dropped the now-unnecessary guard in the rewrite branch. Verified: 'noProof' values no longer appear in the language findings; smoke test 7/7; acronym tests pass.75e9921 -
Make findings tables easier to interpret
ClaudeUnverified signature- Status badges: 'status' cells render as colored pills — green (OK, decorative), amber (weak, vague, bare URL), red (missing, duplicate, empty) — so problems jump out of long reports. Terse codes get human labels (URL_AS_TEXT -> 'bare URL'). - Friendly XML-part names: 'file' cells show 'Layout 5' / 'Master 1' / 'Slide 3' / 'Presentation' instead of raw zip paths; full path stays in a tooltip. - Row tinting: the PPTX lang runner marks non-target-language rows with _flag, and the UI tints them amber — the rows that will actually change are instantly visible. Smoke test 7/7; flag and statuses verified.84762f6 -
Remove the 'View this Space on Hugging Face' link
ClaudeUnverified signatureDropped the link below the tool picker and its now-unused CSS classes (.panel-footer, .external-link).f34ade1 -
fix_pptx_lang_tags: per-XML-part breakdown in the findings table
ClaudeUnverified signatureThe findings table for the PPTX language tool now shows one row per (XML part, language) pair instead of a per-language total — so you can see exactly which slide/layout/master XML files contain each tag and how many occurrences live in each. Rows are sorted with non-target languages first (the ones actually being changed), then by occurrence count desc. Smoke test 7/7.299af37 -
Simplify the file chip: one chip, 'Reusing' only after a run
ClaudeUnverified signatureThe upload area showed two redundant chips ('Reusing X' + 'X (size)'). Now a single chip shows 'name (size)' on first upload, and switches to 'Reusing: name (size)' (accent-styled) only after a run, when carry-over is actually in play. Batches collapse to 'N files (total size)'. The flag resets on a new selection/drop, on Clear, and when switching file types.51a5ba2 -
Accessibility polish: 5 markup-level fixes
ClaudeUnverified signature- Update stale <title> to 'Accessibility Toolkit'. - Add a 'Skip to main content' link (hidden until focused) and id='main' on <main> for landmark navigation. - External HF link: hide the decorative arrow from screen readers and add a visually-hidden '(opens in new tab)' so the new-window behaviour is announced. - Move the file-chip aria-live region off the <ul> (which re-announced the whole list on every change) onto a dedicated visually-hidden #file-status paragraph that gets a concise, change-focused message. - Findings tables now carry a visually-hidden <caption> (the result summary) and <th scope='col'>, improving screen-reader table navigation. Smoke test 7/7.65f0e13
-
Add 'View this Space on Hugging Face' link next to the tool picker
ClaudeUnverified signatureA clickable link inside a <select>'s options isn't possible in HTML, so the link sits just below the dropdown's description in the same panel. Opens the Space in a new tab with rel=noopener.5952490
-
Suggest other audits after an audit result
ClaudeUnverified signatureThe four read-only PPTX checks (check_slide_titles, check_hyperlinks, check_font_size, report_alt_text) now carry an 'audit' flag (exposed via /api/tools). After an audit result renders, a 'Run another audit on this file:' chip row appears listing the other audits — one click switches the tool and submits, so stacking audits on a single deck is one-click discoverable rather than a hidden feature of the kept-upload behavior.c4f6326 -
Keep the uploaded file across tool changes
ClaudeUnverified signatureAfter a run, the file stays in the form so you can pick another tool and run again without re-uploading — useful for stacking the read-only audits (titles, alt text, links, font size) on one deck. The file is cleared only when switching between PPTX and PDF tools (different accept types). A 'Reusing <name>' chip and a small 'Clear' button make the carry-over visible and reversible.3418807 -
Drop the wheelchair emoji from the HF Space card
ClaudeUnverified signatureRemoved the 'emoji: ♿' line from the Space YAML frontmatter and renamed the title to 'Accessibility Toolkit' (matching the app's hero header).b970911 -
Trim redundant placeholder text on the tool select
ClaudeUnverified signatureThe label already reads '1. Choose a tool'; the select's placeholder 'Select a tool…' repeated it. Shortened to 'Select…'.c36a3b2 -
Fix doubled focus ring on the tool select
ClaudeUnverified signatureThe global :focus-visible outline (with a 2px offset gap) was applying to form controls on top of their own focus style, producing two concentric rings. Scope the outline ring to buttons/links/summary; inputs and selects now show a single gap-free box-shadow ring (also handled for :focus-visible).b78ae72 -
Remove the wheelchair icon from the hero header
ClaudeUnverified signature15e9087 -
Refresh the UI styling
ClaudeUnverified signature- Gradient hero header with a badge; renamed the page to "Accessibility Toolkit". - Card surfaces with soft shadows and rounded corners; refined typography. - Indigo/violet accent across buttons (gradient + hover lift), links, focus rings, chips, and table header/row hover. - Nicer form controls (custom select caret, consistent focus rings), a softer dropzone with hover/drag states, and pill-style file chips. - Full dark-mode support via prefers-color-scheme (CSS variables) and a prefers-reduced-motion guard. All class names/IDs preserved, so the frontend JS is unchanged; pages serve and smoke test 7/7.c57a9b4 -
Group the four new tools under a Beta section in the UI
ClaudeUnverified signatureMarked check_slide_titles, check_hyperlinks, check_font_size, and set_pdf_title with a `beta` flag (exposed via /api/tools). The frontend now lists stable tools under PowerPoint/PDF and these four under a separate "Beta (experimental)" optgroup, and prefixes a selected beta tool's description with "Beta ·".f9d1602 -
Add four accessibility checks/tools (now 14 tools)
ClaudeUnverified signature- check_slide_titles (pptx): reports slides with missing/empty or duplicated titles — key for screen-reader navigation. Read-only. - check_hyperlinks (pptx): flags non-descriptive link text ("click here", bare URLs, empty). Read-only. - check_font_size (pptx): reports runs below a minimum point size (default 18, configurable); runs with inherited sizes are counted as undetermined. Read-only. - set_pdf_title (pdf): sets the document title (/Info + XMP) and enables the DisplayDocTitle viewer preference so readers show the title, not the filename (PDF/UA). Produces a file. All wired into the registry/runners with structured reports; CLIs included. Smoke test bumped to 14 tools (7/7), acronym tests pass, all four verified on a purpose-built deck/PDF.e553423 -
Cosmetic cleanup: dead code and a fragile temp-dir name
ClaudeUnverified signature- remove_footer_text: drop unused imports (os, copy, RELATIONSHIP_TYPE, etree). - pptx_to_accessible_html: remove dead locals in get_alt_text (it computed nvPr/cNvPr and a fallback loop whose results were never used; the iter-based search below is the real logic). - fix_math_italics: use a unique tempfile.mkdtemp() dir instead of a fixed '_pptx_math_temp' name, removing a latent collision risk. No behavior change: all modules import, the touched tools and CLIs run, alt text still extracted, temp dirs cleaned up, smoke test 7/7.093436e -
fix_pdf_lang_tags: terminate the object-graph walk on cyclic PDFs
ClaudeUnverified signaturewalk_all_objects deduped visited nodes by id(), but pikepdf returns a fresh Python wrapper on every access, so the visited set never matched and reference cycles (page /Parent -> /Pages -> /Kids -> page) were re-walked until the recursion limit — masked by the broad `except Exception: pass`. A 3-page blank PDF triggered 2,071 walk calls; a real multi-page tagged PDF could near-hang. Now dedupe indirect objects by their stable (objnum, gen) id (objgen) and always recurse direct objects (which can't form cycles). Same 3-page PDF now takes 36 calls; /Lang detection and rewriting still work.3879475 -
Surface the built-in acronym list in the UI
ClaudeUnverified signatureThe "Keep acronyms" help text said a built-in list always applies, but there was no way to see it. Added GET /api/acronyms (served from acronyms.txt) and a lazy-loading "View the built-in acronym list" expander under the keep field that shows the preserved acronyms as chips. README links the source file too. Verified: endpoint returns the 72-entry sorted list, the option exposes the show_acronyms flag, smoke test 7/7.169d8a2 -
Minor robustness fixes: B4, B5, S5
ClaudeUnverified signatureB5: fix_pdf_lang_tags now escapes the target language for the PDF content- stream literal string, so a value containing '(' ')' or '\\' can't malform the stream (the dictionary path already escaped via pikepdf.String). B4: a background task sweeps abandoned result files every 10 min via the app lifespan, so idle downloads are cleaned even with no further requests (was only swept at the start of the next run). S5: uploads are now content-checked by leading bytes (%PDF / PK zip header), not just extension, so files that don't match their claimed type are rejected before reaching a parser. Verified: garbage .pptx rejected as invalid, PDF target with parens stays a valid PDF, sweeper starts with the app, smoke test 7/7, acronym tests pass. B3 (lone 'i'->'I') investigated and dropped: _to_mixed_case output is identical to str.title() in every 'i' case, so there is no real defect.bc4fb4f -
fix_math_italics: honor OMML run styling (B2)
ClaudeUnverified signatureItalic/bold detection previously used only Unicode math codepoints and DrawingML <a:rPr> i/b attributes, so a variable stored as a plain letter with OMML <m:rPr><m:sty m:val="i"/> exported upright. Now also read <m:sty> (i/b/bi/p) and <m:nor>, and default a single-letter variable to italic when no styling is specified (the OMML convention). Verified: a variable with m:sty val="i" now exports as an italic run.059aa58 -
Sanitize error responses, guard env var, drop runtime pip (S2/B1/S3)
ClaudeUnverified signatureS2: unexpected runner failures and the 500 handler no longer echo raw exception text (which could include temp paths/internals) to the client. The full traceback is logged server-side; the client gets a generic message. Intentional ToolError messages are still shown as before. B1: MAX_UPLOAD_MB now falls back to 100 on a non-numeric value instead of crashing the app at startup. S3: removed the os.system("pip install lxml ...") ImportError fallbacks in fix_slide_number_order and fix_math_italics (lxml is a declared dependency); dropped the now-unused os import. Verified: corrupt upload yields a generic per-file error (traceback logged), both CLIs still run, smoke test 7/7, acronym tests pass.99f30ce -
Harden XML parsing against hostile uploads (S4)
ClaudeUnverified signatureThe three lxml-based PPTX tools parse XML straight from uploaded files. They now use a parser with resolve_entities=False, load_dtd=False, no_network=True, closing entity-expansion (billion-laughs) and external-entity vectors as defense-in-depth. A fresh parser is created per call so it's safe to use from the threadpool (lxml parsers aren't shareable across threads). Verified: a nested-entity payload is left unexpanded; all three tools still process a real deck; smoke test 7/7.2718b7d -
Offload processing to a threadpool; thread-safe report capture
ClaudeUnverified signatureS1: /api/run ran the CPU-bound tool synchronously inside an async endpoint, so one large/slow file blocked the event loop and every other request (including /api/health). The runner now runs via run_in_threadpool, freeing the loop. B-F: that fix exposed a latent bug — report capture used a process-global redirect_stdout, which would interleave across concurrent threads. Replaced it with a thread-local stdout/stderr proxy: each run captures only its own output; writes outside a capture (and other threads) go to the real streams. Verified: two threads printing 200 interleaved lines each show zero cross-talk; smoke test 7/7; acronym tests pass.5c63056 -
Add a per-file upload size limit
ClaudeUnverified signatureUploads are now capped per file (default 100 MB, configurable via the MAX_UPLOAD_MB env var) and enforced while streaming to disk, so an oversized file is rejected mid-transfer with HTTP 413 instead of landing in full. The work dir is cleaned up on rejection. /api/tools advertises the limit; the UI shows it and pre-checks file sizes before uploading. Verified: 413 on over-limit upload (with cleanup), normal uploads unaffected, smoke test 7/7.87a4624 -
Flag filename-like alt text as WEAK
ClaudeUnverified signaturereport_alt_text now distinguishes alt text that is just an image filename (e.g. python-pptx's auto-filled "dot.png") from a real description: such images get a WEAK status and their own count, so reviewers don't mistake a filename for genuine alt text. The heuristic only flags text ending in an image extension, so prose like "See diagram.png in the appendix" stays OK.359428c -
UI niceties + accessibility polish
ClaudeUnverified signature- Drag-and-drop upload zone (keyboard-operable: the file input stays focusable and the zone shows a focus ring via :focus-within); selected files shown as chips with sizes. - Per-tool options remembered in localStorage and restored on tool select. - Accessibility: move focus to the results heading after a run, set aria-busy on the form while processing, associate the upload control with its label and help text, an aria-live region for selected files, and a prefers-reduced-motion guard. - README: list the new report_alt_text tool. Smoke test 7/7, acronym tests pass, JS syntax-checked, static assets serve.887cffc -
Add alt-text reporter tool
ClaudeUnverified signaturetools/pptx/report_alt_text.py scans a deck and reports every image's alt-text status (OK / DECORATIVE / MISSING), reusing the same descr/decorative detection as the HTML exporter. Read-only — produces a structured findings report (slide, shape, status, alt_text) and no output file. Wired into the registry and runners as the 10th tool; usable from the CLI too. Verified: OK, DECORATIVE, and MISSING paths all detected; smoke test updated to expect 10 tools (7/7 green).4e7642c -
Structured reports instead of scraped stdout
ClaudeUnverified signatureRunners now return a structured RunResult (summary, counts, findings table rows + columns, and a collapsible raw_log) rather than a captured-text blob. The structured data comes from each tool's return value or an additive, non-breaking hook (an optional changes list, or a return dict where the function previously returned None) — the CLIs are byte-for-byte unchanged. - tools: convert_caps/replace_allcaps/remove_footer_text expose before->after changes; fix_pptx_lang_tags/fix_pdf_lang_tags return their findings counters; fix_math_italics returns structured replacements; fix_slide_number_order lists the slides it reordered. - API: /api/run/{tool} now returns one structured block per file (unifying single + batch); per-file errors are reported in-band rather than aborting. - frontend: renders summary, count chips, a findings table, and a "Show log" details pane per result. Verified: structured output end-to-end, all CLIs unchanged, acronym tests and smoke test (7/7) green.154b1f0 -
Add CI workflow
ClaudeUnverified signature.github/workflows/ci.yml runs on every push/PR: - tests job: installs deps + QPDF, runs the acronym regression tests, starts the app, and runs the HTTP smoke test against it. - docker job: runs scripts/docker_smoke.sh to build the image and smoke-test the container (covers the Dockerfile/HF image we can't build locally). README gets a CI status badge.d704a4f -
Add regression tests locking the caps acronym lists in sync
ClaudeUnverified signaturetests/test_acronyms.py asserts both tools derive from tools/pptx/acronyms.txt, that they agree case-insensitively, the specific WCAG regression stays fixed, and that the file has no case-duplicate entries. Runs standalone (python tests/test_acronyms.py) or under pytest. Currently 4/4 green.227dc45 -
Unify the two caps tools' acronym lists
ClaudeUnverified signatureconvert_caps (KEEP_WORDS) and replace_allcaps_pptx (PRESERVE_UPPERCASE) each carried their own hardcoded acronym list, and they had drifted: e.g. "WCAG" was preserved by replace_allcaps but mangled to "Wcag" by convert_caps when it appeared as caps *formatting*. Both now load one shared source of truth, tools/pptx/acronyms.txt (loaded relative to __file__, so it works for the CLI, the run.py launcher, and the web app's importlib loading). convert_caps uses the canonical casing; replace_allcaps uses the uppercased forms. Verified: lists agree (72 entries), WCAG with caps formatting now stays WCAG, and the smoke test passes 7/7.d0a3b3d -
Add GitHub Action to sync to the Hugging Face Space
ClaudeUnverified signature.github/workflows/sync-to-hf.yml force-pushes the current ref to the Space's main branch on every push to main (and on manual dispatch), so the live app rebuilds automatically. Reads HF_TOKEN (secret) and HF_USERNAME / HF_SPACE (repo variables); fails early with a clear message if any are unset. README documents the one-time setup.5061d1f -
Make the app deployable as a Hugging Face Docker Space
ClaudeUnverified signature- README.md: add HF Space YAML frontmatter (sdk: docker, app_port: 8000) and a "Deploy to Hugging Face Spaces" section. - Dockerfile: run as non-root user 1000 (HF best practice), copy app with --chown, keep QPDF/libxml baked in; serves on port 8000. - .dockerignore: trim the runtime image (drop .git, tests, scripts, docs). Reuses the existing FastAPI backend + single-page UI unchanged. Smoke test still green (7/7) against a local server.36dd4d2 -
Add batch processing (multi-file upload -> zip)
ClaudeUnverified signature- /api/run/{tool} now accepts multiple files. One file returns that file directly (unchanged); multiple files are processed independently and zipped, with arcname de-duplication and a combined per-file report. Per-file errors are captured in the report so one bad file doesn't sink the batch. - Frontend: file input accepts multiple; status shows the file count. - smoke_test.sh: switch to the `files` field and add a batch (zip) check. Smoke test green (7/7), including batch.7246dc8 -
Add smoke tests and fixtures
ClaudeUnverified signature- scripts/smoke_test.sh: dependency-light HTTP smoke test (curl + python3) exercising health, tool list, a file-producing PPTX and PDF tool with download, the report-only preview path, and wrong-file-type rejection. - scripts/docker_smoke.sh: build image, run container, wait for health, run the HTTP smoke test against it, tear down. - tests/fixtures: small sample.pptx/sample.pdf plus _generate.py to recreate them. HTTP smoke test verified green against a local uvicorn (6/6).8960eeb -
Wire all 9 tools into the FastAPI web app
ClaudeUnverified signature- runners.py: adapter layer that loads each CLI tool by file path (so tools/pptx never shadows the python-pptx package) and wraps its existing core function, capturing printed output as the report and normalising the report-only / dry-run / no-output cases. - registry.py: metadata + option schema + runner for each of the 9 tools. - main.py: POST /api/run/{tool} (multipart upload + typed options) and GET /api/result/{id} (download then clean up); /api/tools serves schemas. - frontend: tool picker + dynamic option fields, upload, report, download. - fix_slide_number_order: extract importable process_pptx() from main(). - replace_allcaps_pptx: fix double ._element deref in clear_font_allcaps (the script was previously untested and crashed on any run). All 9 tools verified end-to-end through the HTTP API with sample files.8bc7d4e -
Scaffold PPTX/PDF accessibility tools web app
ClaudeUnverified signatureLays out the structure from CLAUDE_CODE_BRIEF.md without implementing tool logic: empty FastAPI app with /api/health and /api/tools, static frontend stub, empty tool registry, Dockerfile + docker-compose with qpdf baked in for pikepdf. Existing CLI scripts moved into tools/.307de64