octotui 0.1.1__py3-none-any.whl

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.
octotui/main.py ADDED
@@ -0,0 +1,15 @@
1
+ import sys
2
+
3
+ from octotui.git_diff_viewer import GitDiffViewer
4
+
5
+
6
+ def main():
7
+ # Optional repo path argument
8
+ repo_path = sys.argv[1] if len(sys.argv) > 1 else None
9
+
10
+ if len(sys.argv) > 2:
11
+ print("Usage: octotui [repo_path]")
12
+ sys.exit(1)
13
+
14
+ app = GitDiffViewer(repo_path)
15
+ app.run()
@@ -0,0 +1,52 @@
1
+ from __future__ import annotations
2
+
3
+ from typing import ClassVar
4
+
5
+ from pyfiglet import Figlet
6
+ from textual.app import ComposeResult
7
+ from textual.widget import Widget
8
+ from textual.widgets import Static
9
+
10
+
11
+ class OctotuiLogo(Widget):
12
+ """Big, stylish Octotui logo using pyfiglet with the pagga font."""
13
+
14
+ DEFAULT_CSS = """
15
+ OctotuiLogo {
16
+ height: auto;
17
+ width: 1fr;
18
+ content-align: center middle;
19
+ background: transparent;
20
+ align: center middle;
21
+ }
22
+
23
+ OctotuiLogo .logo-text {
24
+ text-style: bold;
25
+ color: #bb9af7;
26
+ text-align: center;
27
+ margin: 0;
28
+ }
29
+ """
30
+
31
+ LOGO_TEXT: ClassVar[str] = "OCTOTUI"
32
+ FONT_NAME: ClassVar[str] = "pagga"
33
+
34
+ def compose(self) -> ComposeResult:
35
+ """Create a stylish FIGlet logo using the pagga font."""
36
+ logo_lines = self._generate_logo()
37
+
38
+ yield Static("", classes="logo-text")
39
+ for line in logo_lines:
40
+ yield Static(line, classes="logo-text")
41
+ yield Static("", classes="logo-text")
42
+
43
+ def on_resize(self) -> None:
44
+ """Handle resize events to maintain proper sizing."""
45
+ self.refresh()
46
+
47
+ @classmethod
48
+ def _generate_logo(cls) -> list[str]:
49
+ """Generate the logo using pyfiglet with the pagga font."""
50
+ figlet = Figlet(font=cls.FONT_NAME)
51
+ logo_text = figlet.renderText(cls.LOGO_TEXT)
52
+ return logo_text.rstrip().splitlines()
octotui/style.tcss ADDED
@@ -0,0 +1,431 @@
1
+
2
+ /* GitDiffViewer CSS - GitKraken-like Design */
3
+
4
+ Screen {
5
+ background: transparent;
6
+ color: $text;
7
+ }
8
+
9
+ /* Logo styling */
10
+ AnimatedLogo .logo-text {
11
+ text-style: bold;
12
+ color: #bb9af7;
13
+ text-align: center;
14
+ margin: 0 0;
15
+ }
16
+
17
+ Header {
18
+ color: $text;
19
+ background: transparent;
20
+ text-style: bold;
21
+ }
22
+
23
+ .panel-header, #diff-header {
24
+ text-align: center;
25
+ padding: 0 1;
26
+ background: transparent;
27
+ color: $text;
28
+ text-style: bold;
29
+ border-bottom: solid #6c7086;
30
+ max-height: 2;
31
+ }
32
+
33
+ #sidebar {
34
+ width: 20%;
35
+ height: 1fr;
36
+ border: solid #6c7086;
37
+ background: transparent;
38
+ overflow: auto;
39
+ }
40
+
41
+ #diff-panel {
42
+ width: 50%;
43
+ height: 1fr;
44
+ border: solid #6c7086;
45
+ background: transparent;
46
+ overflow: auto;
47
+ }
48
+
49
+ #status-panel {
50
+ width: 30%;
51
+ height: 1fr;
52
+ border: solid #6c7086;
53
+ background: transparent;
54
+ overflow-y: scroll;
55
+ scrollbar-size: 1 1;
56
+ scrollbar-color: #9399b2;
57
+ }
58
+
59
+ /* Status tabs container */
60
+ #status-tabs {
61
+ height: 1fr;
62
+ background: transparent;
63
+ }
64
+
65
+ #unstaged-tab, #staged-tab {
66
+ background: transparent;
67
+ }
68
+
69
+ #unstaged-tab > VerticalScroll, #staged-tab > VerticalScroll {
70
+ height: 1fr;
71
+ background: transparent;
72
+ overflow-y: auto;
73
+ scrollbar-size: 1 1;
74
+ scrollbar-color: #9399b2;
75
+ }
76
+
77
+ .hint {
78
+ color: #9399b2;
79
+ text-style: italic;
80
+ padding: 0 1;
81
+ margin: 0 0 1 0;
82
+ }
83
+
84
+
85
+
86
+ #unstaged-tree, #staged-tree {
87
+ height: 1fr;
88
+ background: transparent;
89
+ overflow-y: auto;
90
+ scrollbar-size: 1 1;
91
+ scrollbar-color: #9399b2;
92
+ }
93
+
94
+ #file-tree {
95
+ height: 1fr;
96
+ background: transparent;
97
+ overflow-y: auto;
98
+ scrollbar-size: 1 1;
99
+ scrollbar-color: #9399b2;
100
+ }
101
+
102
+ #diff-content {
103
+ height: 1fr;
104
+ overflow-y: auto;
105
+ }
106
+
107
+ .diff-markdown {
108
+ padding: 0;
109
+ background: transparent;
110
+ border: none;
111
+ }
112
+
113
+ #history-content {
114
+ height: 1fr;
115
+ overflow-y: auto;
116
+ }
117
+
118
+
119
+
120
+ .commit-input {
121
+ width: 100%;
122
+ height: 6;
123
+ border: solid #6c7086;
124
+ background: transparent;
125
+ padding: 0 1;
126
+ }
127
+
128
+ .commit-button {
129
+ width: 100%;
130
+ margin-top: 1;
131
+ background: #9ece6a;
132
+ color: black;
133
+ text-style: bold;
134
+ }
135
+
136
+ .commit-button:hover {
137
+ background: #9ece6a 60%;
138
+ }
139
+
140
+ .commit-button:disabled {
141
+ background: transparent;
142
+ color: $text-disabled;
143
+ }
144
+
145
+ /* GAC Configuration Modal Styles */
146
+ .gac-label {
147
+ margin: 1 0 0 0;
148
+ color: #bb9af7;
149
+ text-style: bold;
150
+ }
151
+
152
+ .gac-input {
153
+ margin: 1 0;
154
+ width: 100%;
155
+ border: solid #6c7086;
156
+ background: transparent;
157
+ color: white;
158
+ padding: 0 1;
159
+ }
160
+
161
+ .gac-select {
162
+ margin: 1 0;
163
+ width: 100%;
164
+ border: solid #6c7086;
165
+ }
166
+
167
+ .gac-buttons {
168
+ align: center bottom;
169
+ height: auto;
170
+ margin: 2 0 0 0;
171
+ }
172
+
173
+ .test-button {
174
+ background: #ff6b35;
175
+ color: white;
176
+ margin: 0 1;
177
+ text-style: bold;
178
+ }
179
+
180
+ .test-button:hover {
181
+ background: #ff8c5a;
182
+ }
183
+
184
+ .save-button {
185
+ background: #bb9af7;
186
+ color: white;
187
+ margin: 0 1;
188
+ text-style: bold;
189
+ }
190
+
191
+ .save-button:hover {
192
+ background: #9bb8ff;
193
+ }
194
+
195
+ .cancel-button {
196
+ background: #666666;
197
+ color: white;
198
+ margin: 0 1;
199
+ text-style: bold;
200
+ }
201
+
202
+ .cancel-button:hover {
203
+ background: #888888;
204
+ }
205
+
206
+ /* GAC button styling */
207
+ .gac-button {
208
+ background: #ff6b35;
209
+ color: white;
210
+ margin: 0 0 0 1;
211
+ text-style: bold;
212
+ width: 8;
213
+ height: 6;
214
+ }
215
+
216
+ .gac-button:hover {
217
+ background: #ff8c5a;
218
+ }
219
+
220
+ /* Commit message row layout */
221
+ .commit-message-row {
222
+ width: 100%;
223
+ height: 6;
224
+ margin: 0 0 1 0;
225
+ }
226
+
227
+ /* Commit Section Styles - Now in center panel tab */
228
+ .commit-label {
229
+ margin: 0 0 0 0;
230
+ color: #bb9af7;
231
+ text-style: bold;
232
+ height: 1;
233
+ }
234
+
235
+ .commit-input {
236
+ margin: 0 0 1 0;
237
+ border: solid #6c7086;
238
+ background: transparent;
239
+ color: white;
240
+ height: 6;
241
+ }
242
+
243
+ .commit-body {
244
+ margin: 0 0 1 0;
245
+ border: solid #6c7086;
246
+ background: transparent;
247
+ color: white;
248
+ height: 20;
249
+ min-height: 15;
250
+ width: 100%;
251
+ padding: 1;
252
+ }
253
+
254
+ .commit-button {
255
+ margin: 1 0;
256
+ background: #bb9af7;
257
+ color: white;
258
+ text-style: bold;
259
+ width: 100%;
260
+ }
261
+
262
+ .commit-button:hover {
263
+ background: #9bb8ff;
264
+ }
265
+
266
+ .commit-section {
267
+ padding: 2;
268
+ height: 1fr;
269
+ layout: vertical;
270
+ overflow-y: auto;
271
+ }
272
+
273
+
274
+
275
+ /* Hunk styling */
276
+ .hunk-container {
277
+ layout: vertical;
278
+ width: 100%;
279
+ border: none;
280
+ margin: 0;
281
+ height: auto;
282
+ }
283
+
284
+ .hunk-header {
285
+ background: transparent;
286
+ color: $text;
287
+ text-style: bold;
288
+ padding: 0;
289
+ }
290
+
291
+ /* Tab styling */
292
+ TabbedContent {
293
+ height: 1fr;
294
+ }
295
+
296
+ TabPane > Static {
297
+ background: transparent;
298
+ color: $text;
299
+ text-style: bold;
300
+ }
301
+
302
+ TabbedContent > TabPane {
303
+ background: transparent;
304
+ }
305
+
306
+ .added {
307
+ background: #9ece6a 60%;
308
+ color: black;
309
+ width: 100%;
310
+ padding: 0 1;
311
+ height: auto;
312
+ }
313
+
314
+ .removed {
315
+ background: #d3869b 60%;
316
+ color: white;
317
+ width: 100%;
318
+ padding: 0 1;
319
+ height: auto;
320
+ }
321
+
322
+ .unchanged {
323
+ background: transparent;
324
+ width: 100%;
325
+ padding: 0 1;
326
+ height: auto;
327
+ }
328
+
329
+ .hunk-buttons {
330
+ width: 100%;
331
+ height: auto;
332
+ align: center middle;
333
+ padding: 1 0;
334
+ }
335
+
336
+ .stage-button, .unstage-button {
337
+ width: 12;
338
+ margin: 0 1;
339
+ height: auto;
340
+ border: solid #6c7086;
341
+ background: transparent;
342
+ color: $text;
343
+ text-style: bold;
344
+ }
345
+
346
+ .stage-button:hover, .unstage-button:hover {
347
+ background: #9ece6a 60%;
348
+ }
349
+
350
+ .discard-button {
351
+ width: 12;
352
+ margin: 0 1;
353
+ height: auto;
354
+ border: solid #6c7086;
355
+ background: transparent;
356
+ color: $text;
357
+ text-style: bold;
358
+ }
359
+
360
+ .discard-button:hover {
361
+ background: #d3869b 60%;
362
+ }
363
+
364
+ .error {
365
+ background: red;
366
+ color: white;
367
+ text-style: bold;
368
+ width: 100%;
369
+ padding: 0 1;
370
+ }
371
+
372
+ .info {
373
+ background: transparent;
374
+ color: $text;
375
+ width: 100%;
376
+ padding: 0 1;
377
+ }
378
+
379
+ Footer {
380
+ color: $text;
381
+ background: transparent;
382
+ }
383
+
384
+ Tabs {
385
+ background: transparent;
386
+ }
387
+
388
+ Tabs > Tab {
389
+ color: $text;
390
+ background: transparent;
391
+ text-style: bold;
392
+ }
393
+
394
+ Tabs > Tab.--active {
395
+ background: transparent;
396
+ border-bottom: solid #6c7086;
397
+ }
398
+
399
+ Tabs > Tab:hover {
400
+ background: #9399b2;
401
+ }
402
+
403
+ /* Git status colors in tree */
404
+ Tree > .modified {
405
+ color: #a9a1e1;
406
+ text-style: bold;
407
+ }
408
+
409
+ Tree > .staged {
410
+ color: #9ece6a;
411
+ text-style: bold;
412
+ }
413
+
414
+ Tree > .untracked {
415
+ color: #a9a1e1;
416
+ text-style: bold;
417
+ }
418
+
419
+ Tree > .unchanged {
420
+ color: $text;
421
+ }
422
+
423
+ Tree > .directory {
424
+ color: #bb9af7;
425
+ text-style: bold;
426
+ }
427
+
428
+ Tree > .tree--node {
429
+ padding: 0 1;
430
+ background: transparent;
431
+ }
File without changes