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
46 changes: 1 addition & 45 deletions src/app/AppRoutes.tsx
Original file line number Diff line number Diff line change
@@ -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";
Expand Down Expand Up @@ -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 (
<Navigate
to={`/app${location.pathname}${location.search}${location.hash}`}
replace
/>
);
};

const AppRoutes: React.FC = () => {
return (
<Routes>
Expand Down Expand Up @@ -81,38 +69,6 @@ const AppRoutes: React.FC = () => {
<Route path="my-governance" element={<MyGovernance />} />
</Route>

{/* Legacy redirects (old app URLs -> /app/*). */}
<Route path="/feed" element={<LegacyToAppRedirect />} />
<Route path="/profile" element={<LegacyToAppRedirect />} />
<Route path="/factions" element={<LegacyToAppRedirect />} />
<Route path="/factions/:id" element={<LegacyToAppRedirect />} />
<Route path="/human-nodes" element={<LegacyToAppRedirect />} />
<Route path="/human-nodes/:id" element={<LegacyToAppRedirect />} />
<Route
path="/human-nodes/:id/history"
element={<LegacyToAppRedirect />}
/>
<Route path="/courts" element={<LegacyToAppRedirect />} />
<Route path="/courts/:id" element={<LegacyToAppRedirect />} />
<Route path="/cm" element={<LegacyToAppRedirect />} />
<Route path="/proposals" element={<LegacyToAppRedirect />} />
<Route path="/proposals/drafts" element={<LegacyToAppRedirect />} />
<Route path="/proposals/drafts/:id" element={<LegacyToAppRedirect />} />
<Route path="/proposals/new" element={<LegacyToAppRedirect />} />
<Route path="/proposals/:id/pp" element={<LegacyToAppRedirect />} />
<Route path="/proposals/:id/chamber" element={<LegacyToAppRedirect />} />
<Route
path="/proposals/:id/formation"
element={<LegacyToAppRedirect />}
/>
<Route path="/chambers" element={<LegacyToAppRedirect />} />
<Route path="/chambers/:id" element={<LegacyToAppRedirect />} />
<Route path="/formation" element={<LegacyToAppRedirect />} />
<Route path="/invision" element={<LegacyToAppRedirect />} />
<Route path="/vortexopedia" element={<LegacyToAppRedirect />} />
<Route path="/settings" element={<LegacyToAppRedirect />} />
<Route path="/my-governance" element={<LegacyToAppRedirect />} />

<Route path="*" element={<Navigate to="/" replace />} />
</Routes>
);
Expand Down
8 changes: 4 additions & 4 deletions src/components/ProposalStageBar.tsx
Original file line number Diff line number Diff line change
@@ -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;
Expand All @@ -24,12 +24,12 @@ export const ProposalStageBar: React.FC<ProposalStageBarProps> = ({
render: <HintLabel termId="proposal_pools">Proposal pool</HintLabel>,
},
{
key: "chamber",
key: "vote",
label: "Chamber vote",
render: <HintLabel termId="chamber_vote">Chamber vote</HintLabel>,
},
{
key: "formation",
key: "build",
label: "Formation",
render: <HintLabel termId="formation">Formation</HintLabel>,
},
Expand All @@ -44,7 +44,7 @@ export const ProposalStageBar: React.FC<ProposalStageBarProps> = ({
? "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 (
Expand Down
3 changes: 0 additions & 3 deletions src/components/StageChip.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,6 @@ const chipClasses: Record<StageChipKind, string> = {
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<Record<StageChipKind, string>> = {
Expand Down
2 changes: 1 addition & 1 deletion src/pages/proposals/ProposalChamber.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ const ProposalChamber: React.FC = () => {
<PageHint pageId="proposals" />
<ProposalPageHeader
title={proposal.title}
stage="chamber"
stage="vote"
chamber={proposal.chamber}
proposer={proposal.proposer}
>
Expand Down
2 changes: 1 addition & 1 deletion src/pages/proposals/ProposalFormation.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ const ProposalFormation: React.FC = () => {
<PageHint pageId="proposals" />
<ProposalPageHeader
title={project.title}
stage="formation"
stage="build"
chamber={project.chamber}
proposer={project.proposer}
/>
Expand Down
2 changes: 0 additions & 2 deletions src/pages/proposals/Proposals.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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" },
],
},
{
Expand Down
17 changes: 2 additions & 15 deletions src/types/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down Expand Up @@ -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;
Expand Down
20 changes: 2 additions & 18 deletions src/types/stages.ts
Original file line number Diff line number Diff line change
@@ -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];

Expand All @@ -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<Stage, StageChipKind>;

export const stageLabel = {
draft: "Draft",
pool: "Proposal pool",
vote: "Chamber vote",
build: "Formation",
final: "Final vote",
archived: "Archived",
thread: "Thread",
courts: "Courts",
faction: "Faction",
Expand Down