-
Notifications
You must be signed in to change notification settings - Fork 8
feat(website): use a custom displayName for segments and references and remove segmentName prefix for nucleotide mutation/insertion/deletion search #5953
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
Conversation
cf49f1e to
6978fda
Compare
ce58467 to
30e8351
Compare
website/src/utils/mutation.ts
Outdated
| suborganismSegmentAndGeneInfo: SegmentAndGeneInfo, | ||
| ): MutationSearchParams => { | ||
| const mutationFilter = parseMutationsString(mutation ?? '', suborganismSegmentAndGeneInfo); | ||
| const mutationParamName = getReferenceIdentifier( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is kinda ugly and caused a bug... probably would be good to revisit if there is a tidier way to do this
7679605 to
30fb152
Compare
6c74720 to
1df1e1c
Compare
|
Claude finished @anna-parker's task in 2m 49s —— View job Code Review CompleteI've performed a comprehensive review of PR #5953. This PR successfully introduces custom display names for segments and references while removing segment name prefixes from nucleotide mutation/insertion/deletion searches. SummaryStrengths:
Detailed Findings1. Error Handling in Mutation ParsingLocation: Issue: Multiple empty Current code: try {
// parsing logic
} catch (_) {
return INVALID;
}Recommendation: Log errors in development mode: } catch (error) {
if (process.env.NODE_ENV === 'development') {
console.warn('Failed to parse mutation query:', text, error);
}
return INVALID;
}Relates to: The author's comment "this is kinda ugly and caused a bug..." - error logging would help catch similar issues in the future. 2. Empty String Edge CaseLocation: Issue: The Recommendation: {segment && <h2 className='py-1 my-1 font-semibold border-b'>{segment}</h2>}3. Technical Debt - Type SafetyLocation: Issue: ESLint disable comments for Recommendation: Prioritize issue #3451 to add proper typing to this file. 4. Missing Documentation for Display Name ConventionLocation: Issue: The Recommendation: Add JSDoc: /**
* @param referenceGenomesInfo - The reference genome lightweight schema
* @returns Map from LAPIS names to display names (segment or gene names).
* For single-segmented genomes, the segment displayName is `undefined` since
* there's no ambiguity. Genes always have their name as the displayName.
*/5. Documentation Checklist IncompleteThe PR checklist shows:
Recommendation: Update user-facing documentation for the mutation search feature, particularly since this PR removes segment name prefixes from the search syntax. Testing Assessment✅ Excellent test coverage:
Security & Performance✅ No security vulnerabilities identified Author's Concerns Addressed1. "not sure I can actually use this..." (config.ts)
2. "this is kinda ugly and caused a bug..." (mutation.ts)
Overall AssessmentThis is a well-executed PR that achieves its goals with:
Main recommendations:
|
resolves #5944, #5943
Screenshot
PR Checklist
🚀 Preview: https://displayname.loculus.org