Skip to content

Commit 5dab7e3

Browse files
committed
proto: redesign experiment, score set, and publication pages with typed API modules and reusable components
- Refactor ExperimentView, ExperimentSetView, ScoreSetView, and PublicationIdentifierView to use MvPageHeader, MvRowActionMenu, MvMetadataLine, and other shared Mv* components - Replace inline axios calls with typed API functions; replace manual permission checks with useDatasetPermissions composable - Delete old component copies from components/ root and common/ that were already moved to score-set/, calibration/, collection/, and Mv*-prefixed names in prior commits - Add alerts and metadata slots to MvPageHeader - Update copilot instructions to reflect new directory structure, Mv* prefix convention, and new composables - Removes prototype dir as the site is now migrated
1 parent a4a4ae3 commit 5dab7e3

106 files changed

Lines changed: 3567 additions & 36561 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/instructions/copilot-instructions.md

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,15 @@ MaveDB UI is the frontend for [MaveDB](https://mavedb.org), a database for Multi
2828
src/
2929
├── assets/ # Global CSS and static images
3030
├── components/
31-
│ ├── common/ # Reusable, generic UI components
31+
│ ├── calibration/ # Calibration display and editing components
32+
│ ├── collection/ # Collection management components
33+
│ ├── common/ # Reusable UI components (all prefixed Mv*)
34+
│ ├── dashboard/ # Dashboard tab components
35+
│ ├── forms/ # Form section components for creator/editor pages
3236
│ ├── layout/ # App shell: MvLayout, MvNavBar, MvFooter
33-
│ └── screens/ # Top-level route/page components (*View, *Screen, *Creator, *Editor)
37+
│ ├── score-set/ # Score set visualization and display components
38+
│ ├── screens/ # Top-level route/page components (*View, *Screen, *Creator, *Editor)
39+
│ └── variant/ # Variant display components
3440
├── composables/ # Vue 3 composables (newer pattern)
3541
├── composition/ # Composition functions (older pattern, similar purpose)
3642
├── lib/ # Business logic, utilities, API helpers
@@ -43,7 +49,7 @@ src/
4349
## Key Conventions
4450

4551
- **Path alias**: Always use `@/` (maps to `src/`) instead of relative imports.
46-
- **Component naming**: PascalCase `.vue` files. Screens suffixed with `View`, `Screen`, `Creator`, or `Editor`.
52+
- **Component naming**: PascalCase `.vue` files. Components in `common/` are prefixed `Mv*`. Screens are suffixed with `View`, `Screen`, `Creator`, or `Editor`.
4753
- **TypeScript**: Prefer `.ts` for new files. Strict mode is enabled (`noUnusedLocals`, `noUnusedParameters`, `noFallthroughCasesInSwitch`).
4854
- **No test framework**: There is currently no automated test suite in this project.
4955
- **Node version**: 20.x is required.

.github/instructions/state-management.instructions.md

Lines changed: 30 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ The root store holds `routeProps` (Galaxy integration parameters) and registers
2929
The `item.ts` and `items.js` modules are **not** statically registered. Instead, the `useItem()` and `useItems()` composables in `src/composition/` dynamically register Vuex modules with UUID-based namespaces at the component level:
3030

3131
```ts
32-
// src/composition/item.ts.ts (simplified)
32+
// src/composition/item.ts (simplified)
3333
export default function useItem({itemTypeName}) {
3434
const store = useStore()
3535
const namespace = uuid()
@@ -63,6 +63,35 @@ pubSearch.items // reactive suggestions list
6363

6464
Used across all form pages (ExperimentCreator, ExperimentEditor, ScoreSetCreator, ScoreSetEditor, CalibrationEditor) for: publication search, taxonomy search, target gene search, gene name/assembly lookups, license lists, keyword options, and score set search.
6565

66+
## Dataset Permissions (`src/composables/use-dataset-permissions.ts`)
67+
68+
Wraps the `checkPermissions` API call with reactive state. Auto-fetches when the URN changes. Used by ExperimentSetView, ExperimentView, ScoreSetView, CollectionView, and ScoreSetCalibrationsView.
69+
70+
```ts
71+
const {permissions} = useDatasetPermissions('score-set', urnRef, ['update', 'delete', 'publish'])
72+
// permissions.value.update, permissions.value.delete, etc.
73+
```
74+
75+
## Score Set Downloads (`src/composables/use-score-set-downloads.ts`)
76+
77+
Shared download logic for score set data files. Provides reactive state for the custom data dialog and methods for downloading scores, counts, mapped variants, metadata, custom data, and streaming annotated variants. Used by ScoreSetDownloads and MvVariantPreview.
78+
79+
```ts
80+
const {downloadFile, downloadMultipleData, customDialogVisible, dataTypeOptions} = useScoreSetDownloads({
81+
scoreSet: scoreSetRef
82+
})
83+
```
84+
85+
## Variant Coordinates (`src/composables/use-variant-coordinates.ts`)
86+
87+
Stateless utilities for resolving variant HGVS coordinates based on display mode (raw vs mapped). Shared between ScoreSetView (variant search, labels, sequence type detection) and ScoreSetHeatmap.
88+
89+
```ts
90+
const {getHgvsNt, getHgvsPro, labelForVariant, sequenceTypeOptions} = useVariantCoordinates()
91+
const nt = getHgvsNt(variant, useMapped) // resolved NT coordinate
92+
const options = sequenceTypeOptions(variants, useMapped) // [{title: 'DNA', value: 'dna'}, ...]
93+
```
94+
6695
## Entity Cache (`src/composables/entity-cache.ts`)
6796

6897
A shared reactive cache for entity lookups (score sets, experiments, experiment sets) with a 5-minute TTL. Deduplicates concurrent requests for the same URN — if a fetch is already in-flight, subsequent callers wait for it rather than starting a duplicate request.

.github/instructions/vue-components.instructions.md

Lines changed: 22 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -63,11 +63,11 @@ Top-level route components. Named with suffixes: `*View`, `*Screen`, `*Creator`,
6363

6464
### Common Components (`src/components/common/`)
6565

66-
Reusable UI primitives: `EntityLink`, `FlexDataTable`, `PageLoading`, `MvSelectList`, `MvCollapsible`, `MvLoader`, `MvScoreSetRow`, `MvSearchFilters`, etc.
66+
Reusable UI components, all prefixed `Mv*`: `MvEntityLink`, `MvPageLoading`, `MvItemNotFound`, `MvEmailPrompt`, `MvSelectList`, `MvCollapsible`, `MvLoader`, `MvScoreSetRow`, `MvSearchFilters`, `MvTimeSeriesLineChart`, etc.
6767

6868
### Layout Components (`src/components/layout/`)
6969

70-
App shell components: `MvLayout`, `MvNavBar`, `MvFooter`.
70+
App shell components: `MvLayout`, `MvNavBar`, `MvFooter`, `MvPageHeader`.
7171

7272
### Form Section Components (`src/components/forms/`)
7373

@@ -91,10 +91,27 @@ Low-level field components:
9191
- `MvMarkdownField` — Edit/Preview tabs for markdown textarea
9292
- `MvTagField` — Multi-value chip AutoComplete
9393
- `MvUploadField` — File upload drop zone
94+
- `MvFileStatus` — File upload status indicator
9495

95-
### Feature Components (`src/components/`)
96+
### Score Set Components (`src/components/score-set/`)
9697

97-
Larger feature-specific components in the root components directory: `CalibrationEditor`, `ScoreSetHeatmap`, `ScoreSetHistogram`, `AssayFactSheet`, etc.
98+
Score set visualization and display components: `ScoreSetHeatmap`, `ScoreSetHistogram`, `ScoreSetVisualizer`, `ScoreSetProcessingStatus`, `ScoreSetDownloads`, `ScoreSetMetadataCard`, `ProteinStructureView`.
99+
100+
### Calibration Components (`src/components/calibration/`)
101+
102+
Calibration display and editing: `CalibrationTable`, `CalibrationEditor`, `CalibrationFields`, `CalibrationClassificationRow`.
103+
104+
### Collection Components (`src/components/collection/`)
105+
106+
Collection management: `CollectionAdder`, `CollectionCreator`, `CollectionDataSetEditor`, `CollectionItemsTable`, `CollectionPermissionsEditor`.
107+
108+
### Dashboard Components (`src/components/dashboard/`)
109+
110+
Dashboard tab panels: `MvDashboardScoreSets`, `MvDashboardExperiments`, `MvDashboardCollections`, `MvDashboardCalibrations`.
111+
112+
### Variant Components (`src/components/variant/`)
113+
114+
Variant display: `MvMeasurementCard`, `VariantInfoSection`.
98115

99116
## Composables and Composition Functions
100117

@@ -150,6 +167,6 @@ Always use the `@/` path alias and always include the file extension (`.vue` for
150167

151168
```ts
152169
import MvLayout from '@/components/layout/MvLayout.vue'
153-
import EntityLink from '@/components/common/EntityLink.vue'
170+
import MvEntityLink from '@/components/common/MvEntityLink.vue'
154171
import useItem from '@/composition/item.ts'
155172
```

0 commit comments

Comments
 (0)