@knpkv/codecommit 0.1.0
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/README.md +216 -0
- package/dist/package.json +50 -0
- package/dist/src/bin.d.ts +3 -0
- package/dist/src/bin.d.ts.map +1 -0
- package/dist/src/bin.js +204 -0
- package/dist/src/bin.js.map +1 -0
- package/dist/src/main.d.ts +2 -0
- package/dist/src/main.d.ts.map +1 -0
- package/dist/src/main.js +25 -0
- package/dist/src/main.js.map +1 -0
- package/dist/src/tui/App.d.ts +6 -0
- package/dist/src/tui/App.d.ts.map +1 -0
- package/dist/src/tui/App.js +40 -0
- package/dist/src/tui/App.js.map +1 -0
- package/dist/src/tui/Constants.d.ts +11 -0
- package/dist/src/tui/Constants.d.ts.map +1 -0
- package/dist/src/tui/Constants.js +40 -0
- package/dist/src/tui/Constants.js.map +1 -0
- package/dist/src/tui/ListBuilder.d.ts +32 -0
- package/dist/src/tui/ListBuilder.d.ts.map +1 -0
- package/dist/src/tui/ListBuilder.js +145 -0
- package/dist/src/tui/ListBuilder.js.map +1 -0
- package/dist/src/tui/atoms/actions.d.ts +39 -0
- package/dist/src/tui/atoms/actions.d.ts.map +1 -0
- package/dist/src/tui/atoms/actions.js +149 -0
- package/dist/src/tui/atoms/actions.js.map +1 -0
- package/dist/src/tui/atoms/app.d.ts +42 -0
- package/dist/src/tui/atoms/app.d.ts.map +1 -0
- package/dist/src/tui/atoms/app.js +69 -0
- package/dist/src/tui/atoms/app.js.map +1 -0
- package/dist/src/tui/atoms/index.d.ts +6 -0
- package/dist/src/tui/atoms/index.d.ts.map +1 -0
- package/dist/src/tui/atoms/index.js +7 -0
- package/dist/src/tui/atoms/index.js.map +1 -0
- package/dist/src/tui/atoms/runtime.d.ts +9 -0
- package/dist/src/tui/atoms/runtime.d.ts.map +1 -0
- package/dist/src/tui/atoms/runtime.js +22 -0
- package/dist/src/tui/atoms/runtime.js.map +1 -0
- package/dist/src/tui/atoms/ui.d.ts +103 -0
- package/dist/src/tui/atoms/ui.d.ts.map +1 -0
- package/dist/src/tui/atoms/ui.js +97 -0
- package/dist/src/tui/atoms/ui.js.map +1 -0
- package/dist/src/tui/components/Badge.d.ts +13 -0
- package/dist/src/tui/components/Badge.d.ts.map +1 -0
- package/dist/src/tui/components/Badge.js +48 -0
- package/dist/src/tui/components/Badge.js.map +1 -0
- package/dist/src/tui/components/DetailsView.d.ts +6 -0
- package/dist/src/tui/components/DetailsView.d.ts.map +1 -0
- package/dist/src/tui/components/DetailsView.js +81 -0
- package/dist/src/tui/components/DetailsView.js.map +1 -0
- package/dist/src/tui/components/ErrorBoundary.d.ts +20 -0
- package/dist/src/tui/components/ErrorBoundary.d.ts.map +1 -0
- package/dist/src/tui/components/ErrorBoundary.js +33 -0
- package/dist/src/tui/components/ErrorBoundary.js.map +1 -0
- package/dist/src/tui/components/Footer.d.ts +6 -0
- package/dist/src/tui/components/Footer.d.ts.map +1 -0
- package/dist/src/tui/components/Footer.js +29 -0
- package/dist/src/tui/components/Footer.js.map +1 -0
- package/dist/src/tui/components/Header.d.ts +6 -0
- package/dist/src/tui/components/Header.d.ts.map +1 -0
- package/dist/src/tui/components/Header.js +58 -0
- package/dist/src/tui/components/Header.js.map +1 -0
- package/dist/src/tui/components/ListItemRow.d.ts +13 -0
- package/dist/src/tui/components/ListItemRow.d.ts.map +1 -0
- package/dist/src/tui/components/ListItemRow.js +52 -0
- package/dist/src/tui/components/ListItemRow.js.map +1 -0
- package/dist/src/tui/components/MainList.d.ts +11 -0
- package/dist/src/tui/components/MainList.d.ts.map +1 -0
- package/dist/src/tui/components/MainList.js +124 -0
- package/dist/src/tui/components/MainList.js.map +1 -0
- package/dist/src/tui/components/NotificationsTable.d.ts +12 -0
- package/dist/src/tui/components/NotificationsTable.d.ts.map +1 -0
- package/dist/src/tui/components/NotificationsTable.js +72 -0
- package/dist/src/tui/components/NotificationsTable.js.map +1 -0
- package/dist/src/tui/components/QuickFilters.d.ts +6 -0
- package/dist/src/tui/components/QuickFilters.d.ts.map +1 -0
- package/dist/src/tui/components/QuickFilters.js +74 -0
- package/dist/src/tui/components/QuickFilters.js.map +1 -0
- package/dist/src/tui/components/SettingsTable.d.ts +12 -0
- package/dist/src/tui/components/SettingsTable.d.ts.map +1 -0
- package/dist/src/tui/components/SettingsTable.js +62 -0
- package/dist/src/tui/components/SettingsTable.js.map +1 -0
- package/dist/src/tui/components/Spinner.d.ts +11 -0
- package/dist/src/tui/components/Spinner.d.ts.map +1 -0
- package/dist/src/tui/components/Spinner.js +24 -0
- package/dist/src/tui/components/Spinner.js.map +1 -0
- package/dist/src/tui/components/StatusRow.d.ts +11 -0
- package/dist/src/tui/components/StatusRow.d.ts.map +1 -0
- package/dist/src/tui/components/StatusRow.js +11 -0
- package/dist/src/tui/components/StatusRow.js.map +1 -0
- package/dist/src/tui/components/Table.d.ts +20 -0
- package/dist/src/tui/components/Table.d.ts.map +1 -0
- package/dist/src/tui/components/Table.js +38 -0
- package/dist/src/tui/components/Table.js.map +1 -0
- package/dist/src/tui/components/index.d.ts +14 -0
- package/dist/src/tui/components/index.d.ts.map +1 -0
- package/dist/src/tui/components/index.js +14 -0
- package/dist/src/tui/components/index.js.map +1 -0
- package/dist/src/tui/components/mainlist-utils.d.ts +22 -0
- package/dist/src/tui/components/mainlist-utils.d.ts.map +1 -0
- package/dist/src/tui/components/mainlist-utils.js +71 -0
- package/dist/src/tui/components/mainlist-utils.js.map +1 -0
- package/dist/src/tui/components/table-utils.d.ts +25 -0
- package/dist/src/tui/components/table-utils.d.ts.map +1 -0
- package/dist/src/tui/components/table-utils.js +25 -0
- package/dist/src/tui/components/table-utils.js.map +1 -0
- package/dist/src/tui/context/dialog.d.ts +32 -0
- package/dist/src/tui/context/dialog.d.ts.map +1 -0
- package/dist/src/tui/context/dialog.js +41 -0
- package/dist/src/tui/context/dialog.js.map +1 -0
- package/dist/src/tui/context/theme.d.ts +25 -0
- package/dist/src/tui/context/theme.d.ts.map +1 -0
- package/dist/src/tui/context/theme.js +31 -0
- package/dist/src/tui/context/theme.js.map +1 -0
- package/dist/src/tui/hooks/index.d.ts +2 -0
- package/dist/src/tui/hooks/index.d.ts.map +1 -0
- package/dist/src/tui/hooks/index.js +2 -0
- package/dist/src/tui/hooks/index.js.map +1 -0
- package/dist/src/tui/hooks/useKeyboardNav.d.ts +16 -0
- package/dist/src/tui/hooks/useKeyboardNav.d.ts.map +1 -0
- package/dist/src/tui/hooks/useKeyboardNav.js +429 -0
- package/dist/src/tui/hooks/useKeyboardNav.js.map +1 -0
- package/dist/src/tui/hooks/useListNavigation.d.ts +3 -0
- package/dist/src/tui/hooks/useListNavigation.d.ts.map +1 -0
- package/dist/src/tui/hooks/useListNavigation.js +123 -0
- package/dist/src/tui/hooks/useListNavigation.js.map +1 -0
- package/dist/src/tui/mocks.d.ts +6 -0
- package/dist/src/tui/mocks.d.ts.map +1 -0
- package/dist/src/tui/mocks.js +36 -0
- package/dist/src/tui/mocks.js.map +1 -0
- package/dist/src/tui/theme/Resolver.d.ts +6 -0
- package/dist/src/tui/theme/Resolver.d.ts.map +1 -0
- package/dist/src/tui/theme/Resolver.js +73 -0
- package/dist/src/tui/theme/Resolver.js.map +1 -0
- package/dist/src/tui/theme/ThemeRegistry.d.ts +3 -0
- package/dist/src/tui/theme/ThemeRegistry.d.ts.map +1 -0
- package/dist/src/tui/theme/ThemeRegistry.js +70 -0
- package/dist/src/tui/theme/ThemeRegistry.js.map +1 -0
- package/dist/src/tui/theme/data/aura.json +69 -0
- package/dist/src/tui/theme/data/ayu.json +80 -0
- package/dist/src/tui/theme/data/carbonfox.json +248 -0
- package/dist/src/tui/theme/data/catppuccin-frappe.json +233 -0
- package/dist/src/tui/theme/data/catppuccin-macchiato.json +233 -0
- package/dist/src/tui/theme/data/catppuccin.json +112 -0
- package/dist/src/tui/theme/data/cobalt2.json +228 -0
- package/dist/src/tui/theme/data/cursor.json +249 -0
- package/dist/src/tui/theme/data/dracula.json +219 -0
- package/dist/src/tui/theme/data/everforest.json +241 -0
- package/dist/src/tui/theme/data/flexoki.json +237 -0
- package/dist/src/tui/theme/data/github.json +233 -0
- package/dist/src/tui/theme/data/gruvbox.json +242 -0
- package/dist/src/tui/theme/data/kanagawa.json +77 -0
- package/dist/src/tui/theme/data/lucent-orng.json +237 -0
- package/dist/src/tui/theme/data/material.json +235 -0
- package/dist/src/tui/theme/data/matrix.json +77 -0
- package/dist/src/tui/theme/data/mercury.json +245 -0
- package/dist/src/tui/theme/data/monokai.json +221 -0
- package/dist/src/tui/theme/data/nightowl.json +221 -0
- package/dist/src/tui/theme/data/nord.json +223 -0
- package/dist/src/tui/theme/data/one-dark.json +84 -0
- package/dist/src/tui/theme/data/opencode.json +245 -0
- package/dist/src/tui/theme/data/orng.json +249 -0
- package/dist/src/tui/theme/data/osaka-jade.json +93 -0
- package/dist/src/tui/theme/data/palenight.json +222 -0
- package/dist/src/tui/theme/data/rosepine.json +234 -0
- package/dist/src/tui/theme/data/solarized.json +223 -0
- package/dist/src/tui/theme/data/synthwave84.json +226 -0
- package/dist/src/tui/theme/data/tokyonight.json +243 -0
- package/dist/src/tui/theme/data/vercel.json +245 -0
- package/dist/src/tui/theme/data/vesper.json +218 -0
- package/dist/src/tui/theme/data/zenburn.json +223 -0
- package/dist/src/tui/theme/default.d.ts +40 -0
- package/dist/src/tui/theme/default.d.ts.map +1 -0
- package/dist/src/tui/theme/default.js +35 -0
- package/dist/src/tui/theme/default.js.map +1 -0
- package/dist/src/tui/theme/resolver-utils.d.ts +28 -0
- package/dist/src/tui/theme/resolver-utils.d.ts.map +1 -0
- package/dist/src/tui/theme/resolver-utils.js +19 -0
- package/dist/src/tui/theme/resolver-utils.js.map +1 -0
- package/dist/src/tui/theme/themes.d.ts +3 -0
- package/dist/src/tui/theme/themes.d.ts.map +1 -0
- package/dist/src/tui/theme/themes.js +13 -0
- package/dist/src/tui/theme/themes.js.map +1 -0
- package/dist/src/tui/ui/Dialog.d.ts +19 -0
- package/dist/src/tui/ui/Dialog.d.ts.map +1 -0
- package/dist/src/tui/ui/Dialog.js +39 -0
- package/dist/src/tui/ui/Dialog.js.map +1 -0
- package/dist/src/tui/ui/DialogCommand.d.ts +2 -0
- package/dist/src/tui/ui/DialogCommand.d.ts.map +1 -0
- package/dist/src/tui/ui/DialogCommand.js +182 -0
- package/dist/src/tui/ui/DialogCommand.js.map +1 -0
- package/dist/src/tui/ui/DialogCreatePR.d.ts +2 -0
- package/dist/src/tui/ui/DialogCreatePR.d.ts.map +1 -0
- package/dist/src/tui/ui/DialogCreatePR.js +397 -0
- package/dist/src/tui/ui/DialogCreatePR.js.map +1 -0
- package/dist/src/tui/ui/DialogHelp.d.ts +6 -0
- package/dist/src/tui/ui/DialogHelp.d.ts.map +1 -0
- package/dist/src/tui/ui/DialogHelp.js +93 -0
- package/dist/src/tui/ui/DialogHelp.js.map +1 -0
- package/dist/src/tui/ui/DialogTheme.d.ts +2 -0
- package/dist/src/tui/ui/DialogTheme.d.ts.map +1 -0
- package/dist/src/tui/ui/DialogTheme.js +124 -0
- package/dist/src/tui/ui/DialogTheme.js.map +1 -0
- package/dist/src/tui/ui/index.d.ts +6 -0
- package/dist/src/tui/ui/index.d.ts.map +1 -0
- package/dist/src/tui/ui/index.js +6 -0
- package/dist/src/tui/ui/index.js.map +1 -0
- package/dist/src/tui/utils/prTemplates.d.ts +19 -0
- package/dist/src/tui/utils/prTemplates.d.ts.map +1 -0
- package/dist/src/tui/utils/prTemplates.js +46 -0
- package/dist/src/tui/utils/prTemplates.js.map +1 -0
- package/dist/test/ConfigService.test.d.ts +2 -0
- package/dist/test/ConfigService.test.d.ts.map +1 -0
- package/dist/test/ConfigService.test.js +40 -0
- package/dist/test/ConfigService.test.js.map +1 -0
- package/dist/test/ListBuilder.test.d.ts +2 -0
- package/dist/test/ListBuilder.test.d.ts.map +1 -0
- package/dist/test/ListBuilder.test.js +246 -0
- package/dist/test/ListBuilder.test.js.map +1 -0
- package/dist/test/MainList.test.d.ts +2 -0
- package/dist/test/MainList.test.d.ts.map +1 -0
- package/dist/test/MainList.test.js +228 -0
- package/dist/test/MainList.test.js.map +1 -0
- package/dist/test/Resolver.test.d.ts +2 -0
- package/dist/test/Resolver.test.d.ts.map +1 -0
- package/dist/test/Resolver.test.js +81 -0
- package/dist/test/Resolver.test.js.map +1 -0
- package/dist/test/Table.test.d.ts +2 -0
- package/dist/test/Table.test.d.ts.map +1 -0
- package/dist/test/Table.test.js +100 -0
- package/dist/test/Table.test.js.map +1 -0
- package/dist/tsconfig.tsbuildinfo +1 -0
- package/package.json +50 -0
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
import { Atom } from "@effect-atom/atom-react";
|
|
2
|
+
import type { Domain } from "@knpkv/codecommit-core";
|
|
3
|
+
/**
|
|
4
|
+
* TUI view type
|
|
5
|
+
* @category types
|
|
6
|
+
*/
|
|
7
|
+
export type TuiView = "prs" | "settings" | "notifications" | "details";
|
|
8
|
+
/**
|
|
9
|
+
* Current active view
|
|
10
|
+
* @category atoms
|
|
11
|
+
*/
|
|
12
|
+
export declare const viewAtom: Atom.Writable<TuiView, TuiView>;
|
|
13
|
+
/**
|
|
14
|
+
* Current filter text
|
|
15
|
+
* @category atoms
|
|
16
|
+
*/
|
|
17
|
+
export declare const filterTextAtom: Atom.Writable<string, string>;
|
|
18
|
+
/**
|
|
19
|
+
* Whether filter mode is active
|
|
20
|
+
* @category atoms
|
|
21
|
+
*/
|
|
22
|
+
export declare const isFilteringAtom: Atom.Writable<boolean, boolean>;
|
|
23
|
+
/**
|
|
24
|
+
* Whether help modal is shown
|
|
25
|
+
* @category atoms
|
|
26
|
+
*/
|
|
27
|
+
export declare const showHelpAtom: Atom.Writable<boolean, boolean>;
|
|
28
|
+
/**
|
|
29
|
+
* Currently selected PR for details view
|
|
30
|
+
* @category atoms
|
|
31
|
+
*/
|
|
32
|
+
export declare const currentPRAtom: Atom.Writable<Domain.PullRequest | null, Domain.PullRequest | null>;
|
|
33
|
+
/**
|
|
34
|
+
* Currently selected list index
|
|
35
|
+
* @category atoms
|
|
36
|
+
*/
|
|
37
|
+
export declare const selectedIndexAtom: Atom.Writable<number, number>;
|
|
38
|
+
/**
|
|
39
|
+
* Currently selected PR ID (for stable selection during streaming)
|
|
40
|
+
* @category atoms
|
|
41
|
+
*/
|
|
42
|
+
export declare const selectedPrIdAtom: Atom.Writable<string | null, string | null>;
|
|
43
|
+
/**
|
|
44
|
+
* Current theme identifier
|
|
45
|
+
* @category atoms
|
|
46
|
+
*/
|
|
47
|
+
export declare const themeAtom: Atom.Writable<string, string>;
|
|
48
|
+
/**
|
|
49
|
+
* Whether exit confirmation is pending
|
|
50
|
+
* @category atoms
|
|
51
|
+
*/
|
|
52
|
+
export declare const exitPendingAtom: Atom.Writable<boolean, boolean>;
|
|
53
|
+
/**
|
|
54
|
+
* Global UI error message (transient)
|
|
55
|
+
* @category atoms
|
|
56
|
+
*/
|
|
57
|
+
export declare const uiErrorAtom: Atom.Writable<string | null, string | null>;
|
|
58
|
+
/**
|
|
59
|
+
* Whether PR creation is in progress
|
|
60
|
+
* @category atoms
|
|
61
|
+
*/
|
|
62
|
+
export declare const creatingPrAtom: Atom.Writable<string | null, string | null>;
|
|
63
|
+
/**
|
|
64
|
+
* Quick filter type
|
|
65
|
+
* @category types
|
|
66
|
+
*/
|
|
67
|
+
export type QuickFilterType = "all" | "mine" | "account" | "author" | "scope" | "date" | "repo" | "status";
|
|
68
|
+
/**
|
|
69
|
+
* Date filter values
|
|
70
|
+
*/
|
|
71
|
+
export type DateFilterValue = "today" | "week" | "month" | "older";
|
|
72
|
+
/**
|
|
73
|
+
* Quick filter type atom
|
|
74
|
+
* @category atoms
|
|
75
|
+
*/
|
|
76
|
+
export declare const quickFilterTypeAtom: Atom.Writable<QuickFilterType, QuickFilterType>;
|
|
77
|
+
/**
|
|
78
|
+
* Quick filter values per filter type
|
|
79
|
+
* @category atoms
|
|
80
|
+
*/
|
|
81
|
+
export declare const quickFilterValuesAtom: Atom.Writable<Record<QuickFilterType, string>, Record<QuickFilterType, string>>;
|
|
82
|
+
/**
|
|
83
|
+
* Quick filter value (account id or author name) - derived from type
|
|
84
|
+
* @category atoms
|
|
85
|
+
* @deprecated Use quickFilterValuesAtom instead
|
|
86
|
+
*/
|
|
87
|
+
export declare const quickFilterValueAtom: Atom.Writable<string, string>;
|
|
88
|
+
/**
|
|
89
|
+
* Current user name (for "my PRs" filter)
|
|
90
|
+
* @category atoms
|
|
91
|
+
*/
|
|
92
|
+
export declare const currentUserAtom: Atom.Writable<string, string>;
|
|
93
|
+
/**
|
|
94
|
+
* Settings filter text
|
|
95
|
+
* @category atoms
|
|
96
|
+
*/
|
|
97
|
+
export declare const settingsFilterAtom: Atom.Writable<string, string>;
|
|
98
|
+
/**
|
|
99
|
+
* Whether settings filter mode is active
|
|
100
|
+
* @category atoms
|
|
101
|
+
*/
|
|
102
|
+
export declare const isSettingsFilteringAtom: Atom.Writable<boolean, boolean>;
|
|
103
|
+
//# sourceMappingURL=ui.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ui.d.ts","sourceRoot":"","sources":["../../../../src/tui/atoms/ui.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,yBAAyB,CAAA;AAC9C,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAA;AAEpD;;;GAGG;AACH,MAAM,MAAM,OAAO,GAAG,KAAK,GAAG,UAAU,GAAG,eAAe,GAAG,SAAS,CAAA;AAEtE;;;GAGG;AACH,eAAO,MAAM,QAAQ,iCAAiD,CAAA;AAEtE;;;GAGG;AACH,eAAO,MAAM,cAAc,+BAAqC,CAAA;AAEhE;;;GAGG;AACH,eAAO,MAAM,eAAe,iCAAwC,CAAA;AAEpE;;;GAGG;AACH,eAAO,MAAM,YAAY,iCAAwC,CAAA;AAEjE;;;GAGG;AACH,eAAO,MAAM,aAAa,qEAAkE,CAAA;AAE5F;;;GAGG;AACH,eAAO,MAAM,iBAAiB,+BAAoC,CAAA;AAElE;;;GAGG;AACH,eAAO,MAAM,gBAAgB,6CAAsD,CAAA;AAEnF;;;GAGG;AACH,eAAO,MAAM,SAAS,+BAAiD,CAAA;AAEvE;;;GAGG;AACH,eAAO,MAAM,eAAe,iCAAwC,CAAA;AAEpE;;;GAGG;AACH,eAAO,MAAM,WAAW,6CAAsD,CAAA;AAE9E;;;GAGG;AACH,eAAO,MAAM,cAAc,6CAAsD,CAAA;AAEjF;;;GAGG;AACH,MAAM,MAAM,eAAe,GAAG,KAAK,GAAG,MAAM,GAAG,SAAS,GAAG,QAAQ,GAAG,OAAO,GAAG,MAAM,GAAG,MAAM,GAAG,QAAQ,CAAA;AAE1G;;GAEG;AACH,MAAM,MAAM,eAAe,GAAG,OAAO,GAAG,MAAM,GAAG,OAAO,GAAG,OAAO,CAAA;AAElE;;;GAGG;AACH,eAAO,MAAM,mBAAmB,iDAAyD,CAAA;AAEzF;;;GAGG;AACH,eAAO,MAAM,qBAAqB,iFASX,CAAA;AAEvB;;;;GAIG;AACH,eAAO,MAAM,oBAAoB,+BAA6C,CAAA;AAE9E;;;GAGG;AACH,eAAO,MAAM,eAAe,+BAA6C,CAAA;AAEzE;;;GAGG;AACH,eAAO,MAAM,kBAAkB,+BAA6C,CAAA;AAE5E;;;GAGG;AACH,eAAO,MAAM,uBAAuB,iCAAwC,CAAA"}
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
import { Atom } from "@effect-atom/atom-react";
|
|
2
|
+
/**
|
|
3
|
+
* Current active view
|
|
4
|
+
* @category atoms
|
|
5
|
+
*/
|
|
6
|
+
export const viewAtom = Atom.make("prs").pipe(Atom.keepAlive);
|
|
7
|
+
/**
|
|
8
|
+
* Current filter text
|
|
9
|
+
* @category atoms
|
|
10
|
+
*/
|
|
11
|
+
export const filterTextAtom = Atom.make("").pipe(Atom.keepAlive);
|
|
12
|
+
/**
|
|
13
|
+
* Whether filter mode is active
|
|
14
|
+
* @category atoms
|
|
15
|
+
*/
|
|
16
|
+
export const isFilteringAtom = Atom.make(false).pipe(Atom.keepAlive);
|
|
17
|
+
/**
|
|
18
|
+
* Whether help modal is shown
|
|
19
|
+
* @category atoms
|
|
20
|
+
*/
|
|
21
|
+
export const showHelpAtom = Atom.make(false).pipe(Atom.keepAlive);
|
|
22
|
+
/**
|
|
23
|
+
* Currently selected PR for details view
|
|
24
|
+
* @category atoms
|
|
25
|
+
*/
|
|
26
|
+
export const currentPRAtom = Atom.make(null).pipe(Atom.keepAlive);
|
|
27
|
+
/**
|
|
28
|
+
* Currently selected list index
|
|
29
|
+
* @category atoms
|
|
30
|
+
*/
|
|
31
|
+
export const selectedIndexAtom = Atom.make(0).pipe(Atom.keepAlive);
|
|
32
|
+
/**
|
|
33
|
+
* Currently selected PR ID (for stable selection during streaming)
|
|
34
|
+
* @category atoms
|
|
35
|
+
*/
|
|
36
|
+
export const selectedPrIdAtom = Atom.make(null).pipe(Atom.keepAlive);
|
|
37
|
+
/**
|
|
38
|
+
* Current theme identifier
|
|
39
|
+
* @category atoms
|
|
40
|
+
*/
|
|
41
|
+
export const themeAtom = Atom.make("dark").pipe(Atom.keepAlive);
|
|
42
|
+
/**
|
|
43
|
+
* Whether exit confirmation is pending
|
|
44
|
+
* @category atoms
|
|
45
|
+
*/
|
|
46
|
+
export const exitPendingAtom = Atom.make(false).pipe(Atom.keepAlive);
|
|
47
|
+
/**
|
|
48
|
+
* Global UI error message (transient)
|
|
49
|
+
* @category atoms
|
|
50
|
+
*/
|
|
51
|
+
export const uiErrorAtom = Atom.make(null).pipe(Atom.keepAlive);
|
|
52
|
+
/**
|
|
53
|
+
* Whether PR creation is in progress
|
|
54
|
+
* @category atoms
|
|
55
|
+
*/
|
|
56
|
+
export const creatingPrAtom = Atom.make(null).pipe(Atom.keepAlive);
|
|
57
|
+
/**
|
|
58
|
+
* Quick filter type atom
|
|
59
|
+
* @category atoms
|
|
60
|
+
*/
|
|
61
|
+
export const quickFilterTypeAtom = Atom.make("all").pipe(Atom.keepAlive);
|
|
62
|
+
/**
|
|
63
|
+
* Quick filter values per filter type
|
|
64
|
+
* @category atoms
|
|
65
|
+
*/
|
|
66
|
+
export const quickFilterValuesAtom = Atom.make({
|
|
67
|
+
all: "",
|
|
68
|
+
mine: "",
|
|
69
|
+
account: "",
|
|
70
|
+
author: "",
|
|
71
|
+
scope: "",
|
|
72
|
+
date: "today",
|
|
73
|
+
repo: "",
|
|
74
|
+
status: "approved"
|
|
75
|
+
}).pipe(Atom.keepAlive);
|
|
76
|
+
/**
|
|
77
|
+
* Quick filter value (account id or author name) - derived from type
|
|
78
|
+
* @category atoms
|
|
79
|
+
* @deprecated Use quickFilterValuesAtom instead
|
|
80
|
+
*/
|
|
81
|
+
export const quickFilterValueAtom = Atom.make("").pipe(Atom.keepAlive);
|
|
82
|
+
/**
|
|
83
|
+
* Current user name (for "my PRs" filter)
|
|
84
|
+
* @category atoms
|
|
85
|
+
*/
|
|
86
|
+
export const currentUserAtom = Atom.make("").pipe(Atom.keepAlive);
|
|
87
|
+
/**
|
|
88
|
+
* Settings filter text
|
|
89
|
+
* @category atoms
|
|
90
|
+
*/
|
|
91
|
+
export const settingsFilterAtom = Atom.make("").pipe(Atom.keepAlive);
|
|
92
|
+
/**
|
|
93
|
+
* Whether settings filter mode is active
|
|
94
|
+
* @category atoms
|
|
95
|
+
*/
|
|
96
|
+
export const isSettingsFilteringAtom = Atom.make(false).pipe(Atom.keepAlive);
|
|
97
|
+
//# sourceMappingURL=ui.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ui.js","sourceRoot":"","sources":["../../../../src/tui/atoms/ui.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,yBAAyB,CAAA;AAS9C;;;GAGG;AACH,MAAM,CAAC,MAAM,QAAQ,GAAG,IAAI,CAAC,IAAI,CAAU,KAAK,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,CAAA;AAEtE;;;GAGG;AACH,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+
readonly children: React.ReactNode;
|
|
4
|
+
readonly variant?: BadgeVariant;
|
|
5
|
+
readonly minWidth?: number;
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* Styled badge component for status indicators
|
|
9
|
+
* @category components
|
|
10
|
+
*/
|
|
11
|
+
export declare function Badge({ children, minWidth, variant }: BadgeProps): import("react").ReactNode;
|
|
12
|
+
export {};
|
|
13
|
+
//# sourceMappingURL=Badge.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Badge.d.ts","sourceRoot":"","sources":["../../../../src/tui/components/Badge.tsx"],"names":[],"mappings":"AAEA,MAAM,MAAM,YAAY,GAAG,SAAS,GAAG,SAAS,GAAG,OAAO,GAAG,MAAM,GAAG,SAAS,GAAG,SAAS,CAAA;AAE3F,UAAU,UAAU;IAClB,QAAQ,CAAC,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAA;IAClC,QAAQ,CAAC,OAAO,CAAC,EAAE,YAAY,CAAA;IAC/B,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAA;CAC3B;AAED;;;GAGG;AACH,wBAAgB,KAAK,CAAC,EAAE,QAAQ,EAAE,QAAQ,EAAE,OAAmB,EAAE,EAAE,UAAU,6BAkD5E"}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { jsx as _jsx } from "@opentui/react/jsx-runtime";
|
|
2
|
+
import { useTheme } from "../context/theme.js";
|
|
3
|
+
/**
|
|
4
|
+
* Styled badge component for status indicators
|
|
5
|
+
* @category components
|
|
6
|
+
*/
|
|
7
|
+
export function Badge({ children, minWidth, variant = "neutral" }) {
|
|
8
|
+
const { theme } = useTheme();
|
|
9
|
+
let bg = theme.backgroundElement;
|
|
10
|
+
let fg = theme.text;
|
|
11
|
+
switch (variant) {
|
|
12
|
+
case "success":
|
|
13
|
+
bg = theme.success;
|
|
14
|
+
fg = theme.background;
|
|
15
|
+
break;
|
|
16
|
+
case "warning":
|
|
17
|
+
bg = theme.warning;
|
|
18
|
+
fg = theme.background;
|
|
19
|
+
break;
|
|
20
|
+
case "error":
|
|
21
|
+
bg = theme.error;
|
|
22
|
+
fg = theme.background;
|
|
23
|
+
break;
|
|
24
|
+
case "info":
|
|
25
|
+
bg = theme.primary;
|
|
26
|
+
fg = theme.background;
|
|
27
|
+
break;
|
|
28
|
+
case "neutral":
|
|
29
|
+
bg = theme.backgroundElement;
|
|
30
|
+
fg = theme.textMuted;
|
|
31
|
+
break;
|
|
32
|
+
case "outline":
|
|
33
|
+
bg = "transparent";
|
|
34
|
+
fg = theme.textMuted;
|
|
35
|
+
break;
|
|
36
|
+
}
|
|
37
|
+
const str = String(children);
|
|
38
|
+
const contentWidth = str.length + 2; // 1 space padding each side
|
|
39
|
+
const width = Math.max(minWidth ?? 0, contentWidth);
|
|
40
|
+
return (_jsx("box", { style: {
|
|
41
|
+
backgroundColor: bg,
|
|
42
|
+
width,
|
|
43
|
+
height: 1,
|
|
44
|
+
justifyContent: "center",
|
|
45
|
+
alignItems: "center"
|
|
46
|
+
}, children: _jsx("text", { fg: fg, children: str }) }));
|
|
47
|
+
}
|
|
48
|
+
//# sourceMappingURL=Badge.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Badge.js","sourceRoot":"","sources":["../../../../src/tui/components/Badge.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAA;AAU9C;;;GAGG;AACH,MAAM,UAAU,KAAK,CAAC,EAAE,QAAQ,EAAE,QAAQ,EAAE,OAAO,GAAG,SAAS,EAAc;IAC3E,MAAM,EAAE,KAAK,EAAE,GAAG,QAAQ,EAAE,CAAA;IAE5B,IAAI,EAAE,GAAG,KAAK,CAAC,iBAAiB,CAAA;IAChC,IAAI,EAAE,GAAG,KAAK,CAAC,IAAI,CAAA;IAEnB,QAAQ,OAAO,EAAE,CAAC;QAChB,KAAK,SAAS;YACZ,EAAE,GAAG,KAAK,CAAC,OAA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I1B"}
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "@opentui/react/jsx-runtime";
|
|
2
|
+
import { Result, useAtomValue } from "@effect-atom/atom-react";
|
|
3
|
+
import { parseColor, SyntaxStyle } from "@opentui/core";
|
|
4
|
+
import { useEffect, useMemo, useState } from "react";
|
|
5
|
+
import { appStateAtom } from "../atoms/app.js";
|
|
6
|
+
import { selectedPrIdAtom } from "../atoms/ui.js";
|
|
7
|
+
import { useTheme } from "../context/theme.js";
|
|
8
|
+
import { DateUtils } from "@knpkv/codecommit-core";
|
|
9
|
+
import { Badge } from "./Badge.js";
|
|
10
|
+
import { StatusRow } from "./StatusRow.js";
|
|
11
|
+
const defaultState = {
|
|
12
|
+
status: "loading",
|
|
13
|
+
pullRequests: [],
|
|
14
|
+
accounts: []
|
|
15
|
+
};
|
|
16
|
+
/**
|
|
17
|
+
* PR details view showing full PR information
|
|
18
|
+
* @category components
|
|
19
|
+
*/
|
|
20
|
+
export function DetailsView() {
|
|
21
|
+
const { theme } = useTheme();
|
|
22
|
+
const selectedPrId = useAtomValue(selectedPrIdAtom);
|
|
23
|
+
const appStateResult = useAtomValue(appStateAtom);
|
|
24
|
+
const appState = Result.getOrElse(appStateResult, () => defaultState);
|
|
25
|
+
// Find PR by ID directly - stable even when items reorder
|
|
26
|
+
const pr = useMemo(() => {
|
|
27
|
+
if (!selectedPrId)
|
|
28
|
+
return null;
|
|
29
|
+
return appState.pullRequests.find((p) => p.id === selectedPrId) ?? null;
|
|
30
|
+
}, [selectedPrId, appState.pullRequests]);
|
|
31
|
+
const [syntaxStyle, setSyntaxStyle] = useState(null);
|
|
32
|
+
useEffect(() => {
|
|
33
|
+
const style = SyntaxStyle.fromStyles({
|
|
34
|
+
default: { fg: parseColor(theme.markdownText) },
|
|
35
|
+
"markup.heading": { fg: parseColor(theme.markdownHeading), bold: true },
|
|
36
|
+
"markup.link": { fg: parseColor(theme.markdownLink), underline: true },
|
|
37
|
+
"markup.link.label": { fg: parseColor(theme.markdownLinkText), underline: true },
|
|
38
|
+
"markup.link.url": { fg: parseColor(theme.markdownLink), underline: true },
|
|
39
|
+
"markup.raw": { fg: parseColor(theme.markdownCode) },
|
|
40
|
+
"markup.quote": { fg: parseColor(theme.markdownBlockQuote), italic: true },
|
|
41
|
+
"punctuation.special": { fg: parseColor(theme.markdownBlockQuote) },
|
|
42
|
+
"markup.strong": { fg: parseColor(theme.markdownStrong), bold: true },
|
|
43
|
+
"markup.bold": { fg: parseColor(theme.markdownStrong), bold: true },
|
|
44
|
+
"markup.italic": { fg: parseColor(theme.markdownEmph), italic: true },
|
|
45
|
+
"markup.list": { fg: parseColor(theme.markdownListItem) }
|
|
46
|
+
});
|
|
47
|
+
setSyntaxStyle(style);
|
|
48
|
+
return () => style.destroy();
|
|
49
|
+
}, [theme]);
|
|
50
|
+
if (!pr) {
|
|
51
|
+
return (_jsx("box", { style: {
|
|
52
|
+
flexGrow: 1,
|
|
53
|
+
width: "100%",
|
|
54
|
+
justifyContent: "center",
|
|
55
|
+
alignItems: "center",
|
|
56
|
+
backgroundColor: theme.backgroundPanel
|
|
57
|
+
}, children: _jsx("text", { fg: theme.textMuted, children: "No PR selected" }) }));
|
|
58
|
+
}
|
|
59
|
+
return (_jsxs("box", { style: {
|
|
60
|
+
flexGrow: 1,
|
|
61
|
+
width: "100%",
|
|
62
|
+
flexDirection: "column",
|
|
63
|
+
backgroundColor: theme.backgroundPanel
|
|
64
|
+
}, children: [_jsx("box", { style: {
|
|
65
|
+
height: 3,
|
|
66
|
+
width: "100%",
|
|
67
|
+
backgroundColor: theme.backgroundPanel,
|
|
68
|
+
paddingLeft: 2,
|
|
69
|
+
paddingRight: 2,
|
|
70
|
+
justifyContent: "center",
|
|
71
|
+
alignItems: "center"
|
|
72
|
+
}, children: _jsx("text", { fg: theme.textAccent, children: ` PR: ${pr.repositoryName} > ${pr.title}` }) }), _jsx("scrollbox", { focused: true, style: {
|
|
73
|
+
flexGrow: 1,
|
|
74
|
+
width: "100%",
|
|
75
|
+
padding: 2,
|
|
76
|
+
rootOptions: { backgroundColor: theme.backgroundPanel },
|
|
77
|
+
viewportOptions: { backgroundColor: theme.backgroundPanel },
|
|
78
|
+
contentOptions: { backgroundColor: theme.backgroundPanel }
|
|
79
|
+
}, children: _jsxs("box", { flexDirection: "column", children: [_jsx(StatusRow, { label: "Merge:", children: !pr.isMergeable ? (_jsx(Badge, { variant: "error", minWidth: 14, children: "CONFLICT" })) : (_jsx(Badge, { variant: "success", minWidth: 14, children: "MERGEABLE" })) }), _jsx(StatusRow, { label: "Approval:", children: pr.isApproved ? (_jsx(Badge, { variant: "success", minWidth: 14, children: "APPROVED" })) : (_jsx(Badge, { variant: "neutral", minWidth: 14, children: "PENDING" })) }), _jsx(StatusRow, { label: "State:", children: _jsx("text", { fg: theme.text, children: pr.status.toUpperCase() }) }), _jsx("box", { style: { height: 1 } }), _jsx(StatusRow, { label: "Author:", children: _jsx("text", { fg: theme.text, children: pr.author }) }), _jsx(StatusRow, { label: "Created:", children: _jsx("text", { fg: theme.text, children: DateUtils.formatDateTime(pr.creationDate) }) }), _jsx(StatusRow, { label: "Branch:", children: _jsx("text", { fg: theme.text, children: `${pr.sourceBranch} -> ${pr.destinationBranch}` }) }), _jsx("box", { style: { height: 1 } }), _jsx("text", { fg: theme.textMuted, children: "\u2500".repeat(42) }), _jsx("box", { style: { height: 1 } }), _jsx("text", { fg: theme.text, children: "DESCRIPTION" }), _jsx("box", { style: { height: 1 } }), syntaxStyle && (_jsx("markdown", { style: { width: "100%" }, syntaxStyle: syntaxStyle, content: pr.description || "No description provided." })), _jsx("box", { style: { height: 1 } }), _jsx("text", { fg: theme.text, children: "LINK" }), _jsx("text", { fg: theme.textAccent, children: `URL: ${pr.link}` })] }) })] }));
|
|
80
|
+
}
|
|
81
|
+
//# sourceMappingURL=DetailsView.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DetailsView.js","sourceRoot":"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EAAE,EAAE,KAAK,CAAC,IAAI,YAAG,GAAG,EAAE,CAAC,YAAY,OAAO,EAAE,CAAC,iBAAiB,EAAE,GAAQ,GACpE,EAEZ,cAAK,KAAK,EAAE,EAAE,MAAM,EAAE,CAAC,EAAE,GAAI,EAC7B,eAAM,EAAE,EAAE,KAAK,CAAC,SAAS,YAAG,QAAQ,CAAC,MAAM,CAAC,EAAE,CAAC,GAAQ,EACvD,cAAK,KAAK,EAAE,EAAE,MAAM,EAAE,CAAC,EAAE,GAAI,EAE7B,eAAM,EAAE,EAAE,KAAK,CAAC,IAAI,4BAAoB,EACxC,cAAK,KAAK,EAAE,EAAE,MAAM,EAAE,CAAC,EAAE,GAAI,EAC5B,WAAW,IAAI,CACd,mBACE,KAAK,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE,EACxB,WAAW,EAAE,WAAW,EACxB,OAAO,EAAE,EAAE,CAAC,WAAW,IAAI,0BAA0B,GACrD,CACH,EAED,cAAK,KAAK,EAAE,EAAE,MAAM,EAAE,CAAC,EAAE,GAAI,EAE7B,eAAM,EAAE,EAAE,KAAK,CAAC,IAAI,qBAAa,EACjC,eAAM,EAAE,EAAE,KAAK,CAAC,UAAU,YAAG,QAAQ,EAAE,CAAC,IAAI,EAAE,GAAQ,IAClD,GACI,IACR,CACP,CAAA;AACH,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { Component, type ReactNode } from "react";
|
|
2
|
+
interface Props {
|
|
3
|
+
readonly children: ReactNode;
|
|
4
|
+
}
|
|
5
|
+
interface State {
|
|
6
|
+
readonly error: Error | null;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* Catches rendering errors and displays a fallback UI
|
|
10
|
+
* @category components
|
|
11
|
+
*/
|
|
12
|
+
export declare class ErrorBoundary extends Component<Props, State> {
|
|
13
|
+
constructor(props: Props);
|
|
14
|
+
static getDerivedStateFromError(error: Error): {
|
|
15
|
+
error: Error;
|
|
16
|
+
};
|
|
17
|
+
render(): ReactNode;
|
|
18
|
+
}
|
|
19
|
+
export {};
|
|
20
|
+
//# sourceMappingURL=ErrorBoundary.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ErrorBoundary.d.ts","sourceRoot":"","sources":["../../../../src/tui/components/ErrorBoundary.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,KAAK,SAAS,EAAE,MAAM,OAAO,CAAA;AAEjD,UAAU,KAAK;IACb,QAAQ,CAAC,QAAQ,EAAE,SAAS,CAAA;CAC7B;AAED,UAAU,KAAK;IACb,QAAQ,CAAC,KAAK,EAAE,KAAK,GAAG,IAAI,CAAA;CAC7B;AAED;;;GAGG;AACH,qBAAa,aAAc,SAAQ,SAAS,CAAC,KAAK,EAAE,KAAK,CAAC;gBAC5C,KAAK,EAAE,KAAK;IAKxB,MAAM,CAAC,wBAAwB,CAAC,KAAK,EAAE,KAAK;;;IAInC,MAAM;CAMhB"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "@opentui/react/jsx-runtime";
|
|
2
|
+
import { Component } from "react";
|
|
3
|
+
/**
|
|
4
|
+
* Catches rendering errors and displays a fallback UI
|
|
5
|
+
* @category components
|
|
6
|
+
*/
|
|
7
|
+
export class ErrorBoundary extends Component {
|
|
8
|
+
constructor(props) {
|
|
9
|
+
super(props);
|
|
10
|
+
this.state = { error: null };
|
|
11
|
+
}
|
|
12
|
+
static getDerivedStateFromError(error) {
|
|
13
|
+
return { error };
|
|
14
|
+
}
|
|
15
|
+
render() {
|
|
16
|
+
if (this.state.error) {
|
|
17
|
+
return _jsx(ErrorFallback, { error: this.state.error });
|
|
18
|
+
}
|
|
19
|
+
return this.props.children;
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
function ErrorFallback({ error }) {
|
|
23
|
+
// Use hardcoded colors for error state to ensure visibility regardless of theme breakage
|
|
24
|
+
return (_jsx("box", { style: {
|
|
25
|
+
width: "100%",
|
|
26
|
+
height: "100%",
|
|
27
|
+
flexDirection: "column",
|
|
28
|
+
justifyContent: "center",
|
|
29
|
+
alignItems: "center",
|
|
30
|
+
backgroundColor: "#2D3748"
|
|
31
|
+
}, children: _jsxs("box", { style: { backgroundColor: "#880000", padding: 1, flexDirection: "column" }, children: [_jsx("text", { fg: "#FFFFFF", style: { fontWeight: "bold" }, children: "CRITICAL ERROR" }), _jsx("text", { fg: "#FFFFFF", children: error.message }), _jsx("text", { fg: "#A0AEC0", children: error.stack })] }) }));
|
|
32
|
+
}
|
|
33
|
+
//# sourceMappingURL=ErrorBoundary.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ErrorBoundary.js","sourceRoot":"","sources":["../../../../src/tui/components/ErrorBoundary.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,SAAS,EAAkB,MAAM,OAAO,CAAA;AAUjD;;;GAGG;AACH,MAAM,OAAO,aAAc,SAAQ,SAAuB;IACxD,YAAY,KAAY;QACtB,KAAK,CAAC,KAAK,CAAC,CAAA;QACZ,IAAI,CAAC,KAAK,GAAG,EAAE,KAAK,EAAE,IAAI,EAAE,CAAA;IAC9B,CAAC;IAED,MAAM,CAAC,wBAAwB,CAAC,KAAY;QAC1C,OAAO,EAAE,KAAK,EAAE,CAAA;IAClB,CAAC;IAEQ,MAAM;QACb,IAAI,IAAI,CAAC,KAAK,CAAC,KAAK,EAAE,CAAC;YACrB,OAAO,KAAC,aAAa,IAAC,KAAK,EAAE,IAAI,CAAC,KAAK,CAAC,KAAK,GAAI,CAAA;QACnD,CAAC;QACD,OAAO,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAA;IAC5B,CAAC;CACF;AAED,SAAS,aAAa,CAAC,EAAE,KAAK,EAA6B;IACzD,yFAAyF;IACzF,OAAO,CACL,cACE,KAAK,EAAE;YACL,KAAK,EAAE,MAAM;YACb,MAAM,EAAE,MAAM;YACd,aAAa,EAAE,QAAQ;YACvB,cAAc,EAAE,QAAQ;YACxB,UAAU,EAAE,QAAQ;YACpB,eAAe,EAAE,SAAS;SAC3B,YAED,eAAK,KAAK,EAAE,EAAE,eAAe,EAAE,SAAS,EAAE,OAAO,EAAE,CAAC,EAAE,aAAa,EAAE,QAAQ,EAAE,aAC7E,eAAM,EAAE,EAAC,SAAS,EAAC,KAAK,EAAE,EAAE,UAAU,EAAE,MAAM,EAAS,+BAEhD,EACP,eAAM,EAAE,EAAC,SAAS,YAAE,KAAK,CAAC,OAAO,GAAQ,EACzC,eAAM,EAAE,EAAC,SAAS,YAAE,KAAK,CAAC,KAAK,GAAQ,IACnC,GACF,CACP,CAAA;AACH,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Footer.d.ts","sourceRoot":"","sources":["../../../../src/tui/components/Footer.tsx"],"names":[],"mappings":"AAKA;;;GAGG;AACH,wBAAgB,MAAM,8BA4CrB"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "@opentui/react/jsx-runtime";
|
|
2
|
+
import { useAtomValue } from "@effect-atom/atom-react";
|
|
3
|
+
import { exitPendingAtom, filterTextAtom, isFilteringAtom, uiErrorAtom, viewAtom } from "../atoms/ui.js";
|
|
4
|
+
import { HINTS } from "../Constants.js";
|
|
5
|
+
import { useTheme } from "../context/theme.js";
|
|
6
|
+
/**
|
|
7
|
+
* Footer bar showing hints or filter input
|
|
8
|
+
* @category components
|
|
9
|
+
*/
|
|
10
|
+
export function Footer() {
|
|
11
|
+
const { theme } = useTheme();
|
|
12
|
+
const view = useAtomValue(viewAtom);
|
|
13
|
+
const filterText = useAtomValue(filterTextAtom);
|
|
14
|
+
const isFiltering = useAtomValue(isFilteringAtom);
|
|
15
|
+
const exitPending = useAtomValue(exitPendingAtom);
|
|
16
|
+
const uiError = useAtomValue(uiErrorAtom);
|
|
17
|
+
if (exitPending) {
|
|
18
|
+
return (_jsx("box", { style: { height: 1, width: "100%", backgroundColor: theme.backgroundHeaderWarning }, children: _jsx("text", { fg: theme.textError, children: "Press Ctrl+C again to exit" }) }));
|
|
19
|
+
}
|
|
20
|
+
if (uiError) {
|
|
21
|
+
return (_jsx("box", { style: { height: 1, width: "100%", backgroundColor: theme.backgroundHeaderError }, children: _jsx("text", { fg: theme.textError, children: `ERROR: ${uiError}` }) }));
|
|
22
|
+
}
|
|
23
|
+
if (isFiltering) {
|
|
24
|
+
return (_jsxs("box", { style: { height: 1, width: "100%", backgroundColor: theme.backgroundElement, flexDirection: "row" }, children: [_jsx("text", { fg: theme.background, bg: theme.primary, children: " / " }), _jsx("text", { fg: theme.textMuted, children: " Filter: " }), _jsx("text", { fg: theme.text, children: filterText }), _jsx("text", { fg: theme.primary, children: "│" })] }));
|
|
25
|
+
}
|
|
26
|
+
const hintText = HINTS[view] || "";
|
|
27
|
+
return (_jsx("box", { style: { height: 1, width: "100%", backgroundColor: theme.backgroundPanel }, children: _jsx("text", { fg: theme.textMuted, children: ` > ${hintText}` }) }));
|
|
28
|
+
}
|
|
29
|
+
//# sourceMappingURL=Footer.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Footer.js","sourceRoot":"","sources":["../../../../src/tui/components/Footer.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAA;AACtD,OAAO,EAAE,eAAe,EAAE,cAAc,EAAE,eAAe,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAA;AACxG,OAAO,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAA;AACvC,OAAO,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAA;AAE9C;;;GAGG;AACH,MAAM,UAAU,MAAM;IACpB,MAAM,EAAE,KAAK,EAAE,GAAG,QAAQ,EAAE,CAAA;IAC5B,MAAM,IAAI,GAAG,YAAY,CAAC,QAAQ,CAAC,CAAA;IACnC,MAAM,UAAU,GAAG,YAAY,CAAC,c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ElC,OAAO,CACL,cAAK,KAAK,EAAE,EAAE,MAAM,EAAE,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,eAAe,EAAE,KAAK,CAAC,eAAe,EAAE,YAC9E,eAAM,EAAE,EAAE,KAAK,CAAC,SAAS,YAAG,QAAQ,QAAQ,EAAE,GAAQ,GAClD,CACP,CAAA;AACH,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Header.d.ts","sourceRoot":"","sources":["../../../../src/tui/components/Header.tsx"],"names":[],"mappings":"AAcA;;;GAGG;AACH,wBAAgB,MAAM,8BAwDrB"}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { jsx as _jsx } from "@opentui/react/jsx-runtime";
|
|
2
|
+
import { Result, useAtomValue } from "@effect-atom/atom-react";
|
|
3
|
+
import { useEffect, useState } from "react";
|
|
4
|
+
import { appStateAtom, notificationsAtom } from "../atoms/app.js";
|
|
5
|
+
import { creatingPrAtom, viewAtom } from "../atoms/ui.js";
|
|
6
|
+
import { SPINNER_FRAMES, VIEW_TITLES } from "../Constants.js";
|
|
7
|
+
import { useTheme } from "../context/theme.js";
|
|
8
|
+
import { DateUtils } from "@knpkv/codecommit-core";
|
|
9
|
+
const defaultState = {
|
|
10
|
+
status: "loading",
|
|
11
|
+
pullRequests: [],
|
|
12
|
+
accounts: []
|
|
13
|
+
};
|
|
14
|
+
/**
|
|
15
|
+
* Header bar showing current view title and status
|
|
16
|
+
* @category components
|
|
17
|
+
*/
|
|
18
|
+
export function Header() {
|
|
19
|
+
const { theme } = useTheme();
|
|
20
|
+
const result = useAtomValue(appStateAtom);
|
|
21
|
+
const notificationsResult = useAtomValue(notificationsAtom);
|
|
22
|
+
const view = useAtomValue(viewAtom);
|
|
23
|
+
const creatingPr = useAtomValue(creatingPrAtom);
|
|
24
|
+
const [, setTick] = useState(0);
|
|
25
|
+
const [spinnerFrame, setSpinnerFrame] = useState(0);
|
|
26
|
+
const state = Result.getOrElse(result, () => defaultState);
|
|
27
|
+
const notifications = Result.getOrElse(notificationsResult, () => ({ items: [] }));
|
|
28
|
+
useEffect(() => {
|
|
29
|
+
const timer = setInterval(() => setTick((t) => t + 1), 10000);
|
|
30
|
+
return () => clearInterval(timer);
|
|
31
|
+
}, []);
|
|
32
|
+
useEffect(() => {
|
|
33
|
+
if (state.status === "loading" || creatingPr) {
|
|
34
|
+
const interval = setInterval(() => setSpinnerFrame((f) => (f + 1) % SPINNER_FRAMES.length), 80);
|
|
35
|
+
return () => clearInterval(interval);
|
|
36
|
+
}
|
|
37
|
+
}, [state.status, creatingPr]);
|
|
38
|
+
if (state.error) {
|
|
39
|
+
return (_jsx("box", { style: { height: 1, width: "100%", backgroundColor: theme.backgroundHeaderError }, children: _jsx("text", { fg: theme.text, children: ` [X] ERROR: ${state.error}` }) }));
|
|
40
|
+
}
|
|
41
|
+
const lastUpdateStr = creatingPr
|
|
42
|
+
? ` ${SPINNER_FRAMES[spinnerFrame]} [+] Creating: ${creatingPr}`
|
|
43
|
+
: state.status === "loading"
|
|
44
|
+
? ` ${SPINNER_FRAMES[spinnerFrame]} [@] Fetching ${state.statusDetail ?? "..."}`
|
|
45
|
+
: state.lastUpdated
|
|
46
|
+
? ` [@] ${DateUtils.formatRelativeTime(state.lastUpdated, new Date())}`
|
|
47
|
+
: "";
|
|
48
|
+
const count = view === "prs"
|
|
49
|
+
? state.pullRequests.length
|
|
50
|
+
: view === "notifications"
|
|
51
|
+
? notifications.items.length
|
|
52
|
+
: state.accounts.length;
|
|
53
|
+
const title = (VIEW_TITLES[view] || "TUI").toUpperCase();
|
|
54
|
+
const headerText = ` AWS ${title} (${count}) ${lastUpdateStr}`;
|
|
55
|
+
const bgColor = theme.backgroundHeader;
|
|
56
|
+
return (_jsx("box", { style: { height: 1, width: "100%", backgroundColor: bgColor }, children: _jsx("text", { fg: theme.text, children: headerText }) }));
|
|
57
|
+
}
|
|
58
|
+
//# sourceMappingURL=Header.js.map
|
|
@@ -0,0 +1 @@
|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AC,KAAK,cAAc,CAAC,YAAY,CAAC,iBAAiB,KAAK,CAAC,YAAY,IAAI,KAAK,EAAE;YACjF,CAAC,CAAC,KAAK,CAAC,WAAW;gBACjB,CAAC,CAAC,SAAS,SAAS,CAAC,kBAAkB,CAAC,KAAK,CAAC,WAAW,EAAE,IAAI,IAAI,EAAE,CAAC,EAAE;gBACxE,CAAC,CAAC,EAAE,CAAA;IACV,MAAM,KAAK,GACT,IAAI,KAAK,KAAK;QACZ,CAAC,CAAC,KAAK,CAAC,YAAY,CAAC,MAAM;QAC3B,CAAC,CAAC,IAAI,KAAK,eAAe;YACxB,CAAC,CAAC,aAAa,CAAC,KAAK,CAAC,MAAM;YAC5B,CAAC,CAAC,KAAK,CAAC,QAAQ,CAAC,MAAM,CAAA;IAE7B,MAAM,KAAK,GAAG,CAAC,WAAW,CAAC,IAAI,CAAC,IAAI,KAAK,CAAC,CAAC,WAAW,EAAE,CAAA;IACxD,MAAM,UAAU,GAAG,SAAS,KAAK,KAAK,KAAK,KAAK,aAAa,EAAE,CAAA;IAE/D,MAAM,OAAO,GAAG,KAAK,CAAC,gBAAgB,CAAA;IAEtC,OAAO,CACL,cAAK,KAAK,EAAE,EAAE,MAAM,EAAE,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,eAAe,EAAE,OAAO,EAAE,YAChE,eAAM,EAAE,EAAE,KAAK,CAAC,IAAI,YAAG,UAAU,GAAQ,GACrC,CACP,CAAA;AACH,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { ListItem } from "../ListBuilder.js";
|
|
2
|
+
interface ListItemRowProps {
|
|
3
|
+
readonly item: ListItem;
|
|
4
|
+
readonly selected: boolean;
|
|
5
|
+
readonly isFirst?: boolean;
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* Renders a single row in the main PR list
|
|
9
|
+
* @category components
|
|
10
|
+
*/
|
|
11
|
+
export declare function ListItemRow({ isFirst, item, selected }: ListItemRowProps): import("react").ReactNode;
|
|
12
|
+
export {};
|
|
13
|
+
//# sourceMappingURL=ListItemRow.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ListItemRow.d.ts","sourceRoot":"","sources":["../../../../src/tui/components/ListItemRow.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAA;AAIjD,UAAU,gBAAgB;IACxB,QAAQ,CAAC,IAAI,EAAE,QAAQ,CAAA;IACvB,QAAQ,CAAC,QAAQ,EAAE,OAAO,CAAA;IAC1B,QAAQ,CAAC,OAAO,CAAC,EAAE,OAAO,CAAA;CAC3B;AAED;;;GAGG;AACH,wBAAgB,WAAW,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,EAAE,gBAAgB,6BAuGxE"}
|