mirror of
https://github.com/hanzoai/insights.git
synced 2026-11-03 00:52:32 +00:00
drop_closure exists to refuse a drop that is really a refactor: if code we keep still imports a product, deleting it is a ModuleNotFoundError waiting for the next boot. It only ever read Python, so half the dependency graph was invisible to it and five products whose TypeScript the core still imports were dropped anyway — 21 files left importing 25 specifiers that resolve to nothing, including lib/api.ts, which 760 files import, and seven lazy scene imports in productScenes.tsx. Django booted past it and the bundle did not, which is why the Python-only rule looked like it was working. The closure now reads both module systems through one table of (extensions, pattern) pairs, so a third one is a row rather than a branch. The TypeScript pattern is anchored on the import keyword rather than on the path, because jest's testPathIgnorePatterns and oxlint's ignore list quote a product path precisely because it is NOT built; matching those would hold desktop, the 4,797-file product the drop is mostly for. integrations, wizard, platform_features, visual_review and ai_gateway come back with their Django apps and workspace entries, since the closure now spares them. desktop, field_notes, ingestion and support stay dropped.
94 lines
3.9 KiB
TypeScript
94 lines
3.9 KiB
TypeScript
/**
|
|
* Product manifest for visual_review.
|
|
*
|
|
* Defines scenes, routes, URLs, and navigation for this product.
|
|
*/
|
|
import { FEATURE_FLAGS } from 'lib/constants'
|
|
import { urls } from 'scenes/urls'
|
|
|
|
import { FileSystemIconType, ProductKey } from '~/queries/schema/schema-general'
|
|
|
|
import { ProductItemCategory } from '../../frontend/src/queries/schema/schema-general'
|
|
import { ProductManifest } from '../../frontend/src/types'
|
|
|
|
export const manifest: ProductManifest = {
|
|
name: 'VisualReview',
|
|
scenes: {
|
|
VisualReviewIndex: {
|
|
// /visual_review entry point — picks a repo and forwards into its
|
|
// workspace. Empty / multi-repo cases handled inside the scene.
|
|
name: 'Visual review',
|
|
projectBased: true,
|
|
import: () => import('./frontend/scenes/VisualReviewIndexScene'),
|
|
iconType: 'visual_review',
|
|
},
|
|
VisualReviewRuns: {
|
|
name: 'Runs',
|
|
projectBased: true,
|
|
import: () => import('./frontend/scenes/VisualReviewRunsScene'),
|
|
iconType: 'visual_review',
|
|
},
|
|
VisualReviewRun: {
|
|
name: 'Visual review run',
|
|
projectBased: true,
|
|
import: () => import('./frontend/scenes/VisualReviewRunScene'),
|
|
iconType: 'visual_review',
|
|
},
|
|
VisualReviewSettings: {
|
|
name: 'Visual review settings',
|
|
projectBased: true,
|
|
import: () => import('./frontend/scenes/VisualReviewSettingsScene'),
|
|
iconType: 'visual_review',
|
|
},
|
|
VisualReviewSnapshotHistory: {
|
|
name: 'Visual review snapshot history',
|
|
projectBased: true,
|
|
import: () => import('./frontend/scenes/VisualReviewSnapshotHistoryScene'),
|
|
iconType: 'visual_review',
|
|
},
|
|
VisualReviewSnapshotOverview: {
|
|
name: 'Snapshots',
|
|
projectBased: true,
|
|
import: () => import('./frontend/scenes/VisualReviewSnapshotOverviewScene'),
|
|
iconType: 'visual_review',
|
|
},
|
|
},
|
|
routes: {
|
|
'/visual_review': ['VisualReviewIndex', 'visualReviewIndex'],
|
|
'/visual_review/settings': ['VisualReviewSettings', 'visualReviewSettings'],
|
|
'/visual_review/runs/:runId': ['VisualReviewRun', 'visualReviewRun'],
|
|
'/visual_review/repos/:repoId/runs': ['VisualReviewRuns', 'visualReviewRepoRuns'],
|
|
'/visual_review/repos/:repoId/snapshots': ['VisualReviewSnapshotOverview', 'visualReviewSnapshotOverview'],
|
|
'/visual_review/repos/:repoId/:runType/snapshots/:identifier': [
|
|
'VisualReviewSnapshotHistory',
|
|
'visualReviewSnapshotHistory',
|
|
],
|
|
},
|
|
redirects: {},
|
|
urls: {
|
|
// Entry URL — the index scene resolves a repo and forwards into the
|
|
// workspace. Sidebar/nav callers stay zero-arg as before.
|
|
visualReviewRuns: (): string => '/visual_review',
|
|
visualReviewSettings: (): string => '/visual_review/settings',
|
|
visualReviewRun: (runId: string): string => `/visual_review/runs/${runId}`,
|
|
visualReviewRepoRuns: (repoId: string): string => `/visual_review/repos/${repoId}/runs`,
|
|
visualReviewSnapshotOverview: (repoId: string): string => `/visual_review/repos/${repoId}/snapshots`,
|
|
visualReviewSnapshotHistory: (repoId: string, runType: string, identifier: string): string =>
|
|
`/visual_review/repos/${repoId}/${encodeURIComponent(runType)}/snapshots/${encodeURIComponent(identifier)}`,
|
|
},
|
|
fileSystemTypes: {},
|
|
treeItemsNew: [],
|
|
treeItemsProducts: [
|
|
{
|
|
path: 'Visual review',
|
|
intents: [ProductKey.VISUAL_REVIEW],
|
|
category: ProductItemCategory.UNRELEASED,
|
|
href: urls.visualReviewRuns(),
|
|
iconType: 'visual_review' as FileSystemIconType,
|
|
flag: FEATURE_FLAGS.VISUAL_REVIEW,
|
|
tags: ['alpha'],
|
|
sceneKey: 'VisualReviewIndex',
|
|
},
|
|
],
|
|
}
|