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
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
"@babel/runtime": "^7.8.4",
"@react-three/fiber": "^8.10.0",
"@reduxjs/toolkit": "^1.9.1",
"lodash": "^4.17.23",
"match-sorter": "^6.3.1",
"ol": "^9.0.0",
"react": "^18.2.0",
Expand All @@ -47,8 +48,8 @@
}
},
"resolutions": {
"@react-three/fiber/its-fine": "~1.1.4",
"diff": "^8.0.3"
"lodash": "4.17.23",
"@react-three/fiber/its-fine": "~1.1.4"
},
"packageManager": "yarn@1.22.22+sha512.a6b2f7906b721bba3d67d4aff083df04dad64c399707841b7acf00f6b133b7ac24255f2652fa22ae3534329dc6180534e98d17432037ff6fd140556e2bb3137e"
}
2 changes: 0 additions & 2 deletions src/containers/App/Prefetch.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,8 @@ const Prefetch = ({children}) => {
const prefetchSynonyms = usePrefetchSynonyms();

prefetchTaxa();
console.log('prefetching taxa');

prefetchSynonyms();
console.log('prefetching synonyms');

return children;
};
Expand Down
24 changes: 12 additions & 12 deletions src/containers/ImageLabeling/ImageLabelingPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ const ImageLabelingPage = ({ location, history }) => {
limit: 1000,
fields: ['slug', 'renditions', 'related_taxon', 'taxon', 'attributes', 'file', 'priority'],
};
if (selectedTaxon && selectedTaxon !== '__no_taxon__') {
if (selectedTaxon && selectedTaxon !== 'unknown') {
p.taxon = selectedTaxon;
}
return p;
Expand Down Expand Up @@ -208,7 +208,7 @@ const ImageLabelingPage = ({ location, history }) => {
name = taxonObj;
}
} else {
slug = '__no_taxon__';
slug = 'unknown';
name = 'Unknown taxon';
}

Expand All @@ -218,8 +218,8 @@ const ImageLabelingPage = ({ location, history }) => {
});

return Array.from(map.values()).sort((a, b) => {
if (a.slug === '__no_taxon__') return 1;
if (b.slug === '__no_taxon__') return -1;
if (a.slug === 'unknown') return 1;
if (b.slug === 'unknown') return -1;
return String(a.name).localeCompare(String(b.name));
});
}, [filteredAllImages, hasActiveFilters]);
Expand All @@ -231,8 +231,8 @@ const ImageLabelingPage = ({ location, history }) => {
}

return [...(summary?.taxa || [])].sort((a, b) => {
if (a.slug === '__no_taxon__') return 1;
if (b.slug === '__no_taxon__') return -1;
if (a.slug === 'unknown') return 1;
if (b.slug === 'unknown') return -1;
return String(a.name).localeCompare(String(b.name));
});
}, [hasActiveFilters, filteredTaxaMap, summary]);
Expand All @@ -245,7 +245,7 @@ const ImageLabelingPage = ({ location, history }) => {
const filteredImages = React.useMemo(() => {
let result = images;

if (selectedTaxon === '__no_taxon__') {
if (selectedTaxon === 'unknown') {
result = result.filter((img) => !img.relatedTaxon && !img.taxon);
}

Expand Down Expand Up @@ -316,7 +316,7 @@ const ImageLabelingPage = ({ location, history }) => {
name = taxonObj;
}
} else {
slug = '__no_taxon__';
slug = 'unknown';
name = 'Unknown taxon';
}
}
Expand Down Expand Up @@ -350,8 +350,8 @@ const ImageLabelingPage = ({ location, history }) => {
});

return Array.from(taxonImages.values()).sort((a, b) => {
if (a.taxonSlug === '__no_taxon__') return 1;
if (b.taxonSlug === '__no_taxon__') return -1;
if (a.taxonSlug === 'unknown') return 1;
if (b.taxonSlug === 'unknown') return -1;
return String(a.taxonName).localeCompare(String(b.taxonName));
});
}, [isLandingPage, hasActiveFilters, filteredAllImages, landingImages, taxaList]);
Expand Down Expand Up @@ -405,7 +405,7 @@ const ImageLabelingPage = ({ location, history }) => {

// Use image data if available, otherwise fall back to store data for taxa without images
const relatedTaxon = relatedTaxonFromImages || (
!isLandingPage && selectedTaxon && selectedTaxon !== '__no_taxon__'
!isLandingPage && selectedTaxon && selectedTaxon !== 'unknown'
? selectedTaxonFromStore
: null
);
Expand Down Expand Up @@ -455,7 +455,7 @@ const ImageLabelingPage = ({ location, history }) => {
.
</p>
</header>
) : selectedTaxon === '__no_taxon__' ? (
) : selectedTaxon === 'unknown' ? (
<header style={{ marginBottom: 24, paddingBottom: 16, borderBottom: '1px solid #e0e0e0' }}>
<h1 style={{ fontSize: '28px', marginBottom: 8 }}>
Unknown taxon
Expand Down
131 changes: 130 additions & 1 deletion src/containers/ImageLabeling/ImageLabelingPage.scss
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,34 @@
color: #666;
}

.taxonomy-all-taxa {
.taxonomy-expand-collapse {
display: flex;
gap: 0.5rem;
margin-bottom: 0.5rem;
}

.taxonomy-expand-collapse-button {
flex: 1;
padding: 0.25rem 0.5rem;
font-size: 0.75rem;
color: #666;
background: transparent;
border: 1px solid #ddd;
border-radius: 0.25rem;
cursor: pointer;

&:hover {
background: rgba(0, 0, 0, 0.05);
color: #333;
}
}

.taxonomy-all-taxa {
margin-bottom: 1rem;
padding-bottom: 1rem;
border-bottom: 1px solid #e0e0e0;
}

.taxonomy-all-taxa-button,
.taxonomy-unknown-button {
display: block;
Expand Down Expand Up @@ -78,6 +102,111 @@
margin-left: 0;
}
}

// Plankton groups tree styles
.plankton-groups-tree {
margin-top: 0.5rem;
}

.plankton-groups-list {
list-style: none;
padding: 0;
margin: 0;
}

.plankton-group-item {
margin-bottom: 0.25rem;
}

.plankton-group-header {
display: flex;
align-items: center;
justify-content: space-between;
padding: 0.5rem 0.75rem;
background: #f5f5f5;
border-radius: 0.25rem;
}

.plankton-group-name {
font-weight: 500;
font-size: 0.875rem;
color: #333;
}

.plankton-group-toggle,
.plankton-taxon-toggle {
display: flex;
align-items: center;
justify-content: center;
width: 1.5rem;
height: 1.5rem;
padding: 0;
background: transparent;
border: none;
cursor: pointer;
color: #666;

&:hover {
color: #000;
}

svg {
width: 0.75rem;
height: 0.75rem;
}
}

.plankton-taxa-list {
list-style: none;
padding: 0;
margin: 0.25rem 0 0.5rem 1rem;
}

.plankton-taxon-item {
margin-bottom: 0.125rem;
}

.plankton-taxon-header {
display: flex;
align-items: center;
justify-content: space-between;
padding: 0.375rem 0.5rem;
border-radius: 0.25rem;

&:hover {
background: rgba(0, 0, 0, 0.03);
}
}

.plankton-taxon-link {
flex: 1;
font-size: 0.8125rem;
color: #444;
text-decoration: none;

&:hover {
color: #0066cc;
}

&.is-selected {
font-weight: 500;
color: #000;
}
}

.plankton-titles-list {
list-style: none;
padding: 0;
margin: 0.125rem 0 0.375rem 1.5rem;
}

.plankton-title-item {
padding: 0.25rem 0.5rem;
font-size: 0.75rem;
color: #666;
border-left: 2px solid #e0e0e0;
margin-bottom: 0.125rem;
}
}

// Filters toggle button (for taxonomy sidebar on mobile)
Expand Down
Loading