Repository navigation
Commit f18b11b
committed
fix(tui): scroll the draft detail popup so long guidance stays reachable
A rejection reason has no server-side length cap, so a paragraph-length one
overflowed the fixed 22-row detail popup: the tail was clipped and the later
fields and both action hints were pushed off screen. The same overflow already
affected the unbounded rationale and security_notes fields, so fix the popup
rather than special-case the guidance line.
Split the popup's inner area into a scrolling body and a pinned hint row,
following the pattern in ui/create_provider.rs, and drive it with j/k, the
arrow keys, PageUp, PageDown, g and G. The approve and close controls now stay
on screen at every scroll position, and the bottom border carries the scroll
position.
Wrap free-form values explicitly instead of relying on Paragraph's Wrap, so the
rendered row count is exactly lines.len() and the scroll clamp cannot under-run
the content. Paragraph::line_count would answer the same question but sits
behind ratatui's unstable-rendered-line-info feature.
Add deterministic TestBackend coverage at 80x24 with a 2,000-character reason,
covering the head and tail, the pinned hints, over-scroll clamping, and the
pre-existing long-rationale case. Document the reviewer-facing guidance in the
policy advisor page.
Part of NVIDIA#1098.
Signed-off-by: Vyncint Ng <[email protected]>1 parent 30f8375 commit f18b11b
4 files changed
Lines changed: 414 additions & 49 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
711 | 711 | | |
712 | 712 | | |
713 | 713 | | |
| 714 | + | |
| 715 | + | |
| 716 | + | |
| 717 | + | |
| 718 | + | |
| 719 | + | |
| 720 | + | |
714 | 721 | | |
715 | 722 | | |
716 | 723 | | |
| |||
1032 | 1039 | | |
1033 | 1040 | | |
1034 | 1041 | | |
| 1042 | + | |
| 1043 | + | |
| 1044 | + | |
1035 | 1045 | | |
1036 | 1046 | | |
1037 | 1047 | | |
| |||
1648 | 1658 | | |
1649 | 1659 | | |
1650 | 1660 | | |
| 1661 | + | |
1651 | 1662 | | |
1652 | 1663 | | |
1653 | 1664 | | |
| |||
1856 | 1867 | | |
1857 | 1868 | | |
1858 | 1869 | | |
| 1870 | + | |
| 1871 | + | |
| 1872 | + | |
| 1873 | + | |
| 1874 | + | |
| 1875 | + | |
| 1876 | + | |
| 1877 | + | |
| 1878 | + | |
| 1879 | + | |
| 1880 | + | |
| 1881 | + | |
| 1882 | + | |
| 1883 | + | |
| 1884 | + | |
| 1885 | + | |
| 1886 | + | |
| 1887 | + | |
| 1888 | + | |
1859 | 1889 | | |
1860 | 1890 | | |
1861 | 1891 | | |
| |||
1880 | 1910 | | |
1881 | 1911 | | |
1882 | 1912 | | |
| 1913 | + | |
1883 | 1914 | | |
1884 | 1915 | | |
1885 | 1916 | | |
| |||
1893 | 1924 | | |
1894 | 1925 | | |
1895 | 1926 | | |
| 1927 | + | |
1896 | 1928 | | |
1897 | 1929 | | |
1898 | 1930 | | |
| |||
1908 | 1940 | | |
1909 | 1941 | | |
1910 | 1942 | | |
| 1943 | + | |
1911 | 1944 | | |
1912 | 1945 | | |
1913 | 1946 | | |
1914 | 1947 | | |
| 1948 | + | |
| 1949 | + | |
| 1950 | + | |
| 1951 | + | |
| 1952 | + | |
| 1953 | + | |
| 1954 | + | |
| 1955 | + | |
| 1956 | + | |
| 1957 | + | |
| 1958 | + | |
| 1959 | + | |
| 1960 | + | |
| 1961 | + | |
| 1962 | + | |
| 1963 | + | |
1915 | 1964 | | |
1916 | 1965 | | |
1917 | 1966 | | |
| |||
1937 | 1986 | | |
1938 | 1987 | | |
1939 | 1988 | | |
| 1989 | + | |
1940 | 1990 | | |
1941 | 1991 | | |
1942 | 1992 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
103 | 103 | | |
104 | 104 | | |
105 | 105 | | |
106 | | - | |
107 | | - | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
108 | 113 | | |
109 | 114 | | |
110 | 115 | | |
| |||
0 commit comments