gh-here 1.0.2 → 1.0.4
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/.claude/settings.local.json +15 -10
- package/README.md +6 -3
- package/bin/gh-here.js +8 -1255
- package/lib/file-utils.js +264 -0
- package/lib/git.js +207 -0
- package/lib/gitignore.js +91 -0
- package/lib/renderers.js +569 -0
- package/lib/server.js +391 -0
- package/package.json +1 -1
- package/public/app.js +692 -129
- package/public/styles.css +414 -44
- package/tests/draftManager.test.js +241 -0
- package/tests/httpService.test.js +268 -0
- package/tests/languageDetection.test.js +145 -0
- package/tests/pathUtils.test.js +136 -0
package/public/styles.css
CHANGED
|
@@ -32,12 +32,21 @@
|
|
|
32
32
|
box-sizing: border-box;
|
|
33
33
|
}
|
|
34
34
|
|
|
35
|
+
html {
|
|
36
|
+
/* Set background on html to prevent flash during navigation */
|
|
37
|
+
background-color: #0d1117; /* Default dark theme background */
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
[data-theme="light"] html {
|
|
41
|
+
background-color: #ffffff; /* Light theme background */
|
|
42
|
+
}
|
|
43
|
+
|
|
35
44
|
body {
|
|
36
45
|
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Noto Sans', Helvetica, Arial, sans-serif;
|
|
37
46
|
background-color: var(--bg-primary);
|
|
38
47
|
color: var(--text-primary);
|
|
39
48
|
line-height: 1.5;
|
|
40
|
-
|
|
49
|
+
min-height: 100vh; /* Ensure full height */
|
|
41
50
|
}
|
|
42
51
|
|
|
43
52
|
header {
|
|
@@ -252,6 +261,15 @@ main {
|
|
|
252
261
|
vertical-align: text-bottom;
|
|
253
262
|
}
|
|
254
263
|
|
|
264
|
+
/* GitHub-style blue folder icons */
|
|
265
|
+
.octicon-directory {
|
|
266
|
+
fill: #58a6ff;
|
|
267
|
+
}
|
|
268
|
+
|
|
269
|
+
[data-theme="light"] .octicon-directory {
|
|
270
|
+
fill: #0969da;
|
|
271
|
+
}
|
|
272
|
+
|
|
255
273
|
.octicon-home {
|
|
256
274
|
margin-right: 8px;
|
|
257
275
|
}
|
|
@@ -533,7 +551,7 @@ main {
|
|
|
533
551
|
margin: 0;
|
|
534
552
|
padding: 20px;
|
|
535
553
|
overflow-x: auto;
|
|
536
|
-
font-size:
|
|
554
|
+
font-size: 12px;
|
|
537
555
|
line-height: 1.5;
|
|
538
556
|
background-color: var(--bg-primary);
|
|
539
557
|
}
|
|
@@ -595,7 +613,10 @@ main {
|
|
|
595
613
|
.editor-title {
|
|
596
614
|
font-size: 14px;
|
|
597
615
|
font-weight: 600;
|
|
598
|
-
color: var(--text-
|
|
616
|
+
color: var(--text-accent);
|
|
617
|
+
display: flex;
|
|
618
|
+
align-items: center;
|
|
619
|
+
margin: 0;
|
|
599
620
|
}
|
|
600
621
|
|
|
601
622
|
.editor-actions {
|
|
@@ -638,48 +659,17 @@ main {
|
|
|
638
659
|
border-color: var(--text-secondary);
|
|
639
660
|
}
|
|
640
661
|
|
|
641
|
-
.editor-with-line-numbers {
|
|
642
|
-
position: relative;
|
|
643
|
-
display: flex;
|
|
644
|
-
border: 1px solid var(--border-primary);
|
|
645
|
-
border-width: 0 1px 1px 1px;
|
|
646
|
-
border-radius: 0 0 5px 5px;
|
|
647
|
-
background: var(--bg-primary);
|
|
648
|
-
height: 600px;
|
|
649
|
-
overflow: hidden;
|
|
650
|
-
}
|
|
651
662
|
|
|
652
|
-
.editor-line-numbers {
|
|
653
|
-
padding: 16px 8px 16px 16px;
|
|
654
|
-
background: var(--bg-primary);
|
|
655
|
-
border-right: 1px solid var(--border-secondary);
|
|
656
|
-
color: var(--text-secondary);
|
|
657
|
-
font-family: 'SFMono-Regular', 'Monaco', 'Inconsolata', 'Fira Mono', monospace;
|
|
658
|
-
font-size: 12px;
|
|
659
|
-
line-height: 1.5;
|
|
660
|
-
text-align: right;
|
|
661
|
-
user-select: none;
|
|
662
|
-
white-space: pre;
|
|
663
|
-
min-width: 50px;
|
|
664
|
-
height: 600px;
|
|
665
|
-
overflow-y: auto;
|
|
666
|
-
}
|
|
667
663
|
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
background: transparent;
|
|
676
|
-
|
|
677
|
-
border: none;
|
|
678
|
-
outline: none;
|
|
679
|
-
resize: vertical;
|
|
680
|
-
tab-size: 2;
|
|
681
|
-
white-space: pre;
|
|
682
|
-
overflow-y: auto;
|
|
664
|
+
|
|
665
|
+
/* Monaco editor container (current) */
|
|
666
|
+
#file-editor.monaco-editor {
|
|
667
|
+
height: 100% !important;
|
|
668
|
+
width: 100% !important;
|
|
669
|
+
padding: 0 !important;
|
|
670
|
+
border: none !important;
|
|
671
|
+
background: transparent !important;
|
|
672
|
+
flex: none !important;
|
|
683
673
|
}
|
|
684
674
|
|
|
685
675
|
.editor-with-line-numbers:focus-within {
|
|
@@ -765,7 +755,7 @@ main {
|
|
|
765
755
|
color: var(--text-secondary);
|
|
766
756
|
border-right: 1px solid var(--border-secondary);
|
|
767
757
|
font-size: 12px;
|
|
768
|
-
line-height: 1.
|
|
758
|
+
line-height: 1.5;
|
|
769
759
|
user-select: none;
|
|
770
760
|
-webkit-user-select: none;
|
|
771
761
|
text-decoration: none;
|
|
@@ -1755,3 +1745,383 @@ main {
|
|
|
1755
1745
|
color: var(--text-secondary);
|
|
1756
1746
|
font-style: italic;
|
|
1757
1747
|
}
|
|
1748
|
+
|
|
1749
|
+
/* Simple commit button */
|
|
1750
|
+
.commit-btn {
|
|
1751
|
+
background: var(--bg-tertiary);
|
|
1752
|
+
color: var(--text-primary);
|
|
1753
|
+
border: 1px solid var(--border-primary);
|
|
1754
|
+
border-radius: 6px;
|
|
1755
|
+
padding: 6px 12px;
|
|
1756
|
+
font-size: 13px;
|
|
1757
|
+
font-weight: 500;
|
|
1758
|
+
cursor: pointer;
|
|
1759
|
+
transition: all 0.15s ease;
|
|
1760
|
+
display: flex;
|
|
1761
|
+
align-items: center;
|
|
1762
|
+
gap: 4px;
|
|
1763
|
+
margin-right: 8px;
|
|
1764
|
+
}
|
|
1765
|
+
|
|
1766
|
+
.commit-btn:hover {
|
|
1767
|
+
background: var(--hover-bg);
|
|
1768
|
+
border-color: var(--text-secondary);
|
|
1769
|
+
}
|
|
1770
|
+
|
|
1771
|
+
.commit-icon {
|
|
1772
|
+
width: 14px;
|
|
1773
|
+
height: 14px;
|
|
1774
|
+
}
|
|
1775
|
+
|
|
1776
|
+
/* Clean commit modal */
|
|
1777
|
+
.commit-modal-overlay {
|
|
1778
|
+
position: fixed;
|
|
1779
|
+
top: 0;
|
|
1780
|
+
left: 0;
|
|
1781
|
+
right: 0;
|
|
1782
|
+
bottom: 0;
|
|
1783
|
+
background: rgba(0, 0, 0, 0.7);
|
|
1784
|
+
display: flex;
|
|
1785
|
+
align-items: center;
|
|
1786
|
+
justify-content: center;
|
|
1787
|
+
z-index: 1000;
|
|
1788
|
+
}
|
|
1789
|
+
|
|
1790
|
+
.commit-modal {
|
|
1791
|
+
background: var(--bg-primary);
|
|
1792
|
+
border: 1px solid var(--border-primary);
|
|
1793
|
+
border-radius: 8px;
|
|
1794
|
+
width: 500px;
|
|
1795
|
+
max-width: 90vw;
|
|
1796
|
+
max-height: 80vh;
|
|
1797
|
+
overflow: hidden;
|
|
1798
|
+
box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
|
|
1799
|
+
}
|
|
1800
|
+
|
|
1801
|
+
.commit-modal-header {
|
|
1802
|
+
padding: 16px 20px;
|
|
1803
|
+
border-bottom: 1px solid var(--border-primary);
|
|
1804
|
+
background: var(--bg-secondary);
|
|
1805
|
+
display: flex;
|
|
1806
|
+
align-items: center;
|
|
1807
|
+
justify-content: space-between;
|
|
1808
|
+
}
|
|
1809
|
+
|
|
1810
|
+
.commit-modal-header h3 {
|
|
1811
|
+
margin: 0;
|
|
1812
|
+
font-size: 16px;
|
|
1813
|
+
font-weight: 600;
|
|
1814
|
+
color: var(--text-primary);
|
|
1815
|
+
}
|
|
1816
|
+
|
|
1817
|
+
.modal-close {
|
|
1818
|
+
background: none;
|
|
1819
|
+
border: none;
|
|
1820
|
+
font-size: 20px;
|
|
1821
|
+
color: var(--text-secondary);
|
|
1822
|
+
cursor: pointer;
|
|
1823
|
+
padding: 0;
|
|
1824
|
+
width: 24px;
|
|
1825
|
+
height: 24px;
|
|
1826
|
+
display: flex;
|
|
1827
|
+
align-items: center;
|
|
1828
|
+
justify-content: center;
|
|
1829
|
+
border-radius: 4px;
|
|
1830
|
+
}
|
|
1831
|
+
|
|
1832
|
+
.modal-close:hover {
|
|
1833
|
+
background: var(--bg-tertiary);
|
|
1834
|
+
color: var(--text-primary);
|
|
1835
|
+
}
|
|
1836
|
+
|
|
1837
|
+
.commit-modal-body {
|
|
1838
|
+
padding: 20px;
|
|
1839
|
+
max-height: 50vh;
|
|
1840
|
+
overflow-y: auto;
|
|
1841
|
+
}
|
|
1842
|
+
|
|
1843
|
+
.changed-files h4 {
|
|
1844
|
+
margin: 0 0 12px 0;
|
|
1845
|
+
font-size: 14px;
|
|
1846
|
+
font-weight: 600;
|
|
1847
|
+
color: var(--text-primary);
|
|
1848
|
+
}
|
|
1849
|
+
|
|
1850
|
+
.file-list {
|
|
1851
|
+
list-style: none;
|
|
1852
|
+
margin: 0 0 20px 0;
|
|
1853
|
+
padding: 0;
|
|
1854
|
+
border: 1px solid var(--border-primary);
|
|
1855
|
+
border-radius: 6px;
|
|
1856
|
+
overflow: hidden;
|
|
1857
|
+
}
|
|
1858
|
+
|
|
1859
|
+
.file-item {
|
|
1860
|
+
padding: 0;
|
|
1861
|
+
border-bottom: 1px solid var(--border-secondary);
|
|
1862
|
+
font-size: 13px;
|
|
1863
|
+
}
|
|
1864
|
+
|
|
1865
|
+
.file-item:last-child {
|
|
1866
|
+
border-bottom: none;
|
|
1867
|
+
}
|
|
1868
|
+
|
|
1869
|
+
.file-checkbox-label {
|
|
1870
|
+
display: flex;
|
|
1871
|
+
align-items: center;
|
|
1872
|
+
gap: 8px;
|
|
1873
|
+
padding: 8px 12px;
|
|
1874
|
+
cursor: pointer;
|
|
1875
|
+
transition: background-color 0.15s ease;
|
|
1876
|
+
}
|
|
1877
|
+
|
|
1878
|
+
.file-checkbox-label:hover {
|
|
1879
|
+
background: var(--bg-tertiary);
|
|
1880
|
+
}
|
|
1881
|
+
|
|
1882
|
+
.file-checkbox {
|
|
1883
|
+
appearance: none;
|
|
1884
|
+
width: 16px;
|
|
1885
|
+
height: 16px;
|
|
1886
|
+
border: 2px solid var(--border-primary);
|
|
1887
|
+
border-radius: 3px;
|
|
1888
|
+
background: var(--bg-primary);
|
|
1889
|
+
cursor: pointer;
|
|
1890
|
+
position: relative;
|
|
1891
|
+
transition: all 0.15s ease;
|
|
1892
|
+
display: inline-block;
|
|
1893
|
+
vertical-align: middle;
|
|
1894
|
+
}
|
|
1895
|
+
|
|
1896
|
+
.file-checkbox:hover {
|
|
1897
|
+
border-color: var(--link-color);
|
|
1898
|
+
background: var(--bg-secondary);
|
|
1899
|
+
}
|
|
1900
|
+
|
|
1901
|
+
.file-checkbox:focus {
|
|
1902
|
+
outline: 2px solid var(--link-color);
|
|
1903
|
+
outline-offset: 2px;
|
|
1904
|
+
}
|
|
1905
|
+
|
|
1906
|
+
.file-checkbox:checked {
|
|
1907
|
+
background: var(--link-color);
|
|
1908
|
+
border-color: var(--link-color);
|
|
1909
|
+
}
|
|
1910
|
+
|
|
1911
|
+
.file-checkbox:checked::after {
|
|
1912
|
+
content: '';
|
|
1913
|
+
position: absolute;
|
|
1914
|
+
left: 50%;
|
|
1915
|
+
top: 50%;
|
|
1916
|
+
transform: translate(-50%, -50%) rotate(45deg);
|
|
1917
|
+
width: 3px;
|
|
1918
|
+
height: 6px;
|
|
1919
|
+
border: solid white;
|
|
1920
|
+
border-width: 0 2px 2px 0;
|
|
1921
|
+
display: block;
|
|
1922
|
+
}
|
|
1923
|
+
|
|
1924
|
+
.file-status {
|
|
1925
|
+
font-weight: 600;
|
|
1926
|
+
color: var(--text-secondary);
|
|
1927
|
+
min-width: 80px;
|
|
1928
|
+
}
|
|
1929
|
+
|
|
1930
|
+
.file-name {
|
|
1931
|
+
color: var(--text-primary);
|
|
1932
|
+
font-family: ui-monospace, monospace;
|
|
1933
|
+
flex: 1;
|
|
1934
|
+
}
|
|
1935
|
+
|
|
1936
|
+
.directory-group {
|
|
1937
|
+
padding: 8px 12px 4px;
|
|
1938
|
+
background: var(--bg-secondary);
|
|
1939
|
+
color: var(--text-primary);
|
|
1940
|
+
font-size: 12px;
|
|
1941
|
+
font-weight: 600;
|
|
1942
|
+
border-bottom: none;
|
|
1943
|
+
}
|
|
1944
|
+
|
|
1945
|
+
.folder-icon {
|
|
1946
|
+
width: 14px;
|
|
1947
|
+
height: 14px;
|
|
1948
|
+
margin-right: 6px;
|
|
1949
|
+
vertical-align: middle;
|
|
1950
|
+
fill: var(--text-secondary);
|
|
1951
|
+
}
|
|
1952
|
+
|
|
1953
|
+
.file-item.indented .file-checkbox-label {
|
|
1954
|
+
padding-left: 24px;
|
|
1955
|
+
}
|
|
1956
|
+
|
|
1957
|
+
#modal-commit-message {
|
|
1958
|
+
width: 100%;
|
|
1959
|
+
min-height: 80px;
|
|
1960
|
+
padding: 12px;
|
|
1961
|
+
border: 1px solid var(--border-primary);
|
|
1962
|
+
border-radius: 6px;
|
|
1963
|
+
background: var(--bg-primary);
|
|
1964
|
+
color: var(--text-primary);
|
|
1965
|
+
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
|
|
1966
|
+
font-size: 14px;
|
|
1967
|
+
line-height: 1.4;
|
|
1968
|
+
resize: vertical;
|
|
1969
|
+
box-sizing: border-box;
|
|
1970
|
+
}
|
|
1971
|
+
|
|
1972
|
+
#modal-commit-message:focus {
|
|
1973
|
+
outline: none;
|
|
1974
|
+
border-color: var(--link-color);
|
|
1975
|
+
box-shadow: 0 0 0 3px rgba(88, 166, 255, 0.1);
|
|
1976
|
+
}
|
|
1977
|
+
|
|
1978
|
+
.commit-modal-footer {
|
|
1979
|
+
padding: 16px 20px;
|
|
1980
|
+
border-top: 1px solid var(--border-primary);
|
|
1981
|
+
background: var(--bg-secondary);
|
|
1982
|
+
display: flex;
|
|
1983
|
+
align-items: center;
|
|
1984
|
+
justify-content: flex-end;
|
|
1985
|
+
gap: 12px;
|
|
1986
|
+
}
|
|
1987
|
+
|
|
1988
|
+
.btn-cancel {
|
|
1989
|
+
background: none;
|
|
1990
|
+
border: 1px solid var(--border-primary);
|
|
1991
|
+
color: var(--text-primary);
|
|
1992
|
+
border-radius: 6px;
|
|
1993
|
+
padding: 8px 16px;
|
|
1994
|
+
font-size: 14px;
|
|
1995
|
+
cursor: pointer;
|
|
1996
|
+
transition: all 0.15s ease;
|
|
1997
|
+
}
|
|
1998
|
+
|
|
1999
|
+
.btn-cancel:hover {
|
|
2000
|
+
background: var(--bg-tertiary);
|
|
2001
|
+
}
|
|
2002
|
+
|
|
2003
|
+
.btn-commit {
|
|
2004
|
+
background: var(--bg-tertiary);
|
|
2005
|
+
color: var(--text-primary);
|
|
2006
|
+
border: 1px solid var(--border-primary);
|
|
2007
|
+
border: none;
|
|
2008
|
+
border-radius: 6px;
|
|
2009
|
+
padding: 8px 16px;
|
|
2010
|
+
font-size: 14px;
|
|
2011
|
+
font-weight: 500;
|
|
2012
|
+
cursor: pointer;
|
|
2013
|
+
transition: all 0.15s ease;
|
|
2014
|
+
}
|
|
2015
|
+
|
|
2016
|
+
.btn-commit:hover:not(:disabled) {
|
|
2017
|
+
background: var(--hover-bg);
|
|
2018
|
+
border-color: var(--text-secondary);
|
|
2019
|
+
}
|
|
2020
|
+
|
|
2021
|
+
.btn-commit:disabled {
|
|
2022
|
+
background: var(--bg-tertiary);
|
|
2023
|
+
color: var(--text-secondary);
|
|
2024
|
+
cursor: not-allowed;
|
|
2025
|
+
}
|
|
2026
|
+
|
|
2027
|
+
/* Git status column - minimal spacing */
|
|
2028
|
+
.file-table .git-status-col {
|
|
2029
|
+
width: 10px;
|
|
2030
|
+
text-align: center;
|
|
2031
|
+
padding: 0;
|
|
2032
|
+
font-size: 16px;
|
|
2033
|
+
vertical-align: middle;
|
|
2034
|
+
}
|
|
2035
|
+
|
|
2036
|
+
/* Untracked file status styling */
|
|
2037
|
+
.git-status-untracked {
|
|
2038
|
+
color: #7c3aed !important;
|
|
2039
|
+
}
|
|
2040
|
+
|
|
2041
|
+
[data-theme="light"] .git-status-untracked {
|
|
2042
|
+
color: #8b5cf6 !important;
|
|
2043
|
+
}
|
|
2044
|
+
|
|
2045
|
+
/* Monaco Editor styling - inner container only */
|
|
2046
|
+
.monaco-editor-container {
|
|
2047
|
+
height: 600px !important;
|
|
2048
|
+
width: 100% !important;
|
|
2049
|
+
min-width: 400px !important;
|
|
2050
|
+
overflow: hidden !important;
|
|
2051
|
+
background: var(--bg-primary);
|
|
2052
|
+
position: relative !important;
|
|
2053
|
+
display: block !important;
|
|
2054
|
+
border-radius: 0 0 6px 6px;
|
|
2055
|
+
}
|
|
2056
|
+
|
|
2057
|
+
.monaco-editor-container .monaco-editor {
|
|
2058
|
+
height: 600px !important;
|
|
2059
|
+
width: 100% !important;
|
|
2060
|
+
min-width: 400px !important;
|
|
2061
|
+
position: relative !important;
|
|
2062
|
+
}
|
|
2063
|
+
|
|
2064
|
+
/* Monaco theme integration - match view/browse UI */
|
|
2065
|
+
.monaco-editor .monaco-editor-background {
|
|
2066
|
+
background-color: var(--bg-primary) !important;
|
|
2067
|
+
}
|
|
2068
|
+
|
|
2069
|
+
.monaco-editor .monaco-editor .margin {
|
|
2070
|
+
background-color: var(--bg-primary) !important;
|
|
2071
|
+
}
|
|
2072
|
+
|
|
2073
|
+
.monaco-editor .monaco-scrollable-element .scrollbar {
|
|
2074
|
+
background: var(--bg-secondary) !important;
|
|
2075
|
+
}
|
|
2076
|
+
|
|
2077
|
+
.monaco-editor .monaco-scrollable-element .slider {
|
|
2078
|
+
background: var(--border-primary) !important;
|
|
2079
|
+
}
|
|
2080
|
+
|
|
2081
|
+
.monaco-editor .monaco-scrollable-element .slider:hover {
|
|
2082
|
+
background: var(--text-secondary) !important;
|
|
2083
|
+
}
|
|
2084
|
+
|
|
2085
|
+
/* Ensure Monaco editor integrates seamlessly with container */
|
|
2086
|
+
.monaco-editor-container .monaco-editor .monaco-editor-background,
|
|
2087
|
+
.monaco-editor-container .monaco-editor .margin-view-overlays .current-line {
|
|
2088
|
+
background-color: var(--bg-primary) !important;
|
|
2089
|
+
}
|
|
2090
|
+
|
|
2091
|
+
/* Line number styling to match our theme */
|
|
2092
|
+
.monaco-editor .margin-view-overlays .line-numbers {
|
|
2093
|
+
color: var(--text-secondary) !important;
|
|
2094
|
+
}
|
|
2095
|
+
|
|
2096
|
+
.monaco-editor .margin-view-overlays .line-numbers.active-line-number {
|
|
2097
|
+
color: var(--text-primary) !important;
|
|
2098
|
+
}
|
|
2099
|
+
|
|
2100
|
+
/* Draft dialog styling */
|
|
2101
|
+
.draft-modal {
|
|
2102
|
+
max-width: 400px;
|
|
2103
|
+
text-align: center;
|
|
2104
|
+
}
|
|
2105
|
+
|
|
2106
|
+
.draft-modal h3 {
|
|
2107
|
+
margin: 0 0 12px 0;
|
|
2108
|
+
color: var(--text-accent);
|
|
2109
|
+
font-size: 18px;
|
|
2110
|
+
}
|
|
2111
|
+
|
|
2112
|
+
.draft-modal p {
|
|
2113
|
+
margin: 0 0 20px 0;
|
|
2114
|
+
color: var(--text-secondary);
|
|
2115
|
+
line-height: 1.5;
|
|
2116
|
+
}
|
|
2117
|
+
|
|
2118
|
+
.draft-actions {
|
|
2119
|
+
display: flex;
|
|
2120
|
+
gap: 8px;
|
|
2121
|
+
justify-content: center;
|
|
2122
|
+
}
|
|
2123
|
+
|
|
2124
|
+
.draft-actions .btn {
|
|
2125
|
+
flex: 1;
|
|
2126
|
+
max-width: 120px;
|
|
2127
|
+
}
|