octotui 0.1.1__py3-none-any.whl → 0.1.5__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.
@@ -425,6 +425,76 @@ class GitDiffViewer(App):
425
425
  # If we can't populate branches, that's okay - continue without it
426
426
  pass
427
427
 
428
+ def populate_file_tree(self) -> None:
429
+ """Populate the file tree sidebar with all files and their git status."""
430
+ if not self.git_sidebar.repo:
431
+ return
432
+
433
+ try:
434
+ # Get the tree widget
435
+ tree = self.query_one("#file-tree", Tree)
436
+
437
+ # Clear existing tree
438
+ tree.clear()
439
+
440
+ # Automatically expand the root node
441
+ tree.root.expand()
442
+
443
+ # Get all files in the repository with their statuses
444
+ file_data = self.git_sidebar.collect_file_data()
445
+ file_tree = self.git_sidebar.get_file_tree()
446
+
447
+ # Sort file_tree so directories are processed first
448
+ file_tree.sort(key=lambda x: (x[1] != "directory", x[0]))
449
+
450
+ # Keep track of created directory nodes to avoid duplicates
451
+ directory_nodes = {"": tree.root} # Empty string maps to root node
452
+
453
+ # Add all files and directories
454
+ for file_path, file_type, git_status in file_tree:
455
+ parts = file_path.split('/')
456
+
457
+ for i in range(len(parts)):
458
+ # For directories, we need to process all parts
459
+ # For files, we need to process all parts except the last one (handled separately)
460
+ if file_type == "directory" or i < len(parts) - 1:
461
+ parent_path = "/".join(parts[:i])
462
+ current_path = "/".join(parts[:i+1])
463
+
464
+ # Create node if it doesn't exist
465
+ if current_path not in directory_nodes:
466
+ parent_node = directory_nodes[parent_path]
467
+ new_node = parent_node.add(parts[i], expand=True)
468
+ new_node.label.stylize("bold #bb9af7") # Color directories with accent color
469
+ directory_nodes[current_path] = new_node
470
+
471
+ # For files, add as leaf node under the appropriate directory
472
+ if file_type == "file":
473
+ # Get the parent directory node
474
+ parent_dir_path = "/".join(parts[:-1])
475
+ parent_node = directory_nodes[parent_dir_path] if parent_dir_path else tree.root
476
+
477
+ leaf_node = parent_node.add_leaf(parts[-1], data={"path": file_path, "status": git_status})
478
+ # Apply specific text colors based on git status
479
+ if git_status == "staged":
480
+ leaf_node.label.stylize("bold #9ece6a")
481
+ elif git_status == "modified":
482
+ leaf_node.label.stylize("bold #a9a1e1")
483
+ elif git_status == "untracked":
484
+ leaf_node.label.stylize("bold purple")
485
+ else: # unchanged
486
+ leaf_node.label.stylize("default")
487
+
488
+ except Exception as e:
489
+ # Show error in diff panel
490
+ try:
491
+ diff_content = self.query_one("#diff-content", VerticalScroll)
492
+ diff_content.remove_children()
493
+ diff_content.mount(Static(f"Error populating file tree: {e}", classes="error"))
494
+ except Exception:
495
+ # If we can't even show the error, that's okay - just continue without it
496
+ pass
497
+
428
498
  def action_show_branch_switcher(self) -> None:
429
499
  """Show the branch switcher modal."""
430
500
  modal = BranchSwitchModal(self.git_sidebar)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: octotui
3
- Version: 0.1.1
3
+ Version: 0.1.5
4
4
  Summary: A blazing-fast TUI replacement for GitKraken - manage your Git repos with style!
5
5
  Project-URL: Repository, https://github.com/never-use-gui/octotui
6
6
  Project-URL: Homepage, https://github.com/never-use-gui/octotui
@@ -19,7 +19,7 @@ Classifier: Programming Language :: Python :: 3.13
19
19
  Classifier: Topic :: Software Development :: Version Control :: Git
20
20
  Classifier: Topic :: Terminals
21
21
  Requires-Python: >=3.11
22
- Requires-Dist: gac>0.18.0
22
+ Requires-Dist: gac>=2.7.3
23
23
  Requires-Dist: gitpython>=3.1.42
24
24
  Requires-Dist: pyfiglet>=1.0.2
25
25
  Requires-Dist: textual>=6.1.0
@@ -47,7 +47,7 @@ Description-Content-Type: text/markdown
47
47
  ---
48
48
 
49
49
  ## 🚀 OctoTUI
50
-
50
+ ![octotui.png](octotui.png)
51
51
  > **We love GitKraken so much, we wanted to bring that beautiful experience to the terminal!**
52
52
 
53
53
  GitKraken is amazing - it's gorgeous, intuitive, and makes Git feel approachable. But as terminal enthusiasts, we found ourselves constantly context-switching between our editor and GitKraken. We wanted that same delightful experience without ever leaving the command line.
@@ -191,7 +191,7 @@ MIT License - see [LICENSE](LICENSE) for details
191
191
  ## 🙏 Acknowledgments
192
192
 
193
193
  - Built with ❤️ using [Textual](https://textual.textualize.io/)
194
- - AI commits powered by [GAC](https://github.com/cellweb/gac)
194
+ - AI commits powered by [GAC](https://github.com/cellwebb/gac)
195
195
 
196
196
  ## 💬 Community
197
197
 
@@ -5,14 +5,14 @@ octotui/diff_markdown.py,sha256=uJ-AEmnFC62042nnn7gWQNuD4wIOaCLa1VGAtADJSlY,6424
5
5
  octotui/gac_config_modal.py,sha256=ylufuKOUrXxKzRiqjlbkaNwwlupv_uGMdxSJ03msxRU,13929
6
6
  octotui/gac_integration.py,sha256=h5Lbc6SgUD9fnXLQ1ry5jRT_BI0zOURqtlEN8z2RF9M,6792
7
7
  octotui/gac_provider_registry.py,sha256=-RQ5vY_f4C9BHjIXs-0DLFVVOAzbaGxdEXZlbuz2NvQ,6183
8
- octotui/git_diff_viewer.py,sha256=O7Caew5qlMN7OnGc-LSG8JeHHKIKMqPGzxvlqENHUJ0,53923
8
+ octotui/git_diff_viewer.py,sha256=w9M0cXny7gqDSg7CvqN-w9iYvaD1gTci-Ax8B16ZAZg,57406
9
9
  octotui/git_status_sidebar.py,sha256=7Eoui9PXM4SIMzfUeSRgzdN6oQRSMh9K0WbHdsb9wek,34441
10
10
  octotui/main.py,sha256=W8dPSdr1ulDXbn_Wk0bmkFVcM38A2L32kWnF6TM2yl0,310
11
11
  octotui/octotui_logo.py,sha256=mSEbO51vsPt9LG14z8HNTjBZknPP8XC04l8qLtsn9e4,1430
12
12
  octotui/style.tcss,sha256=Nuu4jx8Tac4Z2G78x99UUZRhGcNxB6TXFp1Jq2fJKwM,6453
13
13
  octotui/syntax_utils.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
14
- octotui-0.1.1.data/data/octotui/style.tcss,sha256=Nuu4jx8Tac4Z2G78x99UUZRhGcNxB6TXFp1Jq2fJKwM,6453
15
- octotui-0.1.1.dist-info/METADATA,sha256=TBQMluNWX5YAoV0qUUVAdPLz6yQ490XBQnHS5fhfNtc,6010
16
- octotui-0.1.1.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
17
- octotui-0.1.1.dist-info/entry_points.txt,sha256=MCqXQjBbXVLDjyBrhzWNvbFEU1vQ1hfSogoage2Uhh0,46
18
- octotui-0.1.1.dist-info/RECORD,,
14
+ octotui-0.1.5.data/data/octotui/style.tcss,sha256=Nuu4jx8Tac4Z2G78x99UUZRhGcNxB6TXFp1Jq2fJKwM,6453
15
+ octotui-0.1.5.dist-info/METADATA,sha256=DwGoXWmcT9QgOt9APgObbBXUMELQ-ry4hSTlTHvFTVc,6038
16
+ octotui-0.1.5.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
17
+ octotui-0.1.5.dist-info/entry_points.txt,sha256=MCqXQjBbXVLDjyBrhzWNvbFEU1vQ1hfSogoage2Uhh0,46
18
+ octotui-0.1.5.dist-info/RECORD,,