Skip to content

Commit 985e669

Browse files
[feat](app): gate build-spec extras behind expert mode so guided matches the prototype
The prototype has no separate analysis section, but the build spec mandates the risk register, fitness functions, cost/ops indicators, C4 stub, methodology references, and glossary. Reconciled: - Guided mode now renders exactly the prototype's flow (no extra sections). - Those extra panels move into an expert-only "Professional analysis" block, styled with the design tokens, shown only in Expert mode. - Dropped the standalone contribution table (already covered by the detail panel's expert "Top contributing attributes"); removed the component. Verification: 35/35 tests; build clean; eslint 0; dev HTTP 200. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
1 parent fc004d5 commit 985e669

2 files changed

Lines changed: 14 additions & 79 deletions

File tree

src/App.tsx

Lines changed: 14 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ import { MigrationCard } from './components/MigrationCard';
1717
import { AntiPatternWarning } from './components/AntiPatternWarning';
1818
import { HowItDecides } from './components/HowItDecides';
1919
import { QaOverridePanel } from './components/QaOverridePanel';
20-
import { ContributionTable } from './components/ContributionTable';
2120
import { RiskRegister } from './components/RiskRegister';
2221
import { FitnessFunctions } from './components/FitnessFunctions';
2322
import { CostOpsBadges } from './components/CostOpsBadges';
@@ -29,7 +28,7 @@ import { useExportActions } from './hooks/useExportActions';
2928
import { DEFAULT_LEVELS } from './config/defaults';
3029
import { PRESETS } from './config/presets';
3130
import type { MigrationKey } from './config/migrationPaths';
32-
import { DIMENSIONS, DIMENSION_ORDER } from './config/dimensions';
31+
import { DIMENSION_ORDER } from './config/dimensions';
3332
import { effectiveWeights, rankWith, sensitivity, type Overrides } from './lib/scoring';
3433
import { detectAntiPatterns } from './lib/antiPatternEngine';
3534
import { generateC4 } from './lib/c4';
@@ -73,9 +72,6 @@ export default function App() {
7372

7473
const flips = useMemo(() => sensitivity(levels, 'D1', overrides), [levels, overrides]);
7574

76-
const selectedD1 =
77-
DIMENSIONS.D1.options.find((o) => o.id === effective.D1) ?? DIMENSIONS.D1.options[0];
78-
7975
const [showC4, setShowC4] = useState(false);
8076
const [editWeights, setEditWeights] = useState(false);
8177
const [currentDim, setCurrentDim] = useState<DimensionId>('D1');
@@ -220,28 +216,27 @@ export default function App() {
220216
<AntiPatternWarning rules={antiPatterns} mode={mode} />
221217
<HowItDecides />
222218

223-
<section aria-labelledby="analysis-heading">
224-
<h2 id="analysis-heading" className="text-lg font-semibold tracking-tight">
225-
{t('analysis.heading')}
226-
</h2>
227-
<div className="mt-4 grid gap-4 lg:grid-cols-2">
228-
<ContributionTable weights={weights} option={selectedD1} />
219+
{/* Expert-only depth (build-spec features beyond the prototype mockup). Guided mode
220+
stays faithful to the prototype; experts get the extra analysis. */}
221+
<section className="expert-only" aria-labelledby="analysis-heading">
222+
<div className="f-div" />
223+
<div style={{ display: 'flex', alignItems: 'center', gap: '8px', marginBottom: '13px' }}>
224+
<span style={{ fontSize: '15px', fontWeight: 500 }} id="analysis-heading">
225+
{t('analysis.heading')}
226+
</span>
227+
</div>
228+
<div style={{ display: 'grid', gridTemplateColumns: 'repeat(auto-fit,minmax(250px,1fr))', gap: '14px' }}>
229229
<CostOpsBadges />
230230
<FitnessFunctions weights={weights} />
231231
<RiskRegister selections={effective} />
232232
</div>
233-
<div className="mt-4 space-y-4">
233+
<div style={{ marginTop: '14px', display: 'flex', flexDirection: 'column', gap: '14px' }}>
234234
<div>
235-
<button
236-
type="button"
237-
onClick={() => setShowC4((v) => !v)}
238-
className="rounded-md border border-line px-3 py-1.5 text-sm font-medium hover:bg-surface-2"
239-
aria-expanded={showC4}
240-
>
235+
<button type="button" className="f-btn" onClick={() => setShowC4((v) => !v)} aria-expanded={showC4}>
241236
{showC4 ? t('c4.hide') : t('c4.show')}
242237
</button>
243238
{showC4 && (
244-
<div className="mt-3">
239+
<div style={{ marginTop: '12px' }}>
245240
<C4Preview code={generateC4(effective.D1)} />
246241
</div>
247242
)}

src/components/ContributionTable.tsx

Lines changed: 0 additions & 60 deletions
This file was deleted.

0 commit comments

Comments
 (0)