Development: Add compliance text highlighting client side#2306
Merged
Conversation
added endpoint for compliance added ComplianceIssueDTO for later on highlighting added ComplianceIssueDTO[]
…side' into feat/2063-add-compliance-server-side
- refactored prompt - moved enum to constants - changed endpoint to POST temporary - removed unused imports
…nce-server-side # Conflicts: # openapi/openapi.yaml # src/main/java/de/tum/cit/aet/ai/service/AiService.java # src/main/java/de/tum/cit/aet/ai/web/AiResource.java # src/main/webapp/app/generated/.openapi-generator/FILES # src/main/webapp/app/generated/api/aiResourceApi.service.ts # src/main/webapp/app/generated/model/models.ts
…ith dual-language support - Move score calculation from frontend to backend (AiService) to persist across navigation - Add genderBiasScore and complianceAnalysis fields to Job entity with Liquibase migration - Calculate combined inclusivity score as average of DE and EN gender bias analyses - Strip HTML tags via Jsoup before analysis to fix zero-score bug - Adjust autosave timer to prevent premature translation triggering to 5s debounce - Read persisted score from JobDTO/JobFormDTO instead of recomputing on frontend - Fix AiScoreRingComponent animation to only animate on first render or actual score change - Add TranslateComplianceDTO wrapper to avoid multiple @RequestBody parameters - Update analyzeCurrentJobDescription and translateAndPersistJobDescription to use plain text - added sanitization -> write + read in Job-Description - adjusted tests
…side' into feat/2063-add-compliance-server-side # Conflicts: # openapi/openapi.yaml # src/main/webapp/app/generated/api/ai-resource-api.ts
# Conflicts: # openapi/openapi.yaml # src/main/java/de/tum/cit/aet/ai/service/AiService.java # src/main/java/de/tum/cit/aet/job/dto/JobFormDTO.java # src/main/java/de/tum/cit/aet/job/service/JobService.java # src/main/resources/config/liquibase/master.xml # src/main/webapp/app/generated/model/job.ts
…side' into feat/2063-add-compliance-server-side
changed Json compliance field to @ElementCollection
…side' into feat/2063-add-compliance-server-side
…side' into feat/2063-add-compliance-server-side
-added server tests -prettier
Cathy0123456789
requested changes
Apr 18, 2026
Contributor
Cathy0123456789
left a comment
There was a problem hiding this comment.
Thank you, small comments
Contributor
|
🤖 No OpenAPI or client changes needed. |
CelineLahnor
requested changes
Apr 18, 2026
Contributor
CelineLahnor
left a comment
There was a problem hiding this comment.
Thank you code looks already good to me I just left some small questions in the code :)
Contributor
|
Can you please create a follow-up issue to add the missing test coverage introduced by this PR, so it does not get forgotten? |
11 tasks
Cathy0123456789
requested changes
Apr 19, 2026
Contributor
Cathy0123456789
left a comment
There was a problem hiding this comment.
Thank you, small questions
az108
requested changes
Apr 19, 2026
- split HighlightBlot into criticalClasses and warningClasses - moved color-mix into _tokens.scss - updated highlightTexts() - updated applyHighlights() - added Promise.all for analyzeAndUpdateScore() - added onComplete callback to forceUpdate()
Contributor
|
🤖 No OpenAPI or client changes needed. |
Contributor
|
🤖 No OpenAPI or client changes needed. |
Contributor
|
🤖 No OpenAPI or client changes needed. |
Contributor
|
🤖 No OpenAPI or client changes needed. |
Cathy0123456789
approved these changes
Apr 19, 2026
Contributor
Cathy0123456789
left a comment
There was a problem hiding this comment.
Code LGTM, not tested though
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Checklist
General
Client
Motivation and Context
This PR introduces client-side compliance text highlighting for job descriptions. The goal is to make detected compliance issues immediately visible and understandable to users while editing job postings.
Closes: #2064
Description
Server-side: Compliance issues are extended with a language attribute to correctly associate issues with job descriptions across language switches. The database schema (Liquibase), ComplianceIssue DTO, and AiService were updated accordingly. The AI service now explicitly assigns the detected language to each compliance issue after analysis.
Client-side: The job creation form introduces a complianceIssues signal to manage compliance issues for both languages independently. Issues are filtered by the active editor language and dynamically applied as highlights. A highlightEffect ensures highlights are applied whenever the language switches or new issues arrive.
A custom Quill blot (HighlightBlot) renders highlighted text spans using Tailwind utility classes, visually distinguishing critical AGG violations and transparency issues via different colors.
TranslateText.st was updated to return only the translated text, ensuring compliance and gender bias issues introduced during manual editing are preserved and not silently corrected by the translation.
Fixed a bug where a score of 0 was not displayed due to an early return in the animation effect when animatedScore was undefined but targetScore was 0.
Steps for Testing
Prerequisites:
Review Progress
Code Review
Manual Tests
Screenshots
Test Coverage
Client
Server
Last updated: 2026-04-19 14:53:25 UTC