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
2 changes: 1 addition & 1 deletion codestory-ui/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<link rel="preconnect" href="https://fonts.googleapis.com" />
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
<link
href="https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500;700&display=swap"
href="https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;500;700&family=Outfit:wght@700;800&family=Plus+Jakarta+Sans:wght@400;500;700&display=swap"
rel="stylesheet"
/>
</head>
Expand Down
10 changes: 10 additions & 0 deletions codestory-ui/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions codestory-ui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
"@monaco-editor/react": "4.7.0",
"@xyflow/react": "12.10.1",
"html-to-image": "^1.11.13",
"lucide-react": "^0.575.0",
"mermaid": "11.12.3",
"monaco-editor": "0.55.1",
"react": "19.2.4",
Expand Down
113 changes: 31 additions & 82 deletions codestory-ui/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import {
toMonacoModelPath,
type AgentConnectionState,
} from "./app/layoutPersistence";
import { loadFeatureFlags, saveFeatureFlags, type FeatureFlagState } from "./app/featureFlags";
import { trackAnalyticsEvent } from "./app/analytics";
import { UI_CONTRACT, UI_LAYOUT_SCHEMA_STORAGE_KEY } from "./app/uiContract";
import type { PendingSymbolFocus } from "./app/types";
Expand Down Expand Up @@ -107,7 +106,6 @@ export default function App() {
const [bookmarkSeed, setBookmarkSeed] = useState<{ nodeId: string; label: string } | null>(null);
const [activeSection, setActiveSection] = useState<AppShellSection>("investigate");
const [commandPaletteOpen, setCommandPaletteOpen] = useState<boolean>(false);
const [featureFlags, setFeatureFlags] = useState<FeatureFlagState>(() => loadFeatureFlags());
const [investigateMode, setInvestigateMode] = useState<InvestigateFocusMode>(() => {
if (typeof window === "undefined") {
return "graph";
Expand Down Expand Up @@ -164,10 +162,6 @@ export default function App() {
window.localStorage.setItem(UI_LAYOUT_SCHEMA_STORAGE_KEY, String(UI_CONTRACT.schemaVersion));
}, [investigateMode]);

useEffect(() => {
saveFeatureFlags(featureFlags);
}, [featureFlags]);

useEffect(() => {
const previous = previousIndexProgressRef.current;
if (previous !== null && indexProgress === null) {
Expand Down Expand Up @@ -591,13 +585,6 @@ export default function App() {
}));
}, []);

const updateFeatureFlag = useCallback((flag: keyof FeatureFlagState, value: boolean) => {
setFeatureFlags((previous) => ({
...previous,
[flag]: value,
}));
}, []);

const refreshSpaces = useCallback(() => {
setSpaces(listSpaces());
}, []);
Expand Down Expand Up @@ -848,29 +835,16 @@ export default function App() {
label: "Save Investigation Space",
detail: "Store current prompt and focus for reuse",
keywords: ["space", "save", "library"],
disabled: !featureFlags.spacesLibrary,
run: () =>
invokeCommand("save-space", () => {
createSpaceFromCurrentContext("", "");
setActiveSection("library");
}),
},
{
id: "toggle-ux-reset",
label: featureFlags.uxResetV2 ? "Disable UX Reset" : "Enable UX Reset",
detail: "Rollback switch for staged rollout",
keywords: ["feature flag", "rollback", "shell"],
run: () =>
invokeCommand("toggle-ux-reset", () => {
updateFeatureFlag("uxResetV2", !featureFlags.uxResetV2);
}),
},
],
[
activeSection,
createSpaceFromCurrentContext,
featureFlags.spacesLibrary,
featureFlags.uxResetV2,
focusGraphSearchInput,
handleInvestigateModeChange,
handlePrompt,
Expand All @@ -883,7 +857,6 @@ export default function App() {
prompt,
runIndexFromUi,
trailDisabledReason,
updateFeatureFlag,
],
);

Expand Down Expand Up @@ -1034,14 +1007,6 @@ export default function App() {
/>
);

const legacyWorkspaceView = (
<div className="workspace">
{responsePaneView}
{graphPaneView}
{codePaneView}
</div>
);

const focusedPane =
investigateMode === "graph"
? graphPaneView
Expand All @@ -1051,31 +1016,29 @@ export default function App() {

const focusedWorkspaceView = (
<div className="investigate-layout">
{featureFlags.onboardingStarter ? (
<StarterCard
className="starter-card"
projectPath={projectPath}
projectOpen={projectOpen}
indexComplete={hasCompletedIndex || rootSymbols.length > 0}
askedFirstQuestion={askedFirstQuestion}
inspectedSource={inspectedSource}
onOpenProject={openProjectFromUi}
onRunIndex={runRecommendedIndex}
onSeedQuestion={seedFirstQuestion}
onInspectSource={jumpToSourceInspection}
onPrimaryAction={(action) => {
trackAnalyticsEvent(
"starter_card_cta_clicked",
{
action,
},
{
projectPath,
},
);
}}
/>
) : null}
<StarterCard
className="starter-card"
projectPath={projectPath}
projectOpen={projectOpen}
indexComplete={hasCompletedIndex || rootSymbols.length > 0}
askedFirstQuestion={askedFirstQuestion}
inspectedSource={inspectedSource}
onOpenProject={openProjectFromUi}
onRunIndex={runRecommendedIndex}
onSeedQuestion={seedFirstQuestion}
onInspectSource={jumpToSourceInspection}
onPrimaryAction={(action) => {
trackAnalyticsEvent(
"starter_card_cta_clicked",
{
action,
},
{
projectPath,
},
);
}}
/>

<div className="investigate-toolbar">
<InvestigateFocusSwitcher
Expand All @@ -1089,7 +1052,6 @@ export default function App() {
createSpaceFromCurrentContext("", "");
setActiveSection("library");
}}
disabled={!featureFlags.spacesLibrary}
>
Save Space
</button>
Expand All @@ -1108,26 +1070,17 @@ export default function App() {
</div>
);

const workspaceView = featureFlags.singlePaneInvestigate
? focusedWorkspaceView
: legacyWorkspaceView;

const sectionContent: Partial<Record<AppShellSection, ReactNode>> = {
library: featureFlags.spacesLibrary ? (
library: (
<SpacesPanel
spaces={spaces}
activeSpaceId={activeSpaceId}
onCreateSpace={createSpaceFromCurrentContext}
onLoadSpace={loadSpaceIntoWorkspace}
onDeleteSpace={removeSpaceById}
/>
) : (
<section className="shell-card">
<h3>Spaces Disabled</h3>
<p>Enable spaces in Settings to save and reopen investigations.</p>
</section>
),
settings: <SettingsPage featureFlags={featureFlags} onUpdateFlag={updateFeatureFlag} />,
settings: <SettingsPage />,
};

return (
Expand All @@ -1147,16 +1100,12 @@ export default function App() {

<StatusStrip status={status} indexProgress={indexProgress} />

{featureFlags.uxResetV2 ? (
<AppShell
activeSection={activeSection}
onSelectSection={setActiveSection}
workspace={workspaceView}
sectionContent={sectionContent}
/>
) : (
legacyWorkspaceView
)}
<AppShell
activeSection={activeSection}
onSelectSection={setActiveSection}
workspace={focusedWorkspaceView}
sectionContent={sectionContent}
/>

<BookmarkManager
open={bookmarkManagerOpen}
Expand Down
73 changes: 0 additions & 73 deletions codestory-ui/src/app/featureFlags.ts

This file was deleted.

3 changes: 2 additions & 1 deletion codestory-ui/src/app/useEditorDecorations.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { type Monaco, type OnMount } from "@monaco-editor/react";

import type { CodeEdgeContext } from "../components/CodePane";
import type { NodeDetailsDto, SourceOccurrenceDto } from "../generated/api";
import { GRAPH_THEME } from "../theme/tokens";

type UseEditorDecorationsArgs = {
saveCurrentFile: () => Promise<boolean>;
Expand Down Expand Up @@ -120,7 +121,7 @@ export function useEditorDecorations({
isWholeLine: true,
className: "monaco-focus-line",
overviewRuler: {
color: "#f0b42988",
color: GRAPH_THEME.editorOverview,
position: monaco.editor.OverviewRulerLane.Center,
},
},
Expand Down
16 changes: 13 additions & 3 deletions codestory-ui/src/components/InvestigateFocusSwitcher.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,30 +3,40 @@ import {
investigateFocusModeLabel,
type InvestigateFocusMode,
} from "../layout/layoutPresets";
import { Bolt, Code2, Orbit } from "lucide-react";
import type { ReactNode } from "react";

import { Button } from "../ui/primitives";

type InvestigateFocusSwitcherProps = {
mode: InvestigateFocusMode;
onModeChange: (mode: InvestigateFocusMode) => void;
};

export function InvestigateFocusSwitcher({ mode, onModeChange }: InvestigateFocusSwitcherProps) {
const modeIcons: Record<InvestigateFocusMode, ReactNode> = {
ask: <Bolt size={14} strokeWidth={2.5} aria-hidden />,
graph: <Orbit size={14} strokeWidth={2.5} aria-hidden />,
code: <Code2 size={14} strokeWidth={2.5} aria-hidden />,
};
return (
<div className="focus-switcher" role="tablist" aria-label="Investigate focus mode">
{INVESTIGATE_FOCUS_MODES.map((candidate) => {
const isActive = candidate === mode;
return (
<button
<Button
key={candidate}
type="button"
role="tab"
aria-selected={isActive}
variant={isActive ? "primary" : "ghost"}
className={
isActive ? "focus-switcher-item focus-switcher-item-active" : "focus-switcher-item"
}
onClick={() => onModeChange(candidate)}
>
{modeIcons[candidate]}
{investigateFocusModeLabel(candidate)}
</button>
</Button>
);
})}
</div>
Expand Down
4 changes: 2 additions & 2 deletions codestory-ui/src/components/StatusStrip.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@ export function StatusStrip({ status, indexProgress }: StatusStripProps) {
return (
<div className="status-strip">
<span>{status}</span>
{indexProgress && (
{indexProgress ? (
<span>
Indexing {indexProgress.current}/{indexProgress.total}
</span>
)}
) : null}
</div>
);
}
Loading