Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ version tags such as `v0.3.0`.
## Unreleased

- Group Import Review candidates by normalized skill name, keep equivalent copies as locations of one Rust-qualified variant, require explicit selection when same-name variants differ, and submit at most one source per skill.
- Keep mixed User/Remote import suggestions inside one content-equivalent variant and require an explicit classification choice instead of manufacturing duplicate variants.
- Keep mixed User/Remote import suggestions inside one content-equivalent variant and present the explicit classification choice as a labeled required action instead of manufacturing duplicate variants.

- Add explicit inbound user-skills Git updates through Check remote, reviewed
repository-wide diffs, and preview-confirmed fast-forward apply.
Expand Down
19 changes: 18 additions & 1 deletion apps/desktop/src/cardLayout.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -437,6 +437,9 @@ test('import candidate groups disclose locations and use radio variant selection
)?.groups.body || '';
const disclosureRule = css.match(/\.candidateLocationsDisclosure\s*\{(?<body>[^}]*)\}/s)?.groups.body || '';
const locationRule = css.match(/\.candidateLocation\s*\{(?<body>[^}]*)\}/s)?.groups.body || '';
const typeActionRule = css.match(/\.candidateTypeAction\s*\{(?<body>[^}]*)\}/s)?.groups.body || '';
const requiredTypeActionRule = css.match(/\.candidateTypeAction\.required\s*\{(?<body>[^}]*)\}/s)
?.groups.body || '';

assert.match(groupSource, /aria-controls=\{disclosureId\}/);
assert.match(groupSource, /aria-expanded=\{expanded\}/);
Expand All @@ -447,12 +450,26 @@ test('import candidate groups disclose locations and use radio variant selection
assert.match(groupSource, /onSelectVariant\(group, variant\)/);
assert.match(groupSource, /Source: \{compactPath\(location\.symlinkTargetPath \|\| location\.realPath\)\}/);
assert.match(groupSource, /Mixed type suggestions/);
assert.match(groupSource, /Choose User or Remote before importing this skill/);
assert.match(groupSource, /id=\{typeLabelId\}>Skill type/);
assert.match(groupSource, /<strong>Required<\/strong>/);
assert.match(groupSource, /Choose where SkillBox should manage this skill/);
assert.match(groupSource, /aria-describedby=\{needsTypeChoice \? typeHelpId : undefined\}/);
assert.match(groupSource, /aria-labelledby=\{typeLabelId\}/);
assert.match(groupSource, /aria-required=\{needsTypeChoice\}/);
assert.match(groupSource, /role="radiogroup"/);
assert.match(groupSource, /role="radio"/);
assert.match(groupSource, /aria-checked=\{selectedVariant\?\.selectedType === 'user'\}/);
assert.match(groupSource, /aria-checked=\{selectedVariant\?\.selectedType === 'remote'\}/);
assert.doesNotMatch(groupSource, /Choose User or Remote before importing this skill/);
assert.match(groupSource, /selectedVariant\?\.selectedType === 'user'/);
assert.match(groupSource, /selectedVariant\?\.selectedType === 'remote'/);
assert.match(groupSource, /disabled=\{!canClassifyImportCandidateGroup\(group\)\}/);
assert.match(disclosureRule, /display:\s*inline-flex;/);
assert.match(locationRule, /grid-template-columns:\s*96px minmax\(0,\s*1fr\);/);
assert.match(typeActionRule, /display:\s*grid;/);
assert.match(typeActionRule, /min-width:\s*142px;/);
assert.match(requiredTypeActionRule, /border-color:\s*var\(--skillbox-amber-border\);/);
assert.match(requiredTypeActionRule, /background:\s*var\(--skillbox-surface-orange\);/);
});

test('import review uses the shared searchable candidate list template', () => {
Expand Down
56 changes: 37 additions & 19 deletions apps/desktop/src/components/importReview.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -361,6 +361,8 @@ function CandidateGroupCard({ group, onSelectVariant, onToggleSelected, onTypeCh
const status = importCandidateGroupStatus(group);
const locationCount = importCandidateGroupLocationCount(group);
const disclosureId = `${group.id}-locations`;
const typeLabelId = `${group.id}-type-label`;
const typeHelpId = `${group.id}-type-help`;

return (
<div className={candidateRowClass(candidate || {})}>
Expand All @@ -387,9 +389,6 @@ function CandidateGroupCard({ group, onSelectVariant, onToggleSelected, onTypeCh
{needsTypeChoice ? <Badge tone="amber">Mixed type suggestions</Badge> : null}
</div>
<small>{group.description || 'No description in SKILL.md'}</small>
{needsTypeChoice ? (
<p className="candidateTypeReviewNote">Choose User or Remote before importing this skill.</p>
) : null}
<button
aria-controls={disclosureId}
aria-expanded={expanded}
Expand Down Expand Up @@ -461,23 +460,42 @@ function CandidateGroupCard({ group, onSelectVariant, onToggleSelected, onTypeCh
{candidate && candidateStatusNote(candidate) ? <p>{candidateStatusNote(candidate)}</p> : null}
</div>

<div className="candidateTypeSwitch" role="group" aria-label={`${group.name} type`}>
<button
className={selectedVariant?.selectedType === 'user' ? 'active' : ''}
disabled={!canClassifyImportCandidateGroup(group)}
type="button"
onClick={() => onTypeChange(group, 'user')}
>
User
</button>
<button
className={selectedVariant?.selectedType === 'remote' ? 'active' : ''}
disabled={!canClassifyImportCandidateGroup(group)}
type="button"
onClick={() => onTypeChange(group, 'remote')}
<div className={`candidateTypeAction ${needsTypeChoice ? 'required' : ''}`}>
<div className="candidateTypeActionHeader">
<span id={typeLabelId}>Skill type</span>
{needsTypeChoice ? <strong>Required</strong> : null}
</div>
{needsTypeChoice ? (
<p id={typeHelpId}>Choose where SkillBox should manage this skill.</p>
) : null}
<div
aria-describedby={needsTypeChoice ? typeHelpId : undefined}
aria-labelledby={typeLabelId}
aria-required={needsTypeChoice}
className="candidateTypeSwitch"
role="radiogroup"
>
Remote
</button>
<button
aria-checked={selectedVariant?.selectedType === 'user'}
className={selectedVariant?.selectedType === 'user' ? 'active' : ''}
disabled={!canClassifyImportCandidateGroup(group)}
role="radio"
type="button"
onClick={() => onTypeChange(group, 'user')}
>
User
</button>
<button
aria-checked={selectedVariant?.selectedType === 'remote'}
className={selectedVariant?.selectedType === 'remote' ? 'active' : ''}
disabled={!canClassifyImportCandidateGroup(group)}
role="radio"
type="button"
onClick={() => onTypeChange(group, 'remote')}
>
Remote
</button>
</div>
</div>
</div>
);
Expand Down
50 changes: 42 additions & 8 deletions apps/desktop/src/styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -6501,12 +6501,6 @@ dd {
margin: 7px 0;
}

.candidateTypeReviewNote {
margin: 2px 0 0;
color: var(--skillbox-amber-text);
font-size: 12px;
}

.candidateLocation {
display: grid;
min-width: 0;
Expand Down Expand Up @@ -6601,6 +6595,46 @@ dd {
opacity: 0.55;
}

.candidateTypeAction {
display: grid;
min-width: 142px;
justify-items: start;
gap: 5px;
border: 1px solid transparent;
border-radius: 8px;
padding: 8px;
}

.candidateTypeAction.required {
border-color: var(--skillbox-amber-border);
background: var(--skillbox-surface-orange);
}

.candidateTypeActionHeader {
display: flex;
width: 100%;
align-items: center;
justify-content: space-between;
gap: 8px;
color: var(--skillbox-text-secondary);
font-size: 11px;
font-weight: 720;
}

.candidateTypeActionHeader strong {
color: var(--skillbox-amber-text);
font-size: 10px;
text-transform: uppercase;
}

.candidateTypeAction p {
max-width: 190px;
margin: 0;
color: var(--skillbox-amber-text);
font-size: 11px;
line-height: 1.35;
}

.importSheetFooter {
align-items: center;
border-top: 1px solid var(--skillbox-slate-bg);
Expand Down Expand Up @@ -6942,9 +6976,9 @@ dd {
grid-template-columns: 28px minmax(0, 1fr);
}

.candidateTypeSwitch {
.candidateTypeAction {
grid-column: 2;
width: max-content;
width: min(100%, 320px);
}

.candidateLocation {
Expand Down