codex-lens 0.1.28 → 0.1.29

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/src/global.css CHANGED
@@ -643,6 +643,310 @@ body {
643
643
  background: transparent;
644
644
  }
645
645
 
646
+ /* ==================== Git Status Bar ==================== */
647
+ .git-status-bar {
648
+ display: flex;
649
+ align-items: center;
650
+ gap: 16px;
651
+ padding: 6px 14px;
652
+ background: rgba(148, 163, 184, 0.08);
653
+ border-radius: var(--radius-sm);
654
+ border: 1px solid var(--border-color);
655
+ }
656
+
657
+ .git-branch {
658
+ display: flex;
659
+ align-items: center;
660
+ gap: 6px;
661
+ font-family: var(--font-mono);
662
+ font-size: 12px;
663
+ font-weight: 600;
664
+ color: var(--accent-color);
665
+ }
666
+
667
+ .git-branch-icon {
668
+ font-size: 14px;
669
+ opacity: 0.8;
670
+ }
671
+
672
+ .git-stats {
673
+ display: flex;
674
+ align-items: center;
675
+ gap: 12px;
676
+ }
677
+
678
+ .git-staged,
679
+ .git-unstaged {
680
+ display: flex;
681
+ align-items: center;
682
+ gap: 4px;
683
+ font-size: 11px;
684
+ color: var(--text-secondary);
685
+ }
686
+
687
+ .git-staged-count {
688
+ font-weight: 600;
689
+ color: var(--success-color);
690
+ }
691
+
692
+ .git-unstaged-count {
693
+ font-weight: 600;
694
+ color: var(--warning-color);
695
+ }
696
+
697
+ .git-changes-btn {
698
+ padding: 4px 10px;
699
+ font-size: 11px;
700
+ background: transparent;
701
+ border: 1px solid var(--border-color);
702
+ border-radius: var(--radius-xs);
703
+ color: var(--text-secondary);
704
+ cursor: pointer;
705
+ transition: all var(--transition-fast);
706
+ }
707
+
708
+ .git-changes-btn:hover {
709
+ background: var(--accent-soft);
710
+ border-color: var(--accent-color);
711
+ color: var(--accent-color);
712
+ }
713
+
714
+ /* ==================== Staged Changes Panel ==================== */
715
+ .staged-changes-panel {
716
+ position: absolute;
717
+ top: 52px;
718
+ left: 0;
719
+ right: 0;
720
+ max-height: 400px;
721
+ background: linear-gradient(180deg, var(--bg-tertiary) 0%, var(--bg-secondary) 100%);
722
+ border-bottom: 1px solid var(--border-color);
723
+ z-index: 99;
724
+ overflow-y: auto;
725
+ animation: slideDown 0.2s ease;
726
+ }
727
+
728
+ @keyframes slideDown {
729
+ from {
730
+ opacity: 0;
731
+ transform: translateY(-8px);
732
+ }
733
+ to {
734
+ opacity: 1;
735
+ transform: translateY(0);
736
+ }
737
+ }
738
+
739
+ .staged-panel-header {
740
+ display: flex;
741
+ justify-content: space-between;
742
+ align-items: center;
743
+ padding: 10px 16px;
744
+ background: rgba(15, 23, 42, 0.6);
745
+ border-bottom: 1px solid var(--border-color);
746
+ font-weight: 600;
747
+ font-size: 12px;
748
+ color: var(--text-secondary);
749
+ }
750
+
751
+ .staged-panel-actions {
752
+ display: flex;
753
+ gap: 8px;
754
+ align-items: center;
755
+ }
756
+
757
+ .stage-btn,
758
+ .unstage-btn {
759
+ padding: 4px 10px;
760
+ font-size: 11px;
761
+ background: var(--bg-elevated);
762
+ border: 1px solid var(--border-color);
763
+ border-radius: var(--radius-xs);
764
+ color: var(--text-secondary);
765
+ cursor: pointer;
766
+ transition: all var(--transition-fast);
767
+ }
768
+
769
+ .stage-btn:hover,
770
+ .unstage-btn:hover {
771
+ background: var(--accent-soft);
772
+ border-color: var(--accent-color);
773
+ color: var(--accent-color);
774
+ }
775
+
776
+ .close-btn {
777
+ width: 24px;
778
+ height: 24px;
779
+ display: flex;
780
+ align-items: center;
781
+ justify-content: center;
782
+ background: transparent;
783
+ border: none;
784
+ color: var(--text-muted);
785
+ cursor: pointer;
786
+ font-size: 16px;
787
+ border-radius: var(--radius-xs);
788
+ transition: all var(--transition-fast);
789
+ }
790
+
791
+ .close-btn:hover {
792
+ background: rgba(239, 68, 68, 0.2);
793
+ color: var(--danger-color);
794
+ }
795
+
796
+ .changes-section {
797
+ padding: 8px 0;
798
+ border-bottom: 1px solid var(--border-color);
799
+ }
800
+
801
+ .changes-section:last-child {
802
+ border-bottom: none;
803
+ }
804
+
805
+ .changes-section-header {
806
+ padding: 4px 16px;
807
+ }
808
+
809
+ .changes-section-title {
810
+ font-size: 10px;
811
+ font-weight: 600;
812
+ color: var(--text-muted);
813
+ text-transform: uppercase;
814
+ letter-spacing: 0.5px;
815
+ }
816
+
817
+ .changes-list {
818
+ display: flex;
819
+ flex-direction: column;
820
+ }
821
+
822
+ .change-item {
823
+ display: flex;
824
+ align-items: center;
825
+ gap: 8px;
826
+ padding: 6px 16px;
827
+ cursor: pointer;
828
+ transition: background var(--transition-fast);
829
+ }
830
+
831
+ .change-item:hover {
832
+ background: rgba(148, 163, 184, 0.08);
833
+ }
834
+
835
+ .change-item.staged {
836
+ background: var(--accent-soft);
837
+ }
838
+
839
+ .change-icon {
840
+ width: 16px;
841
+ text-align: center;
842
+ font-size: 12px;
843
+ color: var(--text-muted);
844
+ }
845
+
846
+ .change-item.staged .change-icon {
847
+ color: var(--success-color);
848
+ }
849
+
850
+ .change-status {
851
+ width: 14px;
852
+ height: 14px;
853
+ display: flex;
854
+ align-items: center;
855
+ justify-content: center;
856
+ font-size: 10px;
857
+ font-weight: 700;
858
+ font-family: var(--font-mono);
859
+ border-radius: 2px;
860
+ }
861
+
862
+ .change-status.M { background: var(--warning-color); color: var(--bg-primary); }
863
+ .change-status.A { background: var(--success-color); color: var(--bg-primary); }
864
+ .change-status.D { background: var(--danger-color); color: var(--text-primary); }
865
+ .change-status.R { background: var(--info-color); color: var(--text-primary); }
866
+ .change-status.\? { background: var(--text-muted); color: var(--bg-primary); }
867
+
868
+ .change-path {
869
+ flex: 1;
870
+ font-size: 12px;
871
+ font-family: var(--font-mono);
872
+ color: var(--text-primary);
873
+ overflow: hidden;
874
+ text-overflow: ellipsis;
875
+ white-space: nowrap;
876
+ }
877
+
878
+ .no-changes {
879
+ padding: 24px;
880
+ text-align: center;
881
+ color: var(--text-muted);
882
+ font-size: 13px;
883
+ }
884
+
885
+ .commit-section {
886
+ display: flex;
887
+ gap: 8px;
888
+ padding: 12px 16px;
889
+ background: rgba(15, 23, 42, 0.6);
890
+ border-top: 1px solid var(--border-color);
891
+ }
892
+
893
+ .commit-input {
894
+ flex: 1;
895
+ padding: 8px 12px;
896
+ background: var(--bg-primary);
897
+ border: 1px solid var(--border-color);
898
+ border-radius: var(--radius-sm);
899
+ color: var(--text-primary);
900
+ font-size: 12px;
901
+ font-family: var(--font-family);
902
+ }
903
+
904
+ .commit-input:focus {
905
+ outline: none;
906
+ border-color: var(--accent-color);
907
+ }
908
+
909
+ .commit-btn {
910
+ padding: 8px 16px;
911
+ background: var(--accent-color);
912
+ border: none;
913
+ border-radius: var(--radius-sm);
914
+ color: var(--bg-primary);
915
+ font-size: 12px;
916
+ font-weight: 600;
917
+ cursor: pointer;
918
+ transition: all var(--transition-fast);
919
+ }
920
+
921
+ .commit-btn:hover {
922
+ background: var(--accent-hover);
923
+ transform: translateY(-1px);
924
+ }
925
+
926
+ /* ==================== File Tree Git Badges ==================== */
927
+ .file-git-badge {
928
+ width: 14px;
929
+ height: 14px;
930
+ display: flex;
931
+ align-items: center;
932
+ justify-content: center;
933
+ font-size: 9px;
934
+ font-weight: 700;
935
+ font-family: var(--font-mono);
936
+ border-radius: 2px;
937
+ margin-right: 2px;
938
+ }
939
+
940
+ .file-git-badge.staged {
941
+ background: var(--success-color);
942
+ color: var(--bg-primary);
943
+ }
944
+
945
+ .file-git-badge.wt {
946
+ background: var(--warning-color);
947
+ color: var(--bg-primary);
948
+ }
949
+
646
950
  @media (max-width: 1024px) {
647
951
  .left-panel {
648
952
  width: 220px;
package/src/watcher.js CHANGED
@@ -81,6 +81,23 @@ class FileWatcher {
81
81
  this.wsEmitter = wsEmitter;
82
82
  this.watcher = null;
83
83
  this.fileContents = new Map();
84
+ this.gitStatusCallback = null;
85
+ this._gitStatusTimeout = null;
86
+ }
87
+
88
+ setGitStatusCallback(callback) {
89
+ this.gitStatusCallback = callback;
90
+ }
91
+
92
+ _scheduleGitStatusUpdate(filePath) {
93
+ if (this.gitStatusCallback) {
94
+ if (this._gitStatusTimeout) {
95
+ clearTimeout(this._gitStatusTimeout);
96
+ }
97
+ this._gitStatusTimeout = setTimeout(() => {
98
+ this.gitStatusCallback(filePath);
99
+ }, 500);
100
+ }
84
101
  }
85
102
 
86
103
  async start() {
@@ -161,6 +178,9 @@ class FileWatcher {
161
178
 
162
179
  this.emitFileChange(filePath, newContent, diff);
163
180
  }
181
+
182
+ // Schedule git status update if git is available
183
+ this._scheduleGitStatusUpdate(filePath);
164
184
  } catch (error) {
165
185
  logger.errorWithStack(`Error handling file change: ${filePath}`, error);
166
186
  }