-
Notifications
You must be signed in to change notification settings - Fork 4
Development: Show gender-inclusive wording feedback in the AI sidebar
#2630
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
506a38b
487bbcc
89f7d0e
46eb372
3e7d3a0
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -75,6 +75,59 @@ | |
|
|
||
| <hr class="m-0 w-full border-0 border-t border-border-default opacity-70" /> | ||
|
|
||
| <!-- Gender Decoder --> | ||
| <div class="flex items-center justify-center gap-2 lg:justify-start"> | ||
| <h3 | ||
| class="m-0 text-base font-semibold text-text-secondary text-center lg:text-left" | ||
| jhiTranslate="jobCreationForm.aiSidebar.genderDecoder.header" | ||
| ></h3> | ||
| <jhi-info-icon tooltip="jobCreationForm.aiSidebar.genderDecoder.tooltipText" tooltipPosition="top" [shouldTranslate]="true" /> | ||
| </div> | ||
|
|
||
| <div class="flex flex-col gap-3"> | ||
| <p | ||
| class="m-0 text-sm leading-6 text-text-tertiary text-center lg:text-left" | ||
| jhiTranslate="jobCreationForm.aiSidebar.genderDecoder.relevanceText" | ||
| ></p> | ||
|
|
||
| <jhi-status-pill | ||
| data-testid="gender-decoder-pill" | ||
| labelKey="jobCreationForm.aiSidebar.genderDecoder.pill.fix" | ||
| dotColor="bg-text-secondary" | ||
| [count]="genderDecoderReviewCount()" | ||
| [isActive]="activeFilter() === genderBiasFilter" | ||
| [loading]="isAnalyzing() && genderBiasAnalysis() === undefined" | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Two reproducible states:
Exposing a loading state from |
||
| (selected)="selectCategoryFilter(genderBiasFilter)" | ||
| /> | ||
|
|
||
| <div class="flex w-full flex-col gap-1"> | ||
| <p class="m-0 text-xs text-text-secondary" jhiTranslate="jobCreationForm.aiSidebar.genderDecoder.balanceLabel"></p> | ||
| <div> | ||
| <div class="relative h-7"> | ||
| <div class="absolute left-0 right-0 top-3 flex items-center gap-px"> | ||
| <span class="h-[2px] flex-1 rounded-full bg-border-default"></span> | ||
|
ge94zec marked this conversation as resolved.
|
||
| <span class="h-[2px] flex-1 rounded-full bg-text-tertiary"></span> | ||
| <span class="h-[2px] flex-1 rounded-full bg-text-disabled"></span> | ||
| </div> | ||
| <span | ||
| data-testid="gender-decoder-pointer" | ||
| class="absolute top-[0.45rem] h-3 w-3 -translate-x-1/2 rounded-full border-2 border-background-default bg-text-secondary ring-1 ring-border-default" | ||
| aria-hidden="true" | ||
| [class]="genderDecoderPointerClass()" | ||
| ></span> | ||
| </div> | ||
|
|
||
| <div class="-mt-1 flex items-center justify-between gap-2 text-xs leading-4 text-text-tertiary"> | ||
| <span jhiTranslate="jobCreationForm.aiSidebar.genderDecoder.scale.exclusive"></span> | ||
| <span jhiTranslate="jobCreationForm.aiSidebar.genderDecoder.scale.neutral"></span> | ||
| <span jhiTranslate="jobCreationForm.aiSidebar.genderDecoder.scale.inclusive"></span> | ||
| </div> | ||
| </div> | ||
| </div> | ||
| </div> | ||
|
|
||
| <hr class="m-0 w-full border-0 border-t border-border-default opacity-70" /> | ||
|
|
||
| <div class="flex items-start justify-center gap-2 lg:justify-start"> | ||
| <h3 | ||
| class="m-0 text-base font-semibold text-text-secondary text-center lg:text-left" | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,16 @@ | ||
| import { BiasedWordDTO } from 'app/generated/model/biased-word-dto'; | ||
| import { ComplianceIssueCategoryEnum } from 'app/generated/model/compliance-issue'; | ||
|
|
||
| export const GENDER_BIAS_FILTER_CATEGORY = 'GENDER_BIAS' as const; | ||
|
|
||
| export type FilterCategory = ComplianceIssueCategoryEnum | typeof GENDER_BIAS_FILTER_CATEGORY; | ||
|
|
||
| /** | ||
| * Extracts the unique, non-empty words marked as non-inclusive. | ||
| * @param biasedWords Gender-bias findings returned by the analysis. | ||
| * @returns The unique non-inclusive words in their original order. | ||
| */ | ||
| export function getUniqueNonInclusiveWords(biasedWords: BiasedWordDTO[] | undefined): string[] { | ||
| const words = biasedWords?.filter(word => word.type === 'non-inclusive').map(word => word.word?.trim()) ?? []; | ||
| return words.filter((word): word is string => Boolean(word)).filter((word, index, values) => values.indexOf(word) === index); | ||
| } |
Uh oh!
There was an error while loading. Please reload this page.