feat(ui): redesign GeoIntel as Atlas Workbench
This commit is contained in:
@@ -14,7 +14,14 @@ def test_frontend_declares_mol_as_primary_operating_focus() -> None:
|
||||
map_source = (ROOT / "frontend" / "src" / "components" / "GeoMap.tsx").read_text(
|
||||
encoding="utf-8"
|
||||
)
|
||||
app = (ROOT / "frontend" / "src" / "App.tsx").read_text(encoding="utf-8")
|
||||
navigation = (
|
||||
ROOT
|
||||
/ "frontend"
|
||||
/ "src"
|
||||
/ "components"
|
||||
/ "shell"
|
||||
/ "WorkbenchNavigation.tsx"
|
||||
).read_text(encoding="utf-8")
|
||||
|
||||
assert "PRIMARY_FOCUS_LABEL = 'Mol'" in focus
|
||||
assert "PRIMARY_FOCUS_REGION = 'Mol, Kempen'" in focus
|
||||
@@ -29,7 +36,8 @@ def test_frontend_declares_mol_as_primary_operating_focus() -> None:
|
||||
assert "PRIMARY_FOCUS_AREA_GEOJSON" in project_hook
|
||||
assert "4.35,51.28" not in project_hook
|
||||
assert "center: PRIMARY_FOCUS_CENTER" in map_source
|
||||
assert "GeoAI-werkruimte · gebiedsdata en analyse" in app
|
||||
assert "GeoIntel" in navigation
|
||||
assert "Atlas Workbench" in navigation
|
||||
|
||||
|
||||
def test_operator_workflows_put_mol_first_and_name_future_projects() -> None:
|
||||
|
||||
@@ -15,8 +15,9 @@ def test_map_first_explorer_is_the_default_product_flow() -> None:
|
||||
workspace = read("frontend/src/components/map/MapWorkspace.tsx")
|
||||
|
||||
assert "useState<WorkspaceKey>('map')" in app
|
||||
assert "Wat bevindt zich in dit gebied?" in workspace
|
||||
assert "Kies een datathema" in workspace
|
||||
assert "Gebied analyseren" in workspace
|
||||
assert "<h3>Thema</h3>" in workspace
|
||||
assert "<h3>Inzichten</h3>" in workspace
|
||||
assert "Teken rechthoek" in workspace
|
||||
assert "Volledig werkgebied" in workspace
|
||||
assert "Alle beschikbare thema" in workspace
|
||||
|
||||
@@ -24,7 +24,7 @@ def test_map_workspace_lives_in_task_based_workbench_shell() -> None:
|
||||
|
||||
assert "activeWorkspace === 'map'" in app
|
||||
assert app.index("activeWorkspace === 'map'") < app.index("<MapWorkspace")
|
||||
assert 'className="workbench-main"' in app
|
||||
assert "'workbench-main workbench-main-map' : 'workbench-main'" in app
|
||||
assert 'className="workbench-inspector"' in app
|
||||
assert ".workbench-layout" in styles
|
||||
assert ".workbench-sidebar" in styles
|
||||
|
||||
@@ -8,13 +8,22 @@ ROOT = Path(__file__).resolve().parents[2]
|
||||
|
||||
def test_app_uses_task_based_workbench_shell() -> None:
|
||||
app = (ROOT / "frontend" / "src" / "App.tsx").read_text(encoding="utf-8")
|
||||
navigation = (
|
||||
ROOT
|
||||
/ "frontend"
|
||||
/ "src"
|
||||
/ "components"
|
||||
/ "shell"
|
||||
/ "WorkbenchNavigation.tsx"
|
||||
).read_text(encoding="utf-8")
|
||||
|
||||
assert "type WorkspaceKey" in app
|
||||
assert "workspaceNavItems" in app
|
||||
assert 'data-testid={`workspace-nav-${item.key}`}' in app
|
||||
assert "<WorkbenchNavigation" in app
|
||||
assert 'data-testid={`workspace-nav-${item.key}`}' in navigation
|
||||
assert 'className="workbench-layout"' in app
|
||||
assert 'className="workbench-sidebar"' in app
|
||||
assert 'className="workbench-main"' in app
|
||||
assert 'className="workbench-sidebar"' in navigation
|
||||
assert "'workbench-main workbench-main-map' : 'workbench-main'" in app
|
||||
assert 'className="workbench-inspector"' in app
|
||||
assert "activeWorkspace === 'data'" in app
|
||||
assert "activeWorkspace === 'map'" in app
|
||||
@@ -26,6 +35,9 @@ def test_app_uses_task_based_workbench_shell() -> None:
|
||||
|
||||
def test_workbench_shell_css_provides_navigation_main_and_inspector_regions() -> None:
|
||||
css = (ROOT / "frontend" / "src" / "styles" / "app.css").read_text(encoding="utf-8")
|
||||
atlas = (ROOT / "frontend" / "src" / "styles" / "atlas-workbench.css").read_text(
|
||||
encoding="utf-8"
|
||||
)
|
||||
|
||||
assert ".workbench-topbar" in css
|
||||
assert ".context-bar" in css
|
||||
@@ -36,3 +48,6 @@ def test_workbench_shell_css_provides_navigation_main_and_inspector_regions() ->
|
||||
assert ".workbench-inspector" in css
|
||||
assert ".workspace-grid-data" in css
|
||||
assert ".workspace-grid-ai" in css
|
||||
assert ".workbench-stage" in atlas
|
||||
assert ".context-health" in atlas
|
||||
assert ".nav-item-icon" in atlas
|
||||
|
||||
@@ -6,17 +6,30 @@ from pathlib import Path
|
||||
ROOT = Path(__file__).resolve().parents[2]
|
||||
|
||||
|
||||
def test_frontend_shell_has_visual_polish_contracts() -> None:
|
||||
def test_frontend_shell_has_atlas_workbench_contracts() -> None:
|
||||
app = (ROOT / "frontend" / "src" / "App.tsx").read_text(encoding="utf-8")
|
||||
css = (ROOT / "frontend" / "src" / "styles" / "app.css").read_text(encoding="utf-8")
|
||||
css = (ROOT / "frontend" / "src" / "styles" / "atlas-workbench.css").read_text(
|
||||
encoding="utf-8"
|
||||
)
|
||||
navigation = (
|
||||
ROOT
|
||||
/ "frontend"
|
||||
/ "src"
|
||||
/ "components"
|
||||
/ "shell"
|
||||
/ "WorkbenchNavigation.tsx"
|
||||
).read_text(encoding="utf-8")
|
||||
|
||||
assert "workspace-command-bar" in app
|
||||
assert "workspace-nav-cluster" in app
|
||||
assert "--surface-raised" in css
|
||||
assert ".workspace-command-bar" in css
|
||||
assert "workspace-command-bar" not in app
|
||||
assert "workspace-nav-cluster" not in app
|
||||
assert "WorkbenchNavigation" in app
|
||||
assert "lucide-react" in navigation
|
||||
assert "--atlas-nav-width" in css
|
||||
assert ".workbench-stage" in css
|
||||
assert ".geo-explorer-layout" in css
|
||||
assert "grid-template-columns: 15.75rem minmax(28rem, 1fr) 20rem;" in css
|
||||
assert ".workspace-panel" in css
|
||||
assert ".data-density-grid" in css
|
||||
assert ".result-summary-card" in css
|
||||
assert ".geo-assistant-panel" in css
|
||||
|
||||
|
||||
def test_primary_panels_use_empty_state_components() -> None:
|
||||
|
||||
@@ -20,9 +20,18 @@ def test_global_focus_visible_contracts_are_defined() -> None:
|
||||
|
||||
def test_primary_navigation_has_keyboard_labels() -> None:
|
||||
app = (ROOT / "frontend" / "src" / "App.tsx").read_text(encoding="utf-8")
|
||||
navigation = (
|
||||
ROOT
|
||||
/ "frontend"
|
||||
/ "src"
|
||||
/ "components"
|
||||
/ "shell"
|
||||
/ "WorkbenchNavigation.tsx"
|
||||
).read_text(encoding="utf-8")
|
||||
|
||||
assert 'aria-label={`Open ${item.label}: ${item.description}`}' in app
|
||||
assert 'aria-label={`Ga naar ${item.label}`}' in app
|
||||
assert 'aria-label={`Open ${item.label}: ${item.description}`}' in navigation
|
||||
assert "title={item.description}" in navigation
|
||||
assert "aria-current={item.key === activeWorkspace ? 'page' : undefined}" in navigation
|
||||
assert "label: 'Bronnen'" in app
|
||||
assert "label: 'Kaart'" in app
|
||||
assert "label: 'Kwaliteit'" in app
|
||||
|
||||
@@ -8,32 +8,45 @@ ROOT = Path(__file__).resolve().parents[2]
|
||||
|
||||
def test_workbench_shell_has_skip_link_and_main_focus_target() -> None:
|
||||
app = (ROOT / "frontend" / "src" / "App.tsx").read_text(encoding="utf-8")
|
||||
navigation = (
|
||||
ROOT
|
||||
/ "frontend"
|
||||
/ "src"
|
||||
/ "components"
|
||||
/ "shell"
|
||||
/ "WorkbenchNavigation.tsx"
|
||||
).read_text(encoding="utf-8")
|
||||
|
||||
assert 'className="skip-link"' in app
|
||||
assert 'href="#workspace-main"' in app
|
||||
assert 'nav aria-label="Hoofdonderdelen"' in app
|
||||
assert '<nav aria-label="Hoofdonderdelen">' in navigation
|
||||
assert 'id="workspace-main"' in app
|
||||
assert "tabIndex={-1}" in app
|
||||
|
||||
|
||||
def test_mobile_shell_density_contracts_are_defined() -> None:
|
||||
css = (ROOT / "frontend" / "src" / "styles" / "app.css").read_text(encoding="utf-8")
|
||||
atlas = (ROOT / "frontend" / "src" / "styles" / "atlas-workbench.css").read_text(
|
||||
encoding="utf-8"
|
||||
)
|
||||
|
||||
assert ".skip-link" in css
|
||||
assert ".skip-link:focus-visible" in css
|
||||
assert "scroll-margin-top: 8.5rem;" in css
|
||||
assert "grid-template-columns: repeat(4, minmax(6.75rem, 1fr));" in css
|
||||
assert "overflow-x: auto;" in css
|
||||
assert "scroll-snap-type: x proximity;" in css
|
||||
assert "white-space: nowrap;" in css
|
||||
assert "@media (max-width: 920px)" in atlas
|
||||
assert "overflow-x: auto;" in atlas
|
||||
assert "flex: 0 0 4.4rem;" in atlas
|
||||
assert "white-space: nowrap;" in atlas
|
||||
assert ".context-bar,\n .quick-action-grid,\n .workspace-nav-cluster" not in css
|
||||
|
||||
|
||||
def test_small_screen_navigation_keeps_labels_readable() -> None:
|
||||
css = (ROOT / "frontend" / "src" / "styles" / "app.css").read_text(encoding="utf-8")
|
||||
css = (ROOT / "frontend" / "src" / "styles" / "atlas-workbench.css").read_text(
|
||||
encoding="utf-8"
|
||||
)
|
||||
|
||||
assert "@media (max-width: 620px)" in css
|
||||
assert "@media (max-width: 560px)" in css
|
||||
assert ".workbench-sidebar .nav-item" in css
|
||||
assert "min-width: 9.5rem;" in css
|
||||
assert ".nav-item small" in css
|
||||
assert "line-height: 1.18;" in css
|
||||
assert "min-width: 4.4rem;" in css
|
||||
assert ".nav-item-icon" in css
|
||||
assert "text-overflow: ellipsis;" in css
|
||||
|
||||
Reference in New Issue
Block a user