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
21 changes: 21 additions & 0 deletions lefthook.yml
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I ran a bunch of experiments (switching commands with npx, adding fail_text as a job field, tweaking parameters etc. Here's update:

  • for today's work, I wasn't able to fully fix vscode GUI popup readability issue. I did get the popup to show real text instead of empty lines, but it still feels a bit misleading.
  • good news: the vscode Show Command Output view can be cleaned up using execution_info, this removes the extra blocks and special characters. Now the outputs looks much better.

these are the changes in this file that seemed useful during testing (I didn't submit a sub-pr since the changes are small and not yet optimal):

output:
    - summary
    - failure
    - execution_info
pre-commit:
    ...keep unchanged...

let me know what you think. I can work on this more and open a sub-pr if I find a better fix!

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for working on this! I don't feel precious about this branch and I'm also fine to walk away from this feature if it's taking a lot of time or energy, I don' think it's high priority.

Feel free to commit to this branch or open new branches.

Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
output:
- summary
- failure
pre-commit:
parallel: true
jobs:
- name: format
glob: "**/*.{ts,tsx,json}"
run: yarn --silent format:files {staged_files}
stage_fixed: true

- name: lint
glob: "**/*.{ts,tsx}"
run: yarn --silent lint:files {staged_files}
stage_fixed: true
Comment on lines +5 to +15
Copy link

Copilot AI Feb 17, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

parallel: true allows format (prettier --write) and lint (eslint --fix) to run concurrently against the same files. Since both jobs can rewrite the same staged files and both use stage_fixed: true, this can lead to nondeterministic results or file write races. Consider running these jobs sequentially (set parallel: false) or avoid having two concurrent fixers touching the same files.

Copilot uses AI. Check for mistakes.
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Without having looked into it this seems like a good thing to implement. I noticed some duplicate warnings and wonder if the parallel execution was leading to that.


- name: typecheck
run: yarn --silent typeCheck --pretty false

- name: test
run: yarn --silent test
174 changes: 89 additions & 85 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,87 +1,91 @@
{
"name": "cell-catalog",
"description": "Cell catalog for Allen Institute for Cell Science",
"version": "1.3.2",
"author": "Megan Riel-Mehan",
"dependencies": {
"@ant-design/icons": "^5.5.1",
"@reach/router": "^1.3.4",
"@svgr/webpack": "^8.1.0",
"antd": "^5.21.2",
"decap-cms-app": "^3.6.3",
"decap-cms-media-library-cloudinary": "^3.0.1",
"decap-cms-media-library-uploadcare": "^3.0.0",
"gatsby": "^5.14.0-next.3",
"gatsby-plugin-decap-cms": "^4.0.3",
"gatsby-plugin-fix-fouc": "^1.0.5",
"gatsby-plugin-image": "^3.14.0",
"gatsby-plugin-netlify": "^5.1.1",
"gatsby-plugin-nprogress": "^5.15.0",
"gatsby-plugin-purgecss": "^6.0.0",
"gatsby-plugin-react-helmet": "^6.13.1",
"gatsby-plugin-react-svg": "^3.3.0",
"gatsby-plugin-sass": "^6.13.1",
"gatsby-plugin-sharp": "^5.13.1",
"gatsby-plugin-svgr-svgo": "^2.0.0",
"gatsby-remark-copy-linked-files": "^6.13.1",
"gatsby-remark-external-links": "^0.0.4",
"gatsby-remark-images": "^7.14.0",
"gatsby-remark-line-breaks": "^1.0.0",
"gatsby-remark-relative-images": "^2.0.5",
"gatsby-source-filesystem": "^5.13.1",
"gatsby-transformer-remark": "^6.13.1",
"gatsby-transformer-remark-frontmatter": "^1.1.0",
"gatsby-transformer-sharp": "^5.13.1",
"lodash": "^4.17.15",
"lodash-webpack-plugin": "^0.11.4",
"react": "^18.3.1",
"react-dom": "^18.3.1",
"react-helmet": "^6.0.0",
"sass": "^1.43.2",
"uuid": "^8.0.0",
"vitest": "^4.0.17"
},
"keywords": [
"gatsby"
],
"license": "MIT",
"main": "n/a",
"scripts": {
"clean": "gatsby clean",
"start": "npm run develop",
"build": "npm run clean && gatsby build",
"develop": "npm run clean && gatsby develop",
"serve": "gatsby serve",
"format": "prettier \"src/**/*{.tsx, .ts}\" --write",
"formatCheck": "prettier \"src/**/*{.tsx, .ts}\" --check",
"lint": "eslint \"src/**/*{.tsx, .ts}\" --quiet --fix",
"test": "vitest run",
"dev": "npx concurrently \"npx netlify-cms-proxy-server\" \"npm start -- --progress\"",
"typeCheck": "npx tsc -noEmit"
},
"devDependencies": {
"@eslint/js": "^9.38.0",
"@trivago/prettier-plugin-sort-imports": "^5.2.2",
"@types/antd": "^1.0.0",
"@types/node": "^20.11.20",
"@types/react": "^18.2.59",
"@types/react-dom": "^18.2.19",
"@types/react-helmet": "^6.1.11",
"concurrently": "^9.1.2",
"eslint": "^9.38.0",
"eslint-plugin-react": "^7.37.5",
"eslint-plugin-sort-destructure-keys": "^2.0.0",
"gatsby-plugin-postcss": "^6.13.1",
"globals": "^16.4.0",
"jiti": "^2.6.1",
"netlify-cli": "^17.15.7",
"postcss": "^8.4.35",
"prettier": "^3.6.2",
"typescript": "^5.9.3",
"typescript-eslint": "^8.46.2",
"typescript-plugin-css-modules": "^5.1.0"
},
"engines": {
"node": ">= 22.16.0"
}
"name": "cell-catalog",
"description": "Cell catalog for Allen Institute for Cell Science",
"version": "1.3.1",
"author": "Megan Riel-Mehan",
"license": "MIT",
"main": "n/a",
"dependencies": {
"@ant-design/icons": "^5.5.1",
"@reach/router": "^1.3.4",
"@svgr/webpack": "^8.1.0",
"antd": "^5.21.2",
"decap-cms-app": "^3.6.3",
"decap-cms-media-library-cloudinary": "^3.0.1",
"decap-cms-media-library-uploadcare": "^3.0.0",
"gatsby": "^5.14.0-next.3",
"gatsby-plugin-decap-cms": "^4.0.3",
"gatsby-plugin-fix-fouc": "^1.0.5",
"gatsby-plugin-image": "^3.14.0",
"gatsby-plugin-netlify": "^5.1.1",
"gatsby-plugin-nprogress": "^5.15.0",
"gatsby-plugin-purgecss": "^6.0.0",
"gatsby-plugin-react-helmet": "^6.13.1",
"gatsby-plugin-react-svg": "^3.3.0",
"gatsby-plugin-sass": "^6.13.1",
"gatsby-plugin-sharp": "^5.13.1",
"gatsby-plugin-svgr-svgo": "^2.0.0",
"gatsby-remark-copy-linked-files": "^6.13.1",
"gatsby-remark-external-links": "^0.0.4",
"gatsby-remark-images": "^7.14.0",
"gatsby-remark-line-breaks": "^1.0.0",
"gatsby-remark-relative-images": "^2.0.5",
"gatsby-source-filesystem": "^5.13.1",
"gatsby-transformer-remark": "^6.13.1",
"gatsby-transformer-remark-frontmatter": "^1.1.0",
"gatsby-transformer-sharp": "^5.13.1",
"lodash": "^4.17.15",
"lodash-webpack-plugin": "^0.11.4",
"react": "^18.3.1",
"react-dom": "^18.3.1",
"react-helmet": "^6.0.0",
"sass": "^1.43.2",
"uuid": "^8.0.0",
"vitest": "^4.0.17"
},
"keywords": [
"gatsby"
],
"scripts": {
"clean": "gatsby clean",
"start": "npm run develop",
"build": "npm run clean && gatsby build",
"develop": "npm run clean && gatsby develop",
"serve": "gatsby serve",
"format": "prettier \"src/**/*{.tsx, .ts}\" package.json --write",
"format:files": "prettier --write",
"formatCheck": "prettier \"src/**/*{.tsx, .ts}\" package.json --check",
"lint": "eslint \"src/**/*{.tsx, .ts}\" --quiet --fix",
"lint:files": "eslint --quiet --fix",
"test": "vitest run",
"dev": "npx concurrently \"npx netlify-cms-proxy-server\" \"npm start -- --progress\"",
"typeCheck": "tsc --noEmit",
"prepare": "lefthook install"
},
"devDependencies": {
"@eslint/js": "^9.38.0",
"@trivago/prettier-plugin-sort-imports": "^5.2.2",
"@types/antd": "^1.0.0",
"@types/node": "^20.11.20",
"@types/react": "^18.2.59",
"@types/react-dom": "^18.2.19",
"@types/react-helmet": "^6.1.11",
"concurrently": "^9.1.2",
"eslint": "^9.38.0",
"eslint-plugin-react": "^7.37.5",
"eslint-plugin-sort-destructure-keys": "^2.0.0",
"gatsby-plugin-postcss": "^6.13.1",
"globals": "^16.4.0",
"jiti": "^2.6.1",
"lefthook": "^2.0.15",
"netlify-cli": "^17.15.7",
"postcss": "^8.4.35",
"prettier": "^3.6.2",
"typescript": "^5.9.3",
"typescript-eslint": "^8.46.2",
"typescript-plugin-css-modules": "^5.1.0"
},
"engines": {
"node": ">= 22.16.0"
}
}
38 changes: 19 additions & 19 deletions src/component-queries/convert-data.ts
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
import { formatCellLineId } from "../utils";
import { getThumbnail } from "../utils/mediaUtils";
import {
DiseaseCellLineNode,
GeneFrontmatter,
GeneticModification,
LookupGroup,
NormalCellLineNode,
SearchAndFilterGroup,
SearchLookup,
UnpackedDiseaseCellLine,
UnpackedGene,
UnpackedNormalCellLine,
GeneticModification,
SearchLookup,
SearchAndFilterGroup,
GeneFrontmatter,
LookupGroup,
} from "./types";
import { getThumbnail } from "../utils/mediaUtils";
import { formatCellLineId } from "../utils";

export const extractGeneticModifications = (
modifications?: GeneticModification[]
modifications?: GeneticModification[],
): {
taggedGenes: UnpackedGene[];
alleleCounts: string[];
Expand Down Expand Up @@ -45,7 +45,7 @@ export const extractGeneticModifications = (
};

export const convertFrontmatterToDiseaseCellLine = (
cellLineNode: DiseaseCellLineNode
cellLineNode: DiseaseCellLineNode,
): UnpackedDiseaseCellLine => {
const diseaseData = cellLineNode.frontmatter.disease.frontmatter;
const mutatedGenes = diseaseData.gene
Expand All @@ -59,7 +59,7 @@ export const convertFrontmatterToDiseaseCellLine = (
const { alleleCounts, fluorescentTags, taggedGenes, tagLocations } =
extractGeneticModifications(
cellLineNode.frontmatter.parental_line.frontmatter
.genetic_modifications
.genetic_modifications,
);

return {
Expand All @@ -75,7 +75,8 @@ export const convertFrontmatterToDiseaseCellLine = (
path: cellLineNode.fields.slug,
parentalLine: {
thumbnailImage: getThumbnail(
cellLineNode.frontmatter.parental_line.frontmatter.images_and_videos
cellLineNode.frontmatter.parental_line.frontmatter
.images_and_videos,
),
cellLineId:
cellLineNode.frontmatter.parental_line.frontmatter.cell_line_id,
Expand All @@ -97,7 +98,7 @@ export const convertFrontmatterToNormalCellLines = ({
}): UnpackedNormalCellLine => {
const { alleleCounts, fluorescentTags, taggedGenes, tagLocations } =
extractGeneticModifications(
cellLineNode.frontmatter.genetic_modifications
cellLineNode.frontmatter.genetic_modifications,
);
const proteins = taggedGenes
.map((gene) => gene.protein)
Expand Down Expand Up @@ -125,21 +126,21 @@ export const convertFrontmatterToNormalCellLines = ({
orderLink: cellLineNode.frontmatter.order_link,
orderPlasmid: cellLineNode.frontmatter.donor_plasmid,
thumbnailImage: getThumbnail(
cellLineNode.frontmatter.images_and_videos
cellLineNode.frontmatter.images_and_videos,
),
imagesAndVideos: cellLineNode.frontmatter.images_and_videos,
categoryLabels: cellLineNode.frontmatter.category_labels
categoryLabels: cellLineNode.frontmatter.category_labels,
};
};

export const createLookupMappings = (
data: SearchAndFilterGroup[]
data: SearchAndFilterGroup[],
): SearchLookup => {
const geneSymToCellIds = new Map();
const structureAndNameToGene = new Map();
const categoryToIds = new Map();
const allSearchableTerms: Set<string> = new Set();
data.forEach((group:SearchAndFilterGroup) => {
data.forEach((group: SearchAndFilterGroup) => {
const symbol = group.fieldValue;
allSearchableTerms.add(symbol);
const cellLines: number[] = [];
Expand All @@ -161,7 +162,7 @@ export const createLookupMappings = (
});
}
const genes = edge.node.frontmatter.genetic_modifications || [];
genes.forEach((obj: {gene: {frontmatter: GeneFrontmatter}}) => {
genes.forEach((obj: { gene: { frontmatter: GeneFrontmatter } }) => {
const gene = obj.gene;
const geneSymbol = gene.frontmatter.symbol;
const geneName = gene.frontmatter.name;
Expand All @@ -187,7 +188,6 @@ export const createLookupMappings = (
geneSymToCellIds,
structureAndNameToGene,
allSearchableTerms,
categoryToIds
categoryToIds,
};
};

33 changes: 17 additions & 16 deletions src/component-queries/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -109,14 +109,14 @@ export interface GenomicCharacterizationFrontmatter {
clone: number;
fp_ratio: number;
plasmid: number;
}[]
}[];
ddpcr_caption: string;
cr_rna_off_targets: {
clones_analyzed: number;
off_targets_sequenced_per_clone: number;
total_sites_sequenced: number;
mutations_identified: number;
}[]
}[];
off_targets_caption: string;
}

Expand Down Expand Up @@ -146,7 +146,7 @@ export interface NormalCellLineFrontmatter {
stem_cell_characteristics: StemCellCharacteristicsFrontmatter;
images_and_videos?: MediaFrontmatter;
category_labels: CategoryLabel[];
};
}

export interface NormalCellLineNode {
id: string;
Expand Down Expand Up @@ -290,16 +290,17 @@ export interface UnpackedNormalCellLine extends UnpackedCellLineMainInfo {
categoryLabels: CategoryLabel[];
}

export type ParentLine = Pick<UnpackedNormalCellLine,
"thumbnailImage" |
"cellLineId" |
"cloneNumber" |
"taggedGenes" |
"alleleCounts" |
"tagLocations" |
"fluorescentTags" |
"geneticModifications"
>
export type ParentLine = Pick<
UnpackedNormalCellLine,
| "thumbnailImage"
| "cellLineId"
| "cloneNumber"
| "taggedGenes"
| "alleleCounts"
| "tagLocations"
| "fluorescentTags"
| "geneticModifications"
>;

export interface UnpackedDiseaseCellLine extends UnpackedCellLineMainInfo {
diseaseStatus: string;
Expand Down Expand Up @@ -339,7 +340,7 @@ export interface SearchLookup {
// (so many words map to the same gene symbol)
// used for getting a unique identifier for the geneSymToCellIds map
structureAndNameToGene: Map<string, string>;
categoryToIds: Map<string, number[]>
categoryToIds: Map<string, number[]>;
allSearchableTerms: Set<string>;
}

Expand All @@ -355,7 +356,7 @@ export enum CategoryLabel {
export enum NavBarAnchorType {
Internal = "internal",
Download = "download",
External = "external"
External = "external",
}

export interface NavBarDropdownItem {
Expand All @@ -367,4 +368,4 @@ export interface NavBarDropdownItem {
export interface NavBarDropdownItemGroup {
label: string;
options: NavBarDropdownItem[];
}
}
Loading