Repository navigation
Feat/issue 78 contributor selection #82
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
Open
beanbean9339
wants to merge
15
commits into
main
Choose a base branch
from
feat/issue-78-contributor-selection
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
efee66e
fix: count eligible human fallback authors and bound requests (#56)
beanbean9339 5e734cf
docs: align contributor fallback example with issue 56 limits
beanbean9339 f331a95
feat: discover human authors from bounded commit history (#68)
beanbean9339 600fd64
feat: implement contributor selection options and author candidate re…
beanbean9339 c5ae5e1
feat: enhance author matching logic with fuzzy index search
beanbean9339 bf78b57
feat: refine contributor selection logic and enhance author matching …
beanbean9339 6489c40
feat: enhance contributor selection and fallback logic with improved …
beanbean9339 a4010a4
feat: enhance author matching logic in findMatchingAuthorIndex to han…
beanbean9339 2a9a172
feat: update findMatchingAuthorIndex to support candidate normalizati…
beanbean9339 57a2200
Build(deps): bump source-map-js from 1.2.1 to 1.2.2 (#79)
dependabot[bot] 106c00c
Build(deps-dev): bump vite from 8.2.2 to 8.3.5 (#81)
dependabot[bot] 9528188
Build(deps-dev): bump fast-uri from 3.1.7 to 3.1.9 (#84)
dependabot[bot] 3d1b1c3
rebasing
beanbean9339 aede74e
feat: enhance findMatchingAuthorIndex to handle ambiguous initials an…
beanbean9339 a2f6109
feat: enhance findMatchingAuthorIndex and add tests for ambiguous ini…
beanbean9339 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
Large diffs are not rendered by default.
Oops, something went wrong.
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,82 @@ | ||
| import { findMatchingAuthorIndex, formatWindow } from '../services/githubImporterAuthorCandidates.js'; | ||
|
|
||
| const SOURCE_LABELS = { | ||
| 'github-contributor': 'GitHub contributor', | ||
| 'commit-history': 'Commit history', | ||
| 'co-author': 'Co-author trailer', | ||
| }; | ||
|
|
||
| export function ContributorImportOptions({ limit, since, until, onLimitChange, onSinceChange, onUntilChange }) { | ||
| return ( | ||
| <fieldset className="contributor-options"> | ||
| <legend>GitHub contributor options</legend> | ||
| <label> | ||
| <span>Authors to credit automatically</span> | ||
| <input | ||
| type="number" | ||
| min="0" | ||
| max="50" | ||
| value={limit} | ||
| onChange={(event) => onLimitChange(event.target.value)} | ||
| placeholder="5" | ||
| /> | ||
| </label> | ||
| <label> | ||
| <span>Ignore contributions before (optional)</span> | ||
| <input type="date" value={since} max={until || undefined} onChange={(event) => onSinceChange(event.target.value)} /> | ||
| </label> | ||
| <label> | ||
| <span>Ignore contributions after (optional)</span> | ||
| <input type="date" value={until} min={since || undefined} onChange={(event) => onUntilChange(event.target.value)} /> | ||
| </label> | ||
| <p className="import-note"> | ||
| Everyone found is listed as a candidate you can add or remove. Set a date when a repository inherited | ||
| history from another project, or to stop at a release date; contributors with no commits in that range are not credited automatically. | ||
| </p> | ||
| </fieldset> | ||
| ); | ||
| } | ||
|
|
||
| export function AuthorCandidates({ candidates, authors, since, until, onToggle }) { | ||
| if (!Array.isArray(candidates) || candidates.length === 0) { | ||
| return null; | ||
| } | ||
|
|
||
| const isSelected = (candidate) => findMatchingAuthorIndex(authors, candidate, candidates) !== -1; | ||
| const selectedCount = candidates.filter(isSelected).length; | ||
|
|
||
| return ( | ||
| <section className="full-width form-section author-candidates" aria-labelledby="author-candidates-title"> | ||
| <header className="section-header"> | ||
| <h3 id="author-candidates-title">GitHub author candidates</h3> | ||
| <p className="section-lede"> | ||
| {selectedCount} of {candidates.length} selected. Commit counts show activity, not authorship; check | ||
| only the people who should be credited. | ||
| {since || until ? ` Contributors with no commits ${formatWindow(since, until)} are flagged.` : ''} | ||
| </p> | ||
| </header> | ||
| <ul className="candidate-list"> | ||
| {candidates.map((candidate) => { | ||
| const checked = isSelected(candidate); | ||
| const name = [candidate.givenNames, candidate.familyNames].filter(Boolean).join(' '); | ||
| return ( | ||
| <li key={candidate.id}> | ||
| <label className="candidate-row"> | ||
| <input | ||
| type="checkbox" | ||
| checked={checked} | ||
| onChange={(event) => onToggle(candidate, event.target.checked)} | ||
| /> | ||
| <span> | ||
| <strong>{name}</strong> | ||
| <small>{candidate.sources.map((source) => SOURCE_LABELS[source] ?? source).join(' + ')}</small> | ||
| <small>{candidate.reason}</small> | ||
| </span> | ||
| </label> | ||
| </li> | ||
| ); | ||
| })} | ||
| </ul> | ||
| </section> | ||
| ); | ||
| } |
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
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
Oops, something went wrong.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.