Skip to content

fix: resolve SonarQube accessibility issues across web app - #2

Merged
thomasluizon merged 1 commit into
mainfrom
fix/accessibility-sonarqube-issues
Apr 5, 2026
Merged

fix: resolve SonarQube accessibility issues across web app#2
thomasluizon merged 1 commit into
mainfrom
fix/accessibility-sonarqube-issues

Conversation

@thomasluizon

Copy link
Copy Markdown
Owner

Summary

  • Fix S6848 (Avoid non-native interactive elements): Replace interactive divs/outputs with proper buttons for all celebration overlays; add role="presentation" to backdrop overlays; add role="button" to habit-card article; add role="menu" to action menu portals; restructure checklist-templates into proper button elements
  • Fix S6847/S1082: Covered by converting non-interactive elements to native <button> elements which handle keyboard natively
  • Fix S6845 (tabIndex on non-interactive elements): Resolved by adding role="button" to habit-card article
  • Fix S6811 (aria-checked not supported by button role): Add role="checkbox" to habit-card selection button
  • Fix S6852 (tablist must be focusable): Add tabIndex={0} to tablist container

Files Changed (14)

File Changes
app-overlay.tsx role="presentation" on overlay, aria-hidden on backdrop
all-done-celebration.tsx <output> to <button> with role="status" wrapper
goal-completed-celebration.tsx <div> to <button> with role="status" wrapper
streak-celebration.tsx <output> to <button> with role="status" wrapper
streak-freeze-celebration.tsx <div> to <button> with role="status" wrapper
welcome-back-toast.tsx <div> to <button>
goal-list.tsx role="group" + aria-roledescription on draggable items
habit-card.tsx role="button" on article, role="checkbox" on selection, role="menu" on actions
checklist-templates.tsx Split nested spans into proper <button> elements
breakdown-suggestion.tsx Remove redundant onClick, add aria-hidden
notification-bell.tsx role="presentation" on backdrop
app-date-picker.tsx role="presentation" on backdrop
page.tsx (app) tabIndex={0} on tablist, role="menu" on dropdown
page.tsx (ai-settings) role="button" + keyboard handling on fact items

Test plan

  • TypeScript type-check passes (no new errors introduced)
  • All 178 unit tests pass
  • SonarQube re-scan confirms all flagged issues resolved

Generated with Claude Code

- S6848/S6847: Replace non-interactive divs with buttons for celebrations
  (all-done, goal-completed, streak, streak-freeze, welcome-back-toast)
- S6848: Add role="presentation" to backdrop overlays (app-overlay,
  notification-bell, app-date-picker)
- S6848: Add role="button" to habit-card article with click handlers
- S6848: Add role="menu" to action menu portal divs (habit-card, page.tsx)
- S6848: Restructure checklist-templates into proper button elements
- S6848: Add role/tabIndex/onKeyDown to ai-settings fact items in select mode
- S6811: Add role="checkbox" to habit-card selection button with aria-checked
- S6852: Add tabIndex={0} to tablist container for focusability
- S6848: Remove onClick from breakdown-suggestion checkbox visual div
  (label already handles toggle), add aria-hidden
- S6848: Add role="group" to goal-list draggable containers

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@vercel

vercel Bot commented Apr 5, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
orbit-ui-mobile-web Error Error Apr 5, 2026 0:50am

@sonarqubecloud

sonarqubecloud Bot commented Apr 5, 2026

Copy link
Copy Markdown

Quality Gate Failed Quality Gate failed

Failed conditions
0.0% Coverage on New Code (required ≥ 80%)

See analysis details on SonarQube Cloud

@thomasluizon
thomasluizon merged commit be1207c into main Apr 5, 2026
3 of 5 checks passed
@thomasluizon
thomasluizon deleted the fix/accessibility-sonarqube-issues branch April 5, 2026 17:52
thomasluizon added a commit that referenced this pull request Apr 15, 2026
…ferral/JWT

Security hardening on the web BFF auth layer:

- Dedicated /api/auth/{send-code,verify-code,google,logout} routes now call
  buildForwardedClientHeaders(request) so X-Forwarded-For / CF-Connecting-IP /
  X-Orbit-Country-Code / Accept-Language / X-Orbit-Time-Zone reach the .NET
  backend. Previously these routes sent no client context, so the backend's
  DistributedRateLimitFilter partitioned every anonymous auth request under
  the Next.js server IP — collapsing the per-client 5 req/min bucket.

- auth_token cookie maxAge changed from 86_400 (1 day) to 604_800 (7 days) so
  it matches the backend JwtSettings.ExpiryHours=168. Prevents daily forced
  token refresh round-trips.

- Length-cap the JWT payload segment in /api/auth/session before JSON.parse
  (4 KB ceiling). Blocks a memory-amplification vector where a malicious
  cookie contains a megabyte-scale base64 segment.

- Cap referral query-param at 40 chars before cookie write on the login page.

Includes new unit tests for send-code header forwarding and updates
auth-api.test.ts to assert the 7-day maxAge.

Covers frontend plan Area A #1, #2, #4, #5.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
thomasluizon added a commit that referenced this pull request Apr 15, 2026
…lidators

Covers the P1 missing-validation findings in the audit:

- validateGoalDeadline(deadline, today): blocks past dates, rejects garbage
  strings (goals.form.deadlinePast / goals.form.deadlineInvalid i18n keys).
- validateReminderTimes(minutes): enforces the backend contract that
  minutes-before-due offsets are integers in [0, 1440] and unique.
- validateDueTimes(dueTime, dueEndTime): blocks the case where a user sets
  only the end time without a start time.

validateReminderSelection and validateHabitForm now delegate into the new
validators so inline errors fire on the existing form flows without
touching each component.

Adds en/pt-BR i18n keys with proper diacritics on the Portuguese strings.
Extends validation.test.ts and goal-form.test.ts with exhaustive boundary
cases.

Covers frontend plan Area D #1, #2, #3.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
thomasluizon added a commit that referenced this pull request Apr 15, 2026
DraggableFlatList previously had no getItemLayout, so React Native had to
measure every row before rendering during initial scroll and drag events.
With 40+ habits on mid-tier Android this produces visible jank.

Adds an approximate ESTIMATED_HABIT_ITEM_HEIGHT=104 and wires getItemLayout
onto the primary DraggableFlatList driver. The value does not need to be
perfect: telling RN that rows are of roughly uniform height unlocks
scroll-to-offset fast-paths and smoother drag.

Covers frontend plan Area C #3 (P0 #9).

Note: Splitting habit-list.tsx + habit-card.tsx into smaller files
(Area C #1, #2) is deferred as a TODO — it is a large refactor across
2,119 + 1,511 LOC and is better done in a dedicated PR with profiling
measurements.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
thomasluizon added a commit that referenced this pull request Jul 10, 2026
…h) (#441)

Stage 7h of the harness-upgrade plan, paired with agentic-dev-workflow PR #2
(the generic dual-target hook engine). Gives Orbit opencode enforcement parity on
this machine using the same shared-logic-core + adapter pattern the pack
standardizes: every rule lives once, both tools enforce it, no twin drift.

Shared logic core — .claude/hooks/_lib/ (pure, both tools call it):
- rules-git.mjs      checkGitCommand (protected-ref push, bypass flags, commit -n)
                     + checkNpmExpoPin (Expo SDK 57 pin guard)
- rules-content.mjs  checkEmDashes + checkBrandColors (scan only the added text)
- rules-source.mjs   checkTsAntipatterns, checkNewTodos, checkCsharpAuthz,
                     checkCsharpTimezone, checkCsharpFluentConfig (whole-file)
- rules-parity.mjs   classifyScope + parityMessages (cross-platform nudge)
- io.mjs             payload normalizers for both tools

Claude Code side: all 10 hooks refactored into thin adapters over _lib
(byte-faithful — the exact regexes and stderr messages are preserved; settings.json
wiring unchanged since the filenames are unchanged).

opencode side: .opencode/plugin/orbit-guardrails.js — one plugin wiring the SAME
_lib. tool.execute.before runs the git/Expo-pin + added-text content rules (block by
throw); tool.execute.after runs the whole-file rules + parity nudge (a throw surfaces
the violation the way the CC PostToolUse exit-2 does); event/session.idle emits a
best-effort proactivity nudge. opencode auto-loads it from .opencode/plugin/.

Mapping note: opencode has no PostToolUse, so whole-file rules run in
tool.execute.after (file written) and added-text rules in tool.execute.before (can
block); the proactivity Stop-gate degrades to an idle nudge because opencode cannot
rewind a finished turn.

Proof (.claude/hooks/test-hooks.mjs, 42 assertions): _lib unit checks + the REAL
Claude Code hooks (regression guard, confirming the refactor preserved behavior) +
the REAL opencode plugin — the same rule yields the same verdict in both tools.

Cross-links agentic-dev-workflow PR #2.

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
thomasluizon added a commit that referenced this pull request Jul 19, 2026
Two problems, one of which made every previous number meaningless.

THE ANSWER KEY. judge-surfaces.mjs was feeding the judge the list of defects a
human had already found (the user-found-defects spec). A judge handed the answer
key can quote a defect instead of seeing it, and one recorded finding does
exactly that: it says it CANNOT verify "known defect #2", by number. Recall was
unmeasurable by construction. That spec is no longer in the prompt.

CALIBRATION. Nobody had ever measured what fraction of known defects the judge
catches. Now measured, against the 12 human-found defects:

    ADJUDICATED RECALL, defects it could see:  0/7   (0.0%)
    ADJUDICATED RECALL, all known defects:     0/12  (0.0%)
    STRUCTURALLY INVISIBLE to the pipeline:    5/12

The first cut of calibrate-judge.mjs scored 3 hits and would have reported
42.9%. Reading the matched text showed all three were spurious - "title" matched
inside "toast covers the page title", "chevron" matched an unrelated nav row.
Every candidate is now adjudicated by reading it, each rejection carries its
reason in the tool, and the tool prints the contamination warning above so the
number is never quoted without it.

So the judge stops being a completion oracle and becomes what the evidence
supports: a defect detector. It can VETO a cell via a blocker finding; it can
never grant one. "blocker" is now defined as something a user would hit - text
overflowing or truncated, overlapping elements, wrong locale, a visible
functional failure - and taste complaints are explicitly minor and advisory.

Its output moves to a cell-keyed report under .claude/manifests/, pinned to the
surface's visual signature (so a report describing a since-rewritten surface
cannot carry forward), and COMMITTED rather than living in a gitignored
artifacts folder, so findings survive the session that produced them.

capture-surfaces.mjs gains the state axis in its artifact names, and now reports
- rather than silently mis-fills - the two cell classes it cannot photograph: a
non-default state (the live stack can only render whatever the seeded database
holds) and any mobile cell (no React Native capture pipeline exists). A
populated screenshot filed against an `empty` cell would be worse than no
artifact, because it would look like evidence.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SAUfXRAgg19p9zHPsAuYEt
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant