Summary
Two enhancements to the batch proofreading feature in the Reports tab:
- Allow selecting and copying text from proofreading issue cards
- Add an "Auto-fix" mode that applies suggested corrections directly to target segments
1. Enable text selection and copying in issue cards
Current behaviour
- Issue cards in the Reports tab display segment number, issue description, and suggestion text
- Text cannot be selected, right-clicked, or copied — the entire card is a click target for navigation
- This makes it impossible to copy a suggestion and manually paste it into the target
Desired behaviour
- The issue description and suggestion text should be selectable and copyable
- Right-click should show a context menu with at least "Copy" (or the standard Windows text selection context menu)
- Clicking the segment number / header area should still navigate to the segment
- Alternatively, add a small copy button (📋) next to the suggestion text
Implementation notes
The issue cards are built with Label controls in ReportsControl.cs (lines 257–377). Labels don't support text selection. Options:
- Replace
Label with RichTextBox set to ReadOnly = true, BorderStyle = None, matching background colour
- Or add a "Copy suggestion" link/button that copies
issue.Suggestion to the clipboard
- Keep the card-level click handler for navigation, but don't let it swallow clicks on the text area
2. Automatic proofreading (auto-fix mode)
Current behaviour
- Proofreading results are advisory only — the user must manually navigate to each segment and apply fixes
- Suggestions often contain the corrected text, e.g.:
"Suggestion: Rewrite as follows: De kat zat op de mat."
"Suggestion: Reposition to keep the sentence intact: Het was een mooie dag."
"Suggestion: Change 'word' to 'correct word'"
Desired behaviour
Add a second proofreading mode (or a post-proofreading action) that automatically applies suggested corrections to the target segments. The flow would be:
- User runs proofreading as normal (or selects "Proofread & Auto-fix")
- The same numbered issue cards appear in the Reports tab
- For segments with issues, the system extracts the corrected text from the suggestion and writes it into the target segment
- The segment status changes to "Draft" (not "Confirmed") so the user can review
- Issue cards could show a before/after diff or indicate "Auto-fixed ✓"
Extracting corrected text from suggestions
The LLM response format (parsed in ProofreadingPrompt.cs ParseBatchResponse()) currently captures a free-text Suggestion: field. To make auto-fix reliable, we need the LLM to return the complete corrected target text separately from the explanation.
Proposed approach — extend the LLM output format:
Change the required response format from:
[SEGMENT 0001] ISSUE
Issue: Missing article before "huis"
Suggestion: Rewrite as follows: Het huis is groot.
To:
[SEGMENT 0001] ISSUE
Issue: Missing article before "huis"
Suggestion: Add the definite article "het" before "huis"
Corrected: Het huis is groot.
This adds a Corrected: line that contains the full replacement target text, making extraction unambiguous. The parser in ProofreadingPrompt.cs would need a new regex:
var correctedPattern = new Regex(@"^\s*Corrected\s*:\s*(.+)", RegexOptions.IgnoreCase);
And ProofreadingIssue would get a new field:
public string CorrectedText { get; set; }
Applying the fix
In AiAssistantViewPart.cs, after receiving a SegmentProofread event with a non-empty CorrectedText:
if (autoFix && !string.IsNullOrEmpty(issue.CorrectedText))
{
// Navigate to the segment
_activeDocument.SetActiveSegmentPair(issue.ParagraphUnitId, issue.SegmentId, true);
// Get the active segment pair
var segPair = _activeDocument.ActiveSegmentPair;
// Replace target text
segPair.Target.Clear();
segPair.Target.Add(issue.CorrectedText);
// Set to draft so user can review
segPair.Properties.ConfirmationLevel = ConfirmationLevel.Draft;
}
(The exact Trados SDK API for modifying segment text will need verification — it may require using ISegment methods or the document's ISegmentPair API.)
UI for auto-fix mode
Options:
- A toggle checkbox in the batch proofreading controls:
☐ Auto-fix segments
- Or a separate button:
[Proofread] vs [Proofread & Fix]
- Or a post-run button in the Reports tab:
[Apply All Fixes] that processes all issues with a CorrectedText
Safety considerations
- Only apply fixes where
CorrectedText is non-empty and different from the current target
- Set confirmation level to Draft, never Confirmed — the user must review
- Show a summary: "Applied X fixes to Y segments"
- The existing "check off" mechanism (checkboxes on cards) could be used to selectively apply fixes
Priority
- Text copying — quick win, improves usability immediately
- Auto-fix — larger feature, needs prompt format extension + SDK integration
Labels
Enhancement
Summary
Two enhancements to the batch proofreading feature in the Reports tab:
1. Enable text selection and copying in issue cards
Current behaviour
Desired behaviour
Implementation notes
The issue cards are built with
Labelcontrols inReportsControl.cs(lines 257–377). Labels don't support text selection. Options:LabelwithRichTextBoxset toReadOnly = true,BorderStyle = None, matching background colourissue.Suggestionto the clipboard2. Automatic proofreading (auto-fix mode)
Current behaviour
"Suggestion: Rewrite as follows: De kat zat op de mat.""Suggestion: Reposition to keep the sentence intact: Het was een mooie dag.""Suggestion: Change 'word' to 'correct word'"Desired behaviour
Add a second proofreading mode (or a post-proofreading action) that automatically applies suggested corrections to the target segments. The flow would be:
Extracting corrected text from suggestions
The LLM response format (parsed in
ProofreadingPrompt.csParseBatchResponse()) currently captures a free-textSuggestion:field. To make auto-fix reliable, we need the LLM to return the complete corrected target text separately from the explanation.Proposed approach — extend the LLM output format:
Change the required response format from:
To:
This adds a
Corrected:line that contains the full replacement target text, making extraction unambiguous. The parser inProofreadingPrompt.cswould need a new regex:And
ProofreadingIssuewould get a new field:Applying the fix
In
AiAssistantViewPart.cs, after receiving aSegmentProofreadevent with a non-emptyCorrectedText:(The exact Trados SDK API for modifying segment text will need verification — it may require using
ISegmentmethods or the document'sISegmentPairAPI.)UI for auto-fix mode
Options:
☐ Auto-fix segments[Proofread]vs[Proofread & Fix][Apply All Fixes]that processes all issues with aCorrectedTextSafety considerations
CorrectedTextis non-empty and different from the current targetPriority
Labels
Enhancement