Repository navigation
Conversation
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.
|
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 configurationConfiguration used: Repository: tolgee/tolgee-platform/.coderabbit.yaml Review profile: CHILL Plan: Essentials Run ID: 📒 Files selected for processing (1)
Included review availability: Your plan provides up to 8 included reviews per hour; 5 remain after this review. 📝 WalkthroughWalkthroughQA 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. ChangesQA issue ignore
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
Merge Risk: ⚪ Minimal · up to 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)
✅ Passed checks (4 passed)
✨ Finishing Touches 💡 1📝 Generate docstrings 💡
🧪 Generate unit tests (beta)
Comment |
|
This PR is stale because it has been open for 30 days with no activity. |
|
This PR was closed because it has been inactive for 14 days since being marked as stale. |
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: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, becauseTranslationVariantVisualhands it variant-offset issues.Non-plural keys were not affected, because their variant offset is 0.
Fix
useQaChecksForPanelnow owns the ignore and unignore requests. It exposestoggleIgnore(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.QaChecksPanelonly ever deals with variant-relative issues. All offset handling now lives in the hook: one conversion for display, one for the request.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.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
key_plural_issue: a plural FR translation with an OPEN issue in theonevariant, 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