From 3179a9cfd4ed0cdd5bb1f0b77c41cdc6d295b847 Mon Sep 17 00:00:00 2001 From: Cyber-preacher Date: Tue, 20 Jan 2026 14:18:15 +0400 Subject: [PATCH] feat(web): finish Hono migration alignment and cleanup legacy routes drop legacy /app redirect shim and old top-level routes align proposal stage labels, chips, and filters to pool/vote/build keep proposal draft flow intact while syncing API DTOs --- src/app/AppRoutes.tsx | 46 +---------------------- src/components/ProposalStageBar.tsx | 8 ++-- src/components/StageChip.tsx | 3 -- src/pages/proposals/ProposalChamber.tsx | 2 +- src/pages/proposals/ProposalFormation.tsx | 2 +- src/pages/proposals/Proposals.tsx | 2 - src/types/api.ts | 17 +-------- src/types/stages.ts | 20 +--------- 8 files changed, 11 insertions(+), 89 deletions(-) diff --git a/src/app/AppRoutes.tsx b/src/app/AppRoutes.tsx index 0ddd52f..3c2e054 100644 --- a/src/app/AppRoutes.tsx +++ b/src/app/AppRoutes.tsx @@ -1,4 +1,4 @@ -import { Navigate, Outlet, Route, Routes, useLocation } from "react-router"; +import { Navigate, Outlet, Route, Routes } from "react-router"; import AppShell from "./AppShell"; import HumanNodes from "../pages/human-nodes/HumanNodes"; import Proposals from "../pages/proposals/Proposals"; @@ -28,18 +28,6 @@ import Landing from "../pages/Landing"; import Paper from "../pages/Paper"; import Guide from "../pages/Guide"; -// Backwards-compat redirects for old app URLs (pre `/app` split). -// Safe to delete once you no longer need to support old bookmarks/links. -const LegacyToAppRedirect: React.FC = () => { - const location = useLocation(); - return ( - - ); -}; - const AppRoutes: React.FC = () => { return ( @@ -81,38 +69,6 @@ const AppRoutes: React.FC = () => { } /> - {/* Legacy redirects (old app URLs -> /app/*). */} - } /> - } /> - } /> - } /> - } /> - } /> - } - /> - } /> - } /> - } /> - } /> - } /> - } /> - } /> - } /> - } /> - } - /> - } /> - } /> - } /> - } /> - } /> - } /> - } /> - } /> ); diff --git a/src/components/ProposalStageBar.tsx b/src/components/ProposalStageBar.tsx index 6bf5bef..0e5f7db 100644 --- a/src/components/ProposalStageBar.tsx +++ b/src/components/ProposalStageBar.tsx @@ -1,7 +1,7 @@ import React from "react"; import { HintLabel } from "@/components/Hint"; -export type ProposalStage = "draft" | "pool" | "chamber" | "formation"; +export type ProposalStage = "draft" | "pool" | "vote" | "build"; type ProposalStageBarProps = { current: ProposalStage; @@ -24,12 +24,12 @@ export const ProposalStageBar: React.FC = ({ render: Proposal pool, }, { - key: "chamber", + key: "vote", label: "Chamber vote", render: Chamber vote, }, { - key: "formation", + key: "build", label: "Formation", render: Formation, }, @@ -44,7 +44,7 @@ export const ProposalStageBar: React.FC = ({ ? "bg-panel text-text border border-border shadow-[var(--shadow-control)] ring-1 ring-inset ring-[color:var(--glass-border)]" : stage.key === "pool" ? "bg-primary text-[var(--primary-foreground)]" - : stage.key === "chamber" + : stage.key === "vote" ? "bg-[var(--accent)] text-[var(--accent-foreground)]" : "bg-[var(--accent-warm)] text-[var(--text)]"; return ( diff --git a/src/components/StageChip.tsx b/src/components/StageChip.tsx index c46ed1c..6c9cd16 100644 --- a/src/components/StageChip.tsx +++ b/src/components/StageChip.tsx @@ -16,9 +16,6 @@ const chipClasses: Record = { thread: "bg-panel-alt text-muted", courts: "bg-[color:var(--accent-warm)]/15 text-[var(--accent-warm)]", faction: "bg-panel-alt text-muted", - draft: "bg-panel-alt text-muted", - final: "bg-[color:var(--accent)]/15 text-[var(--accent)]", - archived: "bg-panel-alt text-muted", }; const hintByKind: Partial> = { diff --git a/src/pages/proposals/ProposalChamber.tsx b/src/pages/proposals/ProposalChamber.tsx index a8c93b8..e40f8e5 100644 --- a/src/pages/proposals/ProposalChamber.tsx +++ b/src/pages/proposals/ProposalChamber.tsx @@ -136,7 +136,7 @@ const ProposalChamber: React.FC = () => { diff --git a/src/pages/proposals/ProposalFormation.tsx b/src/pages/proposals/ProposalFormation.tsx index 13e43e1..a1e307a 100644 --- a/src/pages/proposals/ProposalFormation.tsx +++ b/src/pages/proposals/ProposalFormation.tsx @@ -124,7 +124,7 @@ const ProposalFormation: React.FC = () => { diff --git a/src/pages/proposals/Proposals.tsx b/src/pages/proposals/Proposals.tsx index 26f8959..0f1fe9d 100644 --- a/src/pages/proposals/Proposals.tsx +++ b/src/pages/proposals/Proposals.tsx @@ -193,8 +193,6 @@ const Proposals: React.FC = () => { { value: "pool", label: "Proposal pool" }, { value: "vote", label: "Chamber vote" }, { value: "build", label: "Formation" }, - { value: "final", label: "Final vote" }, - { value: "archived", label: "Archived" }, ], }, { diff --git a/src/types/api.ts b/src/types/api.ts index 8abc2a3..dab32b8 100644 --- a/src/types/api.ts +++ b/src/types/api.ts @@ -3,7 +3,7 @@ import type { FeedStage } from "./stages"; -export type ProposalStageDto = "draft" | "pool" | "vote" | "build"; +export type ProposalStageDto = "pool" | "vote" | "build"; export type FeedStageDto = FeedStage; export type ToneDto = "ok" | "warn"; @@ -219,20 +219,7 @@ export type GetProposalsResponse = { items: ProposalListItemDto[] }; export type InvisionInsightDto = { role: string; bullets: string[] }; -export type ProposalTimelineEventTypeDto = - | "proposal.submitted" - | "proposal.stage.advanced" - | "proposal.vote.passed" - | "proposal.vote.finalized" - | "pool.vote" - | "chamber.vote" - | "veto.vote" - | "veto.applied" - | "formation.join" - | "formation.milestone.submitted" - | "formation.milestone.unlockRequested" - | "chamber.created" - | "chamber.dissolved"; +export type ProposalTimelineEventTypeDto = string; export type ProposalTimelineItemDto = { id: string; diff --git a/src/types/stages.ts b/src/types/stages.ts index 3c23597..23c51d1 100644 --- a/src/types/stages.ts +++ b/src/types/stages.ts @@ -1,11 +1,4 @@ -export const proposalStages = [ - "draft", - "pool", - "vote", - "build", - "final", - "archived", -] as const; +export const proposalStages = ["pool", "vote", "build"] as const; export type ProposalStage = (typeof proposalStages)[number]; @@ -28,30 +21,21 @@ export type StageChipKind = | "formation" | "thread" | "courts" - | "faction" - | "draft" - | "final" - | "archived"; + | "faction"; export const stageToChipKind = { - draft: "draft", pool: "proposal_pool", vote: "chamber_vote", build: "formation", - final: "final", - archived: "archived", thread: "thread", courts: "courts", faction: "faction", } as const satisfies Record; export const stageLabel = { - draft: "Draft", pool: "Proposal pool", vote: "Chamber vote", build: "Formation", - final: "Final vote", - archived: "Archived", thread: "Thread", courts: "Courts", faction: "Faction",