Skip to content

Commit 3b4c8a5

Browse files
committed
aa
1 parent 6926596 commit 3b4c8a5

20 files changed

Lines changed: 1221 additions & 118 deletions

frontend/src/api/client.ts

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,28 @@ export const api = {
134134
method: "PUT",
135135
body: JSON.stringify(body)
136136
}),
137+
listDirectives: (id: string) =>
138+
request<DirectivesListResponse>(
139+
`/api/projects/${encodeURIComponent(id)}/directives/list`
140+
),
141+
createDirective: (id: string, text: string) =>
142+
request<DirectiveItem>(`/api/projects/${encodeURIComponent(id)}/directives`, {
143+
method: "POST",
144+
body: JSON.stringify({ text })
145+
}),
146+
reopenDirective: (id: string, directiveId: string) =>
147+
request<DirectiveItem>(
148+
`/api/projects/${encodeURIComponent(id)}/directives/${encodeURIComponent(directiveId)}`,
149+
{
150+
method: "PATCH",
151+
body: JSON.stringify({ reopen: true })
152+
}
153+
),
154+
deleteDirective: (id: string, directiveId: string) =>
155+
request<unknown>(
156+
`/api/projects/${encodeURIComponent(id)}/directives/${encodeURIComponent(directiveId)}`,
157+
{ method: "DELETE" }
158+
),
137159
getPaperDiff: (id: string, iterationNumber: number) =>
138160
request<PaperDiffResponse>(
139161
`/api/projects/${encodeURIComponent(id)}/iterations/${iterationNumber}/paper.diff`
@@ -286,3 +308,17 @@ export interface ArchitectureValidation {
286308
is_runnable: boolean;
287309
issues: ArchitectureValidationIssue[];
288310
}
311+
312+
export interface DirectiveItem {
313+
id: string;
314+
raw_text: string;
315+
source: string;
316+
created_at: string;
317+
addressed_in_iteration: number | null;
318+
iteration_id: number | null;
319+
}
320+
321+
export interface DirectivesListResponse {
322+
pending: DirectiveItem[];
323+
addressed: DirectiveItem[];
324+
}

frontend/src/api/queries.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ export const queryKeys = {
99
paper: (id: string) => ["paper", id] as const,
1010
paperStatus: (id: string) => ["paperStatus", id] as const,
1111
directives: (id: string) => ["directives", id] as const,
12+
directivesList: (id: string) => ["directivesList", id] as const,
1213
architecture: (id: string) => ["architecture", id] as const,
1314
threads: (id: string) => ["threads", id] as const,
1415
artifacts: (id: string, iter?: number) => ["artifacts", id, iter] as const,
@@ -70,6 +71,15 @@ export function useDirectives(id: string | null) {
7071
});
7172
}
7273

74+
export function useDirectivesList(id: string | null) {
75+
return useQuery({
76+
queryKey: id ? queryKeys.directivesList(id) : ["directivesList", "_none"],
77+
queryFn: () => api.listDirectives(id as string),
78+
enabled: !!id,
79+
refetchInterval: 6000
80+
});
81+
}
82+
7383
export function useArchitecture(id: string | null) {
7484
return useQuery({
7585
queryKey: id ? queryKeys.architecture(id) : ["architecture", "_none"],

frontend/src/styles.css

Lines changed: 183 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1035,13 +1035,170 @@ button {
10351035
.paperHeader {
10361036
display: flex;
10371037
justify-content: space-between;
1038-
align-items: baseline;
1038+
align-items: center;
10391039
padding: 0 4px;
1040+
gap: 12px;
10401041
}
10411042

10421043
.paperMeta {
10431044
font-size: 11px;
10441045
color: #5b5142;
1046+
flex: 1;
1047+
}
1048+
1049+
.paperViewToggle {
1050+
display: flex;
1051+
gap: 4px;
1052+
border: 1px solid #b59c66;
1053+
border-radius: 4px;
1054+
padding: 2px;
1055+
background: #f8f0d4;
1056+
}
1057+
1058+
.paperViewToggle button {
1059+
display: inline-flex;
1060+
align-items: center;
1061+
gap: 4px;
1062+
border: none;
1063+
background: transparent;
1064+
font-size: 11px;
1065+
padding: 3px 8px;
1066+
border-radius: 3px;
1067+
cursor: pointer;
1068+
color: #5b5142;
1069+
}
1070+
1071+
.paperViewToggle button.active {
1072+
background: #fffaf0;
1073+
color: #1f1d1a;
1074+
font-weight: 600;
1075+
}
1076+
1077+
.paperPdfWrapper {
1078+
flex: 1;
1079+
min-height: 480px;
1080+
display: flex;
1081+
flex-direction: column;
1082+
}
1083+
1084+
.paperPdfFrame {
1085+
flex: 1;
1086+
width: 100%;
1087+
border: 1px solid #b59c66;
1088+
border-radius: 4px;
1089+
background: #fffaf0;
1090+
min-height: 480px;
1091+
}
1092+
1093+
.directivesInbox {
1094+
display: flex;
1095+
flex-direction: column;
1096+
gap: 12px;
1097+
padding: 4px;
1098+
}
1099+
1100+
.directivesAdd {
1101+
display: flex;
1102+
gap: 8px;
1103+
align-items: stretch;
1104+
background: #fff8e9;
1105+
border: 1px solid #b59c66;
1106+
border-radius: 6px;
1107+
padding: 8px;
1108+
}
1109+
1110+
.directivesAdd textarea {
1111+
flex: 1;
1112+
resize: vertical;
1113+
font-family: inherit;
1114+
font-size: 13px;
1115+
border: 1px solid #d8c89a;
1116+
border-radius: 4px;
1117+
padding: 6px 8px;
1118+
background: #fffaf0;
1119+
color: #1f1d1a;
1120+
}
1121+
1122+
.directivesAdd button {
1123+
align-self: flex-start;
1124+
white-space: nowrap;
1125+
}
1126+
1127+
.directivesPending h3,
1128+
.directivesAddressed summary {
1129+
font-size: 13px;
1130+
font-weight: 600;
1131+
color: #3b332c;
1132+
margin: 0 0 6px 0;
1133+
display: flex;
1134+
align-items: center;
1135+
gap: 6px;
1136+
cursor: pointer;
1137+
}
1138+
1139+
.directivesAddressed summary {
1140+
list-style: none;
1141+
}
1142+
1143+
.directivesAddressed summary::-webkit-details-marker {
1144+
display: none;
1145+
}
1146+
1147+
.directivesAddressed[open] summary::before {
1148+
content: "▼ ";
1149+
font-size: 9px;
1150+
}
1151+
1152+
.directivesAddressed summary::before {
1153+
content: "▶ ";
1154+
font-size: 9px;
1155+
}
1156+
1157+
.directiveRow {
1158+
display: flex;
1159+
flex-direction: column;
1160+
gap: 4px;
1161+
border: 1px solid #d8c89a;
1162+
border-radius: 4px;
1163+
padding: 8px 10px;
1164+
margin-bottom: 6px;
1165+
font-size: 12px;
1166+
background: #fffaf0;
1167+
}
1168+
1169+
.directiveRow.pending {
1170+
border-color: #b59c66;
1171+
}
1172+
1173+
.directiveRow.addressed {
1174+
background: #f6efde;
1175+
color: #6b5b41;
1176+
}
1177+
1178+
.directiveBody {
1179+
white-space: pre-wrap;
1180+
line-height: 1.45;
1181+
}
1182+
1183+
.directiveMeta {
1184+
display: flex;
1185+
align-items: center;
1186+
gap: 8px;
1187+
font-size: 10px;
1188+
color: #6b5b41;
1189+
}
1190+
1191+
.directiveBadge {
1192+
background: #d0e8d4;
1193+
color: #1b4d22;
1194+
padding: 1px 6px;
1195+
border-radius: 3px;
1196+
font-weight: 600;
1197+
}
1198+
1199+
.directiveMeta .iconButton {
1200+
margin-left: auto;
1201+
padding: 2px 4px;
10451202
}
10461203

10471204
.paperLocks {
@@ -1223,7 +1380,7 @@ button {
12231380
color: #6b1f10;
12241381
}
12251382

1226-
.constructionStatus {
1383+
.outstandingPanel {
12271384
border: 1px solid #b59c66;
12281385
border-radius: 6px;
12291386
padding: 10px 12px;
@@ -1235,7 +1392,7 @@ button {
12351392
gap: 6px;
12361393
}
12371394

1238-
.constructionStatus.clean {
1395+
.outstandingPanel.clean {
12391396
background: #ecf8ee;
12401397
border-color: #2e7d32;
12411398
color: #1f4a23;
@@ -1244,28 +1401,28 @@ button {
12441401
gap: 8px;
12451402
}
12461403

1247-
.constructionStatus header {
1404+
.outstandingPanel header {
12481405
display: flex;
12491406
gap: 6px;
12501407
align-items: center;
12511408
}
12521409

1253-
.constructionStatus details {
1410+
.outstandingPanel details {
12541411
background: #fff;
12551412
border: 1px solid #d8c89a;
12561413
border-radius: 4px;
12571414
padding: 4px 8px;
12581415
}
12591416

1260-
.constructionStatus summary {
1417+
.outstandingPanel summary {
12611418
cursor: pointer;
12621419
display: flex;
12631420
gap: 8px;
12641421
align-items: center;
12651422
font-weight: 600;
12661423
}
12671424

1268-
.constructionStatus ul {
1425+
.outstandingPanel ul {
12691426
list-style: none;
12701427
padding-left: 0;
12711428
margin: 6px 0 0 0;
@@ -1274,35 +1431,35 @@ button {
12741431
gap: 4px;
12751432
}
12761433

1277-
.constructionStatus li {
1434+
.outstandingPanel li {
12781435
display: flex;
12791436
flex-wrap: wrap;
12801437
gap: 6px;
12811438
align-items: baseline;
12821439
}
12831440

1284-
.constructionStatus code {
1441+
.outstandingPanel code {
12851442
font-size: 10px;
12861443
background: #efe3c0;
12871444
padding: 1px 4px;
12881445
border-radius: 3px;
12891446
}
12901447

1291-
.constructionWhat {
1448+
.outstandingWhat {
12921449
flex: 1 1 auto;
12931450
min-width: 0;
12941451
}
12951452

1296-
.constructionNeeds,
1297-
.constructionBlocker {
1453+
.outstandingNeeds,
1454+
.outstandingBlocker {
12981455
font-style: italic;
12991456
font-size: 11px;
13001457
}
13011458

1302-
.constructionNeeds { color: #4a6b1f; }
1303-
.constructionBlocker { color: #8c2a17; }
1459+
.outstandingNeeds { color: #4a6b1f; }
1460+
.outstandingBlocker { color: #8c2a17; }
13041461

1305-
.constructionTypeBadge {
1462+
.outstandingTypeBadge {
13061463
text-transform: uppercase;
13071464
font-size: 10px;
13081465
padding: 1px 6px;
@@ -1311,14 +1468,14 @@ button {
13111468
letter-spacing: 0.04em;
13121469
}
13131470

1314-
.constructionTypeBadge.t-data { background: #c62828; }
1315-
.constructionTypeBadge.t-figure { background: #1565c0; }
1316-
.constructionTypeBadge.t-table { background: #6a1b9a; }
1317-
.constructionTypeBadge.t-human { background: #ef6c00; }
1318-
.constructionTypeBadge.t-derive { background: #2e7d32; }
1319-
.constructionTypeBadge.t-other { background: #546e7a; }
1471+
.outstandingTypeBadge.t-data { background: #c62828; }
1472+
.outstandingTypeBadge.t-figure { background: #1565c0; }
1473+
.outstandingTypeBadge.t-table { background: #6a1b9a; }
1474+
.outstandingTypeBadge.t-human { background: #ef6c00; }
1475+
.outstandingTypeBadge.t-derive { background: #2e7d32; }
1476+
.outstandingTypeBadge.t-other { background: #546e7a; }
13201477

1321-
.constructionNotes pre {
1478+
.outstandingNotes pre {
13221479
background: #f6efde;
13231480
padding: 4px 6px;
13241481
border-radius: 3px;
@@ -1327,7 +1484,7 @@ button {
13271484
margin: 4px 0 0 0;
13281485
}
13291486

1330-
.constructionNoteKind {
1487+
.outstandingNoteKind {
13311488
font-size: 10px;
13321489
font-weight: 600;
13331490
padding: 1px 4px;
@@ -1336,9 +1493,9 @@ button {
13361493
color: #263238;
13371494
}
13381495

1339-
.constructionNoteKind.k-blocker { background: #ffcdd2; color: #b71c1c; }
1340-
.constructionNoteKind.k-decision { background: #fff3c4; color: #6f4c00; }
1341-
.constructionNoteKind.k-rationale { background: #d0e8d4; color: #1b4d22; }
1496+
.outstandingNoteKind.k-blocker { background: #ffcdd2; color: #b71c1c; }
1497+
.outstandingNoteKind.k-decision { background: #fff3c4; color: #6f4c00; }
1498+
.outstandingNoteKind.k-rationale { background: #d0e8d4; color: #1b4d22; }
13421499

13431500
.archValidation {
13441501
margin-top: 10px;

0 commit comments

Comments
 (0)