Skip to content

Commit 60c1203

Browse files
committed
refactor: update font families and component labels for consistency
- Changed font family in CiceroGeneratorForm, CiceroGeneratorPanel, and CiceroStepIndicator to use a primary variable. - Updated component title from "Cicero Template Generator" to "AI Template Generator" in CiceroGeneratorPanel. - Refactored state management in CiceroGenerator to replace setAIConfigOpen with setSettingsOpen. - Modified CodeSelectionMenu to use setSettingsOpen instead of setAIConfigOpen. - Enhanced Navbar to include a dropdown for loading sample templates with appropriate error handling. - Redesigned SettingsModal to use a collapsible structure for better organization of settings. - Updated tour steps to reflect changes in terminology from "Concerto Model" to "Data Model" and similar adjustments for clarity. - Adjusted MainContainer to improve the layout and labeling of template and data sections. Signed-off-by: Matt Roberts <code@rbrts.uk>
1 parent 41a1138 commit 60c1203

File tree

14 files changed

+851
-149
lines changed

14 files changed

+851
-149
lines changed

e2e/app.spec.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,9 @@ test.describe('App Loading', () => {
2121
await expect(page.locator('.app-spinner-container')).toBeHidden({ timeout: 30000 });
2222

2323
// Check for editor panel headers
24-
await expect(page.getByText('Concerto Model')).toBeVisible();
25-
await expect(page.getByText('TemplateMark')).toBeVisible();
26-
await expect(page.getByText('JSON Data')).toBeVisible();
24+
await expect(page.getByText('Data Model')).toBeVisible();
25+
await expect(page.getByText('Template')).toBeVisible();
26+
await expect(page.getByText('Data')).toBeVisible();
2727
});
2828

2929
test('should display Preview panel with content', async ({ page }) => {

e2e/template-workflow.spec.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ test.describe('Template Workflow', () => {
2828
});
2929

3030
test('should collapse and expand editor panels', async ({ page }) => {
31-
// Find the Concerto Model collapse button
31+
// Find the Data Model collapse button
3232
const modelCollapseBtn = page.locator('button[title="Collapse"]').first();
3333
await expect(modelCollapseBtn).toBeVisible();
3434

@@ -45,19 +45,19 @@ test.describe('Template Workflow', () => {
4545
await expect(editorToggle).toBeVisible();
4646

4747
// Initially editors should be visible
48-
await expect(page.getByText('Concerto Model')).toBeVisible();
48+
await expect(page.getByText('Data Model')).toBeVisible();
4949

5050
// Toggle off
5151
await editorToggle.click();
5252

5353
// Editors should be hidden
54-
await expect(page.getByText('Concerto Model')).toBeHidden();
54+
await expect(page.getByText('Data Model')).toBeHidden();
5555

5656
// Toggle back on
5757
await editorToggle.click();
5858

5959
// Editors should be visible again
60-
await expect(page.getByText('Concerto Model')).toBeVisible();
60+
await expect(page.getByText('Data Model')).toBeVisible();
6161
});
6262

6363
test('should toggle Preview panel visibility', async ({ page }) => {
@@ -72,12 +72,12 @@ test.describe('Template Workflow', () => {
7272
// Ensure at least one editor panel is visible before hiding preview
7373
// (app forbids hiding the last visible panel)
7474
const editorToggle = page.getByRole('button', { name: 'Editor' });
75-
const concertoModelHeader = page.getByText('Concerto Model');
75+
const dataModelHeader = page.getByText('Data Model');
7676

7777
// If editors are not visible, click to show them first
78-
if (!(await concertoModelHeader.isVisible())) {
78+
if (!(await dataModelHeader.isVisible())) {
7979
await editorToggle.click();
80-
await expect(concertoModelHeader).toBeVisible();
80+
await expect(dataModelHeader).toBeVisible();
8181
}
8282

8383
// Now toggle preview off

src/App.tsx

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -10,19 +10,13 @@ import LearnContent from "./components/Content";
1010
import MainContainer from "./pages/MainContainer";
1111
import PlaygroundSidebar from "./components/PlaygroundSidebar";
1212
import "./styles/App.css";
13-
import AIConfigPopup from "./components/AIConfigPopup";
1413

1514
const { Content } = Layout;
1615

1716
const App = () => {
1817
const navigate = useNavigate();
1918
const init = useAppStore((state) => state.init);
2019
const loadFromLink = useAppStore((state) => state.loadFromLink);
21-
const { isAIConfigOpen, setAIConfigOpen } =
22-
useAppStore((state) => ({
23-
isAIConfigOpen: state.isAIConfigOpen,
24-
setAIConfigOpen: state.setAIConfigOpen,
25-
}));
2620
const backgroundColor = useAppStore((state) => state.backgroundColor);
2721
const textColor = useAppStore((state) => state.textColor);
2822
const [loading, setLoading] = useState(true);
@@ -129,10 +123,6 @@ const App = () => {
129123
</div>
130124
)}
131125
</Content>
132-
<AIConfigPopup
133-
isOpen={isAIConfigOpen}
134-
onClose={() => setAIConfigOpen(false)}
135-
/>
136126
</>
137127
}
138128
/>

src/components/AIChatPanel.tsx

Lines changed: 3 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,12 @@ export const AIChatPanel = () => {
1515
editorAgreementData: state.editorAgreementData,
1616
}));
1717

18-
const { chatState, resetChat, aiConfig, setAIConfig, setAIConfigOpen, setAIChatOpen, textColor, backgroundColor } = useAppStore((state) => ({
18+
const { chatState, resetChat, aiConfig, setAIConfig, setSettingsOpen, setAIChatOpen, textColor, backgroundColor } = useAppStore((state) => ({
1919
chatState: state.chatState,
2020
resetChat: state.resetChat,
2121
aiConfig: state.aiConfig,
2222
setAIConfig: state.setAIConfig,
23-
setAIConfigOpen: state.setAIConfigOpen,
23+
setSettingsOpen: state.setSettingsOpen,
2424
setAIChatOpen: state.setAIChatOpen,
2525
textColor: state.textColor,
2626
backgroundColor: state.backgroundColor
@@ -86,7 +86,7 @@ export const AIChatPanel = () => {
8686
if (!userInput.trim()) return;
8787

8888
if (!aiConfig) {
89-
setAIConfigOpen(true);
89+
setSettingsOpen(true);
9090
return;
9191
}
9292

@@ -240,32 +240,6 @@ export const AIChatPanel = () => {
240240
<div className={theme.header}>
241241
<h2 className="text-lg font-bold" style={{ color: textColor }}>AI Assistant</h2>
242242
<div className="flex items-center gap-2">
243-
<button
244-
onClick={() => setAIConfigOpen(true)}
245-
className="text-gray-500 hover:text-gray-800"
246-
title="AI Settings"
247-
aria-label="AI Settings"
248-
>
249-
<svg
250-
xmlns="http://www.w3.org/2000/svg"
251-
fill="none"
252-
viewBox="0 0 24 24"
253-
strokeWidth={1.5}
254-
stroke="currentColor"
255-
className="size-6"
256-
>
257-
<path
258-
strokeLinecap="round"
259-
strokeLinejoin="round"
260-
d="M9.594 3.94c.09-.542.56-.94 1.11-.94h2.593c.55 0 1.02.398 1.11.94l.213 1.281c.063.374.313.686.645.87.074.04.147.083.22.127.325.196.72.257 1.075.124l1.217-.456a1.125 1.125 0 0 1 1.37.49l1.296 2.247a1.125 1.125 0 0 1-.26 1.431l-1.003.827c-.293.241-.438.613-.43.992a7.723 7.723 0 0 1 0 .255c-.008.378.137.75.43.991l1.004.827c.424.35.534.955.26 1.43l-1.298 2.247a1.125 1.125 0 0 1-1.369.491l-1.217-.456c-.355-.133-.75-.072-1.076.124a6.47 6.47 0 0 1-.22.128c-.331.183-.581.495-.644.869l-.213 1.281c-.09.543-.56.94-1.11.94h-2.594c-.55 0-1.019-.398-1.11-.94l-.213-1.281c-.062-.374-.312-.686-.644-.87a6.52 6.52 0 0 1-.22-.127c-.325-.196-.72-.257-1.076-.124l-1.217.456a1.125 1.125 0 0 1-1.369-.49l-1.297-2.247a1.125 1.125 0 0 1 .26-1.431l1.004-.827c.292-.24.437-.613.43-.991a6.932 6.932 0 0 1 0-.255c.007-.38-.138-.751-.43-.992l-1.004-.827a1.125 1.125 0 0 1-.26-1.43l1.297-2.247a1.125 1.125 0 0 1 1.37-.491l1.216.456c.356.133.751.072 1.076-.124.072-.044.146-.086.22-.128.332-.183.582-.495.644-.869l.214-1.28Z"
261-
/>
262-
<path
263-
strokeLinecap="round"
264-
strokeLinejoin="round"
265-
d="M15 12a3 3 0 1 1-6 0 3 3 0 0 1 6 0Z"
266-
/>
267-
</svg>
268-
</button>
269243
<button
270244
onClick={resetChat}
271245
className="text-gray-500 hover:text-gray-800"

0 commit comments

Comments
 (0)