Skip to content

fix: ignoring QA issues in plural variants - #3951

Open
Anty0 wants to merge 4 commits into
mainfrom
jirikuchynka/fix-qa-ignore-plural-offsets
Open

Anty0 wants to merge 4 commits into
mainfrom
jirikuchynka/fix-qa-ignore-plural-offsets

Conversation

@Anty0

@Anty0 Anty0 commented Sep 25, 2026 •

Copy link
Copy Markdown
Member

Problem

On plural keys, clicking Ignore on a QA issue did nothing: the issue flipped to ignored for a split second, then went back to open.

The translation side panel shows issue positions relative to the plural variant being edited, which "Correct" needs. But it also sent those variant-relative positions to POST …/qa-issues/suppressions, and that endpoint matches on positions in the full ICU text. For a plural variant the match never succeeded, so the backend:

  • created a separate virtual IGNORED issue at the variant-relative position, and left the real issue OPEN,
  • published qa-issues-updated, which reset the panel from the server data and put the issue back to OPEN.

Every later click just re-ignored the stray virtual issue. Un-ignoring had the same problem: the DELETE matched nothing, and the backend returned 204 without changing anything.

The list-view tooltip (QaIssueHighlight) had the same bug, because TranslationVariantVisual hands it variant-offset issues.

Non-plural keys were not affected, because their variant offset is 0.

Fix

  • Side panel: useQaChecksForPanel now owns the ignore and unignore requests. It exposes toggleIgnore(issue), which converts the variant-relative issue back to full-text positions before sending it, and uses the same converted issue for the local state update. QaChecksPanel only ever deals with variant-relative issues. All offset handling now lives in the hook: one conversion for display, one for the request.
  • List-view tooltip: ignores by issue id (PUT …/qa-issues/{issueId}/ignore). The issues it shows always come from the database and always have an id, so positions don't matter there.
  • No backend change.

Existing bad data

Each recheck deletes all issues, virtual ones included, and re-inserts them (replaceIssuesForTranslations). The stray virtual issues created by this bug go away the next time the translation is rechecked, so no migration is needed.

Tests

  • New e2e test data key key_plural_issue: a plural FR translation with an OPEN issue in the one variant, at a full-ICU-text position.
  • issueActions.cy.ts: ignores the issue, reloads, and asserts there is exactly one issue and it is IGNORED. Then it un-ignores, reloads, and asserts one issue that is OPEN. The reloads make the test check what the server stored, not local state.
  • highlighting.cy.ts: ignores the plural issue from the list tooltip and asserts the marker disappears.
  • filters.cy.ts: the "Any QA issue" filter now also expects the new key.

I couldn't run e2e locally (Docker ran out of space building the e2e image), so CI is the first e2e run.

Summary by CodeRabbit

  • Bug Fixes
    • Ignoring QA issues on plural translations now works correctly and remains in effect after reloading. Ignored issues can also be reopened, returning them to the open state.
    • Ignored issue markers disappear from the translation view.
    • The “Any QA issue” filter now includes keys with plural-variant issues, making them visible in filtered results.

The side panel and the list-view highlight tooltip sent variant-relative
positions to the suppression endpoint, which matches on full-text positions.
For plural keys this never matched the real issue: the backend created a
separate virtual ignored issue instead, and the websocket update then reset
the panel back to OPEN.

The panel's ignore/unignore requests now live in useQaChecksForPanel, which
converts positions back before sending. The highlight tooltip ignores by
issue id.
@coderabbitai

coderabbitai Bot commented Sep 25, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository: tolgee/tolgee-platform/.coderabbit.yaml

Review profile: CHILL

Plan: Essentials

Run ID: a1cb227e-9967-42a9-ae49-bb3af78d51d9

📥 Commits

Reviewing files that changed from the base of the PR and between 145b815 and 606df92.

📒 Files selected for processing (1)
  • e2e/cypress/e2e/qa/issueActions.cy.ts

Included review availability: Your plan provides up to 8 included reviews per hour; 5 remain after this review.


📝 Walkthrough

Walkthrough

QA issue ignore actions now use the panel hook for suppression changes and an issue-specific endpoint from the issue highlight. Test data adds a French plural-variant QA issue. Cypress tests cover filtering, ignoring the issue from its marker, and ignore-state persistence across reloads.

Changes

QA issue ignore

Layer / File(s) Summary
Ignore mutation handling
webapp/src/ee/qa/hooks/useQaChecksForPanel.ts, webapp/src/ee/qa/components/QaChecksPanel.tsx, webapp/src/ee/qa/components/QaIssueHighlight.tsx
The panel delegates ignore toggles to its hook. The hook adjusts issue positions, adds or removes suppressions, and updates preview state after a successful mutation. The issue highlight sends a PUT request to the issue-specific ignore endpoint.
Plural-variant issue coverage
backend/data/src/main/kotlin/io/tolgee/development/testDataBuilder/data/QaE2eTestData.kt, e2e/cypress/e2e/qa/filters.cy.ts, e2e/cypress/e2e/qa/highlighting.cy.ts, e2e/cypress/e2e/qa/issueActions.cy.ts
Test data seeds a French plural-variant punctuation issue. Cypress tests cover the issue filter, ignoring it from its marker, and ignoring and unignoring it across reloads.

Priority: ⬇️ Low

Estimated code review effort: 3 (Moderate) | ~20 minutes

Change: Bug fix

Sequence Diagram(s)

sequenceDiagram
  participant QaChecksPanel
  participant useQaChecksForPanel
  participant SuppressionEndpoint
  QaChecksPanel->>useQaChecksForPanel: toggleIgnore(issue)
  useQaChecksForPanel->>SuppressionEndpoint: POST or DELETE suppression
  SuppressionEndpoint-->>useQaChecksForPanel: mutation success
  useQaChecksForPanel->>useQaChecksForPanel: update preview state
Loading

Merge Risk: ⚪ Minimal · up to 606df

The plural-variant ignore flow targets the intended issue and preserves its state across reloads. No actionable merge-blocking risk is evident.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 1 functions across 7 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the main change: fixing QA issue ignore behavior for plural translation variants.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
  • Fix all pre-merge checks with AI
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR

Comment @coderabbitai help to get the list of available commands.

@github-actions

Copy link
Copy Markdown
Contributor

This PR is stale because it has been open for 30 days with no activity.

@github-actions github-actions Bot added the stale label Oct 26, 2026
@github-actions

Copy link
Copy Markdown
Contributor

This PR was closed because it has been inactive for 14 days since being marked as stale.

@github-actions github-actions Bot closed this Nov 10, 2026
@Anty0 Anty0 reopened this Nov 27, 2026
@Anty0 Anty0 added bug Something isn't working and removed stale labels Nov 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant