tycono 0.1.96-beta.26 → 0.1.96-beta.27
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
package/src/tui/app.tsx
CHANGED
|
@@ -244,7 +244,7 @@ export const App: React.FC = () => {
|
|
|
244
244
|
const roles = api.company?.roles ?? [];
|
|
245
245
|
const statuses = api.execStatus?.statuses ?? {};
|
|
246
246
|
const orgTree = useMemo(() => buildOrgTree(roles, statuses), [roles, statuses]);
|
|
247
|
-
const flatRoleIds = useMemo(() => flattenOrgRoleIds(orgTree), [orgTree]);
|
|
247
|
+
const flatRoleIds = useMemo(() => ['ceo', ...flattenOrgRoleIds(orgTree)], [orgTree]);
|
|
248
248
|
|
|
249
249
|
// Active count
|
|
250
250
|
const activeCount = Object.values(statuses).filter(
|
|
@@ -426,11 +426,11 @@ export const App: React.FC = () => {
|
|
|
426
426
|
focusedWaveId={focusedWaveId}
|
|
427
427
|
portSummary={api.portSummary}
|
|
428
428
|
onMove={(dir) => {
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
429
|
+
const nextIdx = dir === 'up'
|
|
430
|
+
? Math.max(0, selectedRoleIndex - 1)
|
|
431
|
+
: Math.min(flatRoleIds.length - 1, selectedRoleIndex + 1);
|
|
432
|
+
setSelectedRoleIndex(nextIdx);
|
|
433
|
+
setSelectedRoleId(flatRoleIds[nextIdx] ?? null);
|
|
434
434
|
}}
|
|
435
435
|
onSelect={() => {
|
|
436
436
|
const roleId = flatRoleIds[selectedRoleIndex] ?? null;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* OrgTree — left panel showing organization hierarchy with real-time status
|
|
3
|
+
* CEO is now selectable (index 0 in flatRoles)
|
|
3
4
|
*/
|
|
4
5
|
|
|
5
6
|
import React from 'react';
|
|
@@ -12,6 +13,7 @@ interface OrgTreeProps {
|
|
|
12
13
|
focused: boolean;
|
|
13
14
|
selectedIndex: number;
|
|
14
15
|
flatRoles: string[];
|
|
16
|
+
ceoStatus?: string;
|
|
15
17
|
}
|
|
16
18
|
|
|
17
19
|
function statusColor(status: string): string {
|
|
@@ -46,10 +48,10 @@ function flattenTree(nodes: OrgNode[], prefix: string = '', isLast: boolean[] =
|
|
|
46
48
|
|
|
47
49
|
let linePrefix = '';
|
|
48
50
|
for (let j = 0; j < isLast.length; j++) {
|
|
49
|
-
linePrefix += isLast[j] ? ' ' : '
|
|
51
|
+
linePrefix += isLast[j] ? ' ' : '\u2502 ';
|
|
50
52
|
}
|
|
51
53
|
linePrefix += isLast.length > 0 || i > 0 || nodes.length > 1
|
|
52
|
-
? (last ? '
|
|
54
|
+
? (last ? '\u2514\u2500 ' : '\u251C\u2500 ')
|
|
53
55
|
: '';
|
|
54
56
|
|
|
55
57
|
result.push({
|
|
@@ -67,14 +69,24 @@ function flattenTree(nodes: OrgNode[], prefix: string = '', isLast: boolean[] =
|
|
|
67
69
|
return result;
|
|
68
70
|
}
|
|
69
71
|
|
|
70
|
-
export const OrgTree: React.FC<OrgTreeProps> = React.memo(({ tree, focused, selectedIndex, flatRoles }) => {
|
|
72
|
+
export const OrgTree: React.FC<OrgTreeProps> = React.memo(({ tree, focused, selectedIndex, flatRoles, ceoStatus }) => {
|
|
71
73
|
const entries = flattenTree(tree);
|
|
74
|
+
const isCeoSelected = focused && flatRoles[selectedIndex] === 'ceo';
|
|
75
|
+
const ceoIcon = statusIcon(ceoStatus ?? 'idle');
|
|
76
|
+
const ceoColor = statusColor(ceoStatus ?? 'idle');
|
|
72
77
|
|
|
73
78
|
return (
|
|
74
79
|
<Box flexDirection="column" paddingX={1}>
|
|
75
|
-
<Text bold color={focused ? 'cyan' : 'gray'}>{'
|
|
80
|
+
<Text bold color={focused ? 'cyan' : 'gray'}>{'\u2500\u2500 Org Tree \u2500\u2500'}</Text>
|
|
76
81
|
<Box marginTop={1}>
|
|
77
|
-
<Text color=
|
|
82
|
+
<Text color={ceoColor} bold={ceoStatus === 'working'}>{ceoIcon} </Text>
|
|
83
|
+
<Text
|
|
84
|
+
color={isCeoSelected ? 'cyan' : 'yellow'}
|
|
85
|
+
bold={isCeoSelected}
|
|
86
|
+
inverse={isCeoSelected}
|
|
87
|
+
>
|
|
88
|
+
CEO
|
|
89
|
+
</Text>
|
|
78
90
|
</Box>
|
|
79
91
|
{entries.map((entry, i) => {
|
|
80
92
|
const isSelected = focused && flatRoles[selectedIndex] === entry.roleId;
|
|
@@ -130,6 +130,7 @@ export const PanelMode: React.FC<PanelModeProps> = ({
|
|
|
130
130
|
focused={true}
|
|
131
131
|
selectedIndex={selectedRoleIndex}
|
|
132
132
|
flatRoles={flatRoles}
|
|
133
|
+
ceoStatus={activeSessions.some(s => s.roleId === 'ceo' && s.status === 'active') ? 'working' : 'idle'}
|
|
133
134
|
/>
|
|
134
135
|
</Box>
|
|
135
136
|
|