Skip to content

Commit daa1563

Browse files
V48 (impl-only): Share Deposit source on Read master-detail
Reuse DepositSourceSelection for /reads (same repo·branch·SHA package), clear synthesis on Back like Deposit, and remove the legacy Terminal workbench/repository panel stack plus dead evidence models. Packs, Deposits, and Reads all drill master → detail with Back.
1 parent 5d78e66 commit daa1563

43 files changed

Lines changed: 128 additions & 5302 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.

uapi/components/bitcode/pipeline/models/workspace-explainers.ts

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ export const TERMINAL_SURFACE_EXPLAINERS = {
8282
references: {
8383
source: [
8484
...TERMINAL_SOURCE_REFS,
85-
'uapi/components/reads/ReadsReadScenarioPanel/ReadsReadScenarioPanel.tsx',
85+
'uapi/components/reads/ReadsNeedComposePanel/ReadsNeedComposePanel.tsx',
8686
'uapi/components/reads/models/read-scenarios.ts',
8787
],
8888
canon: TERMINAL_CANON_REFS,
@@ -145,7 +145,7 @@ export const TERMINAL_SURFACE_EXPLAINERS = {
145145
references: {
146146
source: [
147147
...TERMINAL_SOURCE_REFS,
148-
'uapi/components/reads/ReadsDepositReadWorkbench/ReadsDepositReadWorkbench.tsx',
148+
'uapi/components/reads/ReadPageClient/ReadPageClient.tsx',
149149
'uapi/components/bitcode/pipeline/BitcodeActionWorkbenchCard/BitcodeActionWorkbenchCard.tsx',
150150
],
151151
canon: TERMINAL_CANON_REFS,
@@ -270,7 +270,7 @@ export const TERMINAL_SURFACE_EXPLAINERS = {
270270
references: {
271271
source: [
272272
...TERMINAL_SOURCE_REFS,
273-
'uapi/components/reads/ReadsRepositoryContextPanel/ReadsRepositoryContextPanel.tsx',
273+
'uapi/components/deposits/DepositSourceSelection/DepositSourceSelection.tsx',
274274
'uapi/components/bitcode/pipeline/models/repository-context.ts',
275275
],
276276
canon: [
@@ -294,7 +294,7 @@ export const TERMINAL_SURFACE_EXPLAINERS = {
294294
references: {
295295
source: [
296296
...TERMINAL_SOURCE_REFS,
297-
'uapi/components/reads/ReadsDepositReadWorkbench/ReadsDepositReadWorkbench.tsx',
297+
'uapi/components/reads/ReadPageClient/ReadPageClient.tsx',
298298
],
299299
canon: TERMINAL_CANON_REFS,
300300
},
@@ -440,7 +440,7 @@ export const TERMINAL_INLINE_EXPLAINERS = {
440440
references: {
441441
source: [
442442
'uapi/components/bitcode/pipeline/',
443-
'uapi/components/reads/ReadsReadScenarioPanel/ReadsReadScenarioPanel.tsx',
443+
'uapi/components/reads/ReadsNeedComposePanel/ReadsNeedComposePanel.tsx',
444444
],
445445
canon: TERMINAL_CANON_REFS,
446446
},
@@ -519,7 +519,7 @@ export const TERMINAL_INLINE_EXPLAINERS = {
519519
],
520520
references: {
521521
source: [
522-
'uapi/components/reads/ReadsRepositoryContextPanel/ReadsRepositoryContextPanel.tsx',
522+
'uapi/components/deposits/DepositSourceSelection/DepositSourceSelection.tsx',
523523
'uapi/components/bitcode/pipeline/models/repository-context.ts',
524524
],
525525
canon: TERMINAL_CANON_REFS,
@@ -538,7 +538,7 @@ export const TERMINAL_INLINE_EXPLAINERS = {
538538
],
539539
references: {
540540
source: [
541-
'uapi/components/reads/ReadsRepositoryContextPanel/ReadsRepositoryContextPanel.tsx',
541+
'uapi/components/deposits/DepositSourceSelection/DepositSourceSelection.tsx',
542542
'uapi/components/bitcode/pipeline/models/pipeline-activity-history.ts',
543543
],
544544
canon: TERMINAL_CANON_REFS,
@@ -613,7 +613,7 @@ export const TERMINAL_INLINE_EXPLAINERS = {
613613
],
614614
references: {
615615
source: [
616-
'uapi/components/reads/ReadsReadScenarioPanel/ReadsReadScenarioPanel.tsx',
616+
'uapi/components/reads/ReadsNeedComposePanel/ReadsNeedComposePanel.tsx',
617617
'uapi/components/bitcode/pipeline/models/pipeline-activity-history.ts',
618618
],
619619
canon: TERMINAL_CANON_REFS,
@@ -633,7 +633,7 @@ export const TERMINAL_INLINE_EXPLAINERS = {
633633
references: {
634634
source: [
635635
'uapi/components/bitcode/pipeline/',
636-
'uapi/components/reads/ReadsRepositoryContextPanel/ReadsRepositoryContextPanel.tsx',
636+
'uapi/components/deposits/DepositSourceSelection/DepositSourceSelection.tsx',
637637
],
638638
canon: TERMINAL_CANON_REFS,
639639
},
@@ -667,7 +667,7 @@ export const TERMINAL_INLINE_EXPLAINERS = {
667667
],
668668
references: {
669669
source: [
670-
'uapi/components/reads/ReadsRepositoryContextPanel/ReadsRepositoryContextPanel.tsx',
670+
'uapi/components/deposits/DepositSourceSelection/DepositSourceSelection.tsx',
671671
'uapi/components/bitcode/pipeline/',
672672
],
673673
canon: TERMINAL_CANON_REFS,

uapi/components/deposits/DepositSourceSelection/DepositSourceSelection.tsx

Lines changed: 20 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
"use client";
22

33
/**
4-
* Deposit-native source selection (north-star Sell step A).
4+
* Shared source selection (repository · branch · commit SHA package).
55
*
6-
* Repository + branch + commit selection shell, full-repo earnings estimate, and
7-
* activity-ledger anchor. Field columns live in DepositSourceFieldGrid; VCS data
8-
* is owned by use-deposit-source-vcs.
6+
* Primary home remains deposits/; /reads reuses this control for master-detail
7+
* parity (same SHA element). Field columns live in DepositSourceFieldGrid;
8+
* VCS data is owned by use-deposit-source-vcs. Optional heading/description
9+
* props keep route-facing copy accurate without forking the control.
910
*/
1011

1112
import React, { useEffect, useState } from "react";
@@ -51,6 +52,14 @@ type DepositSourceSelectionProps = {
5152
* selection — the configuration that produced the loaded run is read-only.
5253
*/
5354
disabled?: boolean;
55+
/**
56+
* Route-facing copy overrides so /reads can reuse the same SHA source
57+
* package control without deposit-only wording (master-detail parity).
58+
*/
59+
heading?: string;
60+
description?: string;
61+
descriptionLocked?: string;
62+
ariaLabel?: string;
5463
};
5564

5665
export default function DepositSourceSelection({
@@ -62,6 +71,10 @@ export default function DepositSourceSelection({
6271
repoEarningEstimateSats,
6372
repositoryAnchors = [],
6473
disabled = false,
74+
heading = "Select the repository you are depositing",
75+
description = "One connected repository, branch, and commit form the source package the rest of the Deposit reads.",
76+
descriptionLocked = "Source package that produced this run — locked while reviewing run detail.",
77+
ariaLabel = "Select deposit repository",
6578
}: DepositSourceSelectionProps) {
6679
const router = useRouter();
6780
const searchParams = useSearchParams();
@@ -256,7 +269,7 @@ export default function DepositSourceSelection({
256269
className={`border border-white/10 bg-white/[0.035] px-4 py-4 ${
257270
disabled ? "opacity-80" : ""
258271
}`}
259-
aria-label="Select deposit repository"
272+
aria-label={ariaLabel}
260273
data-testid="deposit-source-selection"
261274
data-locked={disabled ? "true" : "false"}
262275
aria-disabled={disabled || undefined}
@@ -267,15 +280,13 @@ export default function DepositSourceSelection({
267280
Repository
268281
</p>
269282
<h2 className="mt-2 flex items-center gap-2 text-lg font-semibold text-white">
270-
<span>Select the repository you are depositing</span>
283+
<span>{heading}</span>
271284
<BitcodeInlineExplainer
272285
explainer={DEPOSIT_SECTION_EXPLAINERS.repository}
273286
/>
274287
</h2>
275288
<p className="mt-2 max-w-3xl text-sm leading-6 text-neutral-400">
276-
{disabled
277-
? "Source package that produced this run — locked while reviewing run detail."
278-
: "One connected repository, branch, and commit form the source package the rest of the Deposit reads."}
289+
{disabled ? descriptionLocked : description}
279290
</p>
280291
</div>
281292
<div className="flex items-center gap-2">

uapi/components/deposits/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ deposits/
3838
use-deposit-activity-recording.ts
3939
use-deposit-synthesis-lifecycle.ts
4040
DepositSourceSelection/
41-
DepositSourceSelection.tsx # shell: header, anchors, status, URL sync
41+
DepositSourceSelection.tsx # shared SHA source package (also used by /reads)
4242
DepositSourceListRefreshButton.tsx
4343
hooks/use-deposit-source-vcs.ts
4444
DepositSourceFieldGrid/ # provider/repo/branch/commit columns

uapi/components/reads/README.md

Lines changed: 34 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -1,79 +1,67 @@
11
# Reads experience (`Reads*`)
22

3+
Commercial IP-buyer surface for `/reads`: master-detail pipelines, shared
4+
repository·branch·commit source package (`DepositSourceSelection`), Need +
5+
Relevant/Irrelevant path steering, SynthesizeReadAssetPacks (SDIVF), option
6+
select, SettleAssetPack → `/packs`.
7+
8+
## Master-detail (shared across product routes)
9+
10+
| Route | Master | Detail | Back |
11+
| --- | --- | --- | --- |
12+
| `/packs` | Activity table | Selected AssetPack / proof detail | Via selection |
13+
| `/deposits` | Pipelines table | Source + Obfuscations + options | Back to Deposit |
14+
| `/reads` | Pipelines table | Source + Need + options | Back to Read |
15+
316
## Layout
417

518
```
619
reads/
720
README.md
821
models/
9-
deposit-read-workbench.ts # stable public re-exports
22+
deposit-read-workbench.ts # stable type re-exports (activity drafts)
1023
deposit-read-workbench-types.ts
11-
deposit-read-workbench-snapshot.ts
12-
deposit-read-workbench-normalize.ts # normalize snapshot → view model
13-
deposit-read-workbench-normalize-helpers.ts
14-
deposit-read-evidence-rows.ts # evidence facade
15-
deposit-read-evidence-row-builders.ts # row-builder facade
16-
deposit-read-evidence-disclosure-rows.ts
17-
deposit-read-evidence-asset-pack-rows.ts
18-
deposit-read-evidence-need-rows.ts
19-
enterprise-reading-ux-types.ts # step catalog + types
20-
enterprise-reading-ux-state.ts # builders + re-exports
24+
enterprise-reading-ux-types.ts # step catalog + types
25+
enterprise-reading-ux-state.ts # builders + re-exports
2126
read-route-session-types.ts
2227
read-route-helpers.ts
2328
read-procurement-governance.ts
2429
read-fit-measurement-review.ts
2530
read-settlement-rights-delivery.ts
26-
read-route-model.ts # session facade + stage helpers
27-
read-route-rows.ts # session / procurement / authority rows
28-
read-scenarios.ts
31+
read-route-model.ts # session facade + stage helpers
32+
read-route-rows.ts # session / procurement / authority rows
33+
read-scenarios.ts # measurement draft types (activity history)
2934
read-format.ts
30-
read-workbench-values.ts
3135
ReadPageClient/
32-
ReadPageClient.tsx # thin orchestration
36+
ReadPageClient.tsx # thin orchestration
3337
hooks/
3438
use-read-route-params.ts
3539
use-read-live-runs.ts
3640
use-read-url-navigation.ts
3741
use-read-pipeline-telemetry.ts
3842
use-read-session-projections.ts
3943
use-read-activity-recording.ts
40-
ReadsPipelinesSection/
44+
use-read-option-synthesis.ts
45+
ReadsPipelinesMaster/ # table + New (+) + Back
4146
ReadsPipelineTelemetry/
47+
ReadsNeedComposePanel/ # Need + path pickers + synthesize CTA
48+
ReadsNeedPathPickers/
49+
ReadsAssetPackOptions/
50+
ReadsOptionCard/
4251
ReadsRouteStateAside/
43-
ReadsPipelinesMaster/
44-
ReadsRepositoryContextPanel/
45-
hooks/use-reads-repository-vcs.ts
46-
ReadsRepositoryFieldGrid/
47-
ReadsRepositoryConnectionUnit/
48-
ReadsRepositorySupplyUnit/
49-
ReadsRepositoryGuidanceUnit/
50-
ReadsReadScenarioPanel/
51-
hooks/use-read-scenario-actions.ts
52-
ReadsReadScenarioFittingReview/
53-
ReadsReadScenarioList/
54-
ReadsDepositReadWorkbench/
55-
hooks/
56-
use-deposit-read-activity-recording.ts
57-
use-deposit-read-host.ts
58-
use-deposit-read-need-actions.ts
59-
ReadsDepositReadWorkbenchEmpty/
60-
ReadsDepositWorkbenchSupplyCards/
61-
ReadsDepositStagedReadingSection/
62-
ReadsDepositReadNeedReviewPanel/
63-
ReadsDepositSourceSafePreviewPanel/
64-
ReadsMeasuredReadAdmissionPanel/
65-
ReadsFitWorkbenchPanel/
66-
ReadsEnterpriseReadingSteps/
6752
```
6853

54+
Source selection reuses `deposits/DepositSourceSelection` (same SHA element as
55+
deposit) with route-facing copy overrides.
56+
6957
Page shell: `uapi/app/reads/`.
7058

71-
Import Bitcode only (no cross-experience imports for new work). Full filesystem
72-
contract: `internal-docs/BITCODE_SOURCE_LAYOUT.md`.
59+
Import Bitcode bases + shared deposit source selection only where the product
60+
law is one source package control. Full filesystem contract:
61+
`internal-docs/BITCODE_SOURCE_LAYOUT.md`.
7362

74-
Stable external import for workbench models remains:
63+
Stable external import for workbench **types** remains:
7564
`@/components/reads/models/deposit-read-workbench`.
7665

7766
Stable external import for route model remains:
78-
`@/components/reads/models/read-route-model` (also via deprecated
79-
`@/app/reads/read-route-model` re-export).
67+
`@/components/reads/models/read-route-model`.

uapi/components/reads/ReadPageClient/ReadPageClient.tsx

Lines changed: 38 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22
* Reads experience page client — deposit-parity orchestration for /reads.
33
*
44
* Compact header + pipelines table; New (+) opens compose/detail mode with
5-
* source selection (SHA), Need (+ relevant/irrelevant paths), options, settle.
5+
* shared DepositSourceSelection (SHA), Need (+ relevant/irrelevant paths),
6+
* options, settle. Master-detail matches /deposits and /packs (table → detail + Back).
67
*/
78

89
"use client";
@@ -19,14 +20,19 @@ import { useReadActivityRecording } from "./hooks/use-read-activity-recording";
1920
import { useReadOptionSynthesis } from "./hooks/use-read-option-synthesis";
2021

2122
import { ProductRouteShell } from "@/components/bitcode/routes/ProductRouteShell/ProductRouteShell";
22-
import ReadsRepositoryContextPanel from "@/components/reads/ReadsRepositoryContextPanel/ReadsRepositoryContextPanel";
23+
import DepositSourceSelection from "@/components/deposits/DepositSourceSelection/DepositSourceSelection";
24+
import { deriveRepositoryAnchors } from "@/components/deposits/models/deposit-activity-ledger";
2325
import { ReadsNeedComposePanel } from "@/components/reads/ReadsNeedComposePanel/ReadsNeedComposePanel";
2426
import { ReadsAssetPackOptions } from "@/components/reads/ReadsAssetPackOptions/ReadsAssetPackOptions";
2527
import { ReadsPipelinesMaster } from "@/components/reads/ReadsPipelinesMaster/ReadsPipelinesMaster";
2628
import { ReadsPipelineTelemetry } from "@/components/reads/ReadsPipelineTelemetry/ReadsPipelineTelemetry";
2729
import { ReadsRouteStateAside } from "@/components/reads/ReadsRouteStateAside/ReadsRouteStateAside";
2830
import { BitcodeShellBridgeProvider } from "@/components/bitcode/layout/BitcodeShellBridge/BitcodeShellBridge";
2931
import type { TerminalRepositoryContextState } from "@/components/bitcode/pipeline/models/repository-context";
32+
import {
33+
buildReadsHref,
34+
READS_ROUTE,
35+
} from "@/components/bitcode/routes/ProductRoutes/product-routes";
3036
import {
3137
DEFAULT_TRANSACTION_FILTERS,
3238
DEFAULT_TRANSACTION_PAGINATION,
@@ -153,18 +159,29 @@ export default function ReadPageClient() {
153159
[liveRuns, selectedTransactionId],
154160
);
155161

162+
const repositoryAnchors = useMemo(
163+
() => deriveRepositoryAnchors(liveRuns),
164+
[liveRuns],
165+
);
166+
156167
const isReadDetailOpen =
157168
Boolean(selectedTransactionId) || isComposeOpen || Boolean(synthesis.runId);
158169

159170
const closePipelineDetail = useCallback(() => {
160171
closeUrlDetail();
161172
setIsComposeOpen(false);
162-
}, [closeUrlDetail]);
173+
synthesis.reset();
174+
setSettleError(null);
175+
setSettleMessage(null);
176+
}, [closeUrlDetail, synthesis.reset]);
163177

164178
const openComposeDetail = useCallback(() => {
165179
closeUrlDetail();
180+
synthesis.reset();
181+
setSettleError(null);
182+
setSettleMessage(null);
166183
setIsComposeOpen(true);
167-
}, [closeUrlDetail]);
184+
}, [closeUrlDetail, synthesis.reset]);
168185

169186
const telemetry = useReadPipelineTelemetry(
170187
selectedRun || (synthesis.runId ? ({ id: synthesis.runId } as any) : null),
@@ -267,11 +284,21 @@ export default function ReadPageClient() {
267284
>
268285
<div className="grid min-w-0 gap-5">
269286
<div className="grid gap-5 xl:grid-cols-2">
270-
<ReadsRepositoryContextPanel
271-
preferredRepository={selectedRun?.repository || null}
272-
onContextChange={setRepositoryContext}
273-
onRecordActivity={handleRecordActivity}
274-
/>
287+
<div id="reads-section-source" className="min-w-0">
288+
<DepositSourceSelection
289+
preferredRepository={selectedRun?.repository || null}
290+
onContextChange={setRepositoryContext}
291+
onRecordActivity={handleRecordActivity}
292+
routePath={READS_ROUTE}
293+
buildRouteHref={buildReadsHref}
294+
repositoryAnchors={repositoryAnchors}
295+
disabled={isConfigLocked}
296+
heading="Select the repository you are reading"
297+
description="One connected repository, branch, and commit form the source package SynthesizeReadAssetPacks measures against."
298+
descriptionLocked="Source package for this read run — locked while reviewing run detail."
299+
ariaLabel="Repository source selector"
300+
/>
301+
</div>
275302
<ReadsNeedComposePanel
276303
need={need}
277304
onNeedChange={setNeed}
@@ -285,7 +312,8 @@ export default function ReadPageClient() {
285312
runId={synthesis.runId}
286313
onSynthesize={() => void synthesis.synthesize()}
287314
canSynthesize={Boolean(
288-
repositoryContext?.selectedRepository?.fullName,
315+
repositoryContext?.selectedRepository?.fullName &&
316+
repositoryContext?.selectedCommit,
289317
)}
290318
isConfigLocked={isConfigLocked}
291319
/>

0 commit comments

Comments
 (0)