peektea past the roadmap ๐Ÿ‘€ sorting and scrollable previews Maneshwar added sorting and scrollable previews to peektea, the terminal-based file browser. The `s` key now cycles through sort modes by name, size, or modification time, while `[` and `]` keys enable scrolling through file previews. The update also integrates bat for syntax-highlighted previews and adds scrollbars to both panels. Hello, I'm Maneshwar. I'm building git-lrc, a Micro AI code reviewer that runs on every commit. It is free and source-available on Github. Star git-lrc to help devs discover the project. Do give it a try and share your feedback. Last time I said the list was empty. That was true. Then I kept going anyway. Press s and the list sorts by size. Press it again, newest-modified first. Previwing something? Press and and scroll through the preview without leaving the peektea cli. The s key cycles through three modes: name โ†’ size โ†’ modified โ†’ name . The current mode is always visible in the hint bar: s:sorted by name , s:sorted by size , s:sorted by modified . Under the hood it's a single sort.SliceStable call inside withFilters . The sort runs on the filtered slice, so it composes with the text filter and the hidden file toggle, same composable approach as before: sort.SliceStable filtered, func i, j int bool { switch m.sortMode { case sortSize: ii, := filtered i .Info jj, := filtered j .Info return ii.Size jj.Size // largest first case sortMod: ii, := filtered i .Info jj, := filtered j .Info return ii.ModTime .After jj.ModTime // newest first default: return strings.ToLower filtered i .Name < strings.ToLower filtered j .Name } } SliceStable preserves the relative order of entries that compare equal, which keeps directories grouped sensibly when names or sizes match. The preview panel used to show the first N lines of a file and stop there. Now you can scroll through it with up and down . Each press moves a quarter of the panel height. The key insight: instead of limiting what gets loaded to the visible height, the preview now loads up to 500 lines and stores the whole thing. The rendering step slices out the visible window: lines := strings.Split m.previewContent, "\n" scroll := m.previewScroll maxScroll := len lines - ph if maxScroll < 0 { maxScroll = 0 } if scroll maxScroll { scroll = maxScroll } visible := lines scroll: if len visible ph { visible = visible :ph } body = strings.Join visible, "\n" previewScroll resets to zero whenever you move to a new file, so you always start at the top. While reworking the preview loading, I added a bat check. bat https://github.com/sharkdp/bat is a cat clone with syntax highlighting. If it's installed, peektea uses it for text previews: if , err := exec.LookPath "bat" ; err == nil { out, err := exec.Command "bat", "--color=always", "--style=plain", "--line-range", ":500", "--terminal-width", fmt.Sprintf "%d", width , path, .Output if err == nil { return strings.TrimRight string out , "\n" } } // fallback to plain text reader Same graceful-fallback pattern as chafa. Not installed? Plain text. Installed but fails on a particular file? Plain text. The preview never breaks. Both panels now have scrollbars. When the preview has more content than fits on screen, a thin โ”‚ track with a โ”ƒ thumb appears on the right edge of the preview. Same thing in the file list when there are more entries than the terminal can show. A single function handles both: func buildScrollbar total, visible, scroll int string { chars := make string, visible track := scrollTrackStyle.Render "โ”‚" thumb := scrollThumbStyle.Render "โ”ƒ" if total <= visible { for i := range chars { chars i = track } return chars } thumbSize := visible visible / total if thumbSize < 1 { thumbSize = 1 } thumbPos := scroll visible - thumbSize / total - visible for i := range chars { if i = thumbPos && i < thumbPos+thumbSize { chars i = thumb } else { chars i = track } } return chars } It returns a slice of styled characters, one per visible row that get appended to each rendered line. The thumb size scales proportionally: if half the content is visible, the thumb fills half the track. AI agents write code fast. They also silently remove logic, change behavior, and introduce bugs โ€” without telling you. You often find out in production. git-lrc fixes this. It hooks into git commit and reviews every diff before it lands. 60-second setup. Completely free. Any feedback or contributors are welcome It's online, source-available, and ready for anyone to use. โญ Star it on GitHub: | ๐Ÿ‡ฉ๐Ÿ‡ฐ Dansk https://github.com/HexmosTech/git-lrc/readme/README.da.md | ๐Ÿ‡ช๐Ÿ‡ธ Espaรฑol https://github.com/HexmosTech/git-lrc/readme/README.es.md | ๐Ÿ‡ฎ๐Ÿ‡ท Farsi https://github.com/HexmosTech/git-lrc/readme/README.fa.md | ๐Ÿ‡ซ๐Ÿ‡ฎ Suomi https://github.com/HexmosTech/git-lrc/readme/README.fi.md | ๐Ÿ‡ฏ๐Ÿ‡ต ๆ—ฅๆœฌ่ชž https://github.com/HexmosTech/git-lrc/readme/README.ja.md | ๐Ÿ‡ณ๐Ÿ‡ด Norsk https://github.com/HexmosTech/git-lrc/readme/README.nn.md | ๐Ÿ‡ต๐Ÿ‡น Portuguรชs https://github.com/HexmosTech/git-lrc/readme/README.pt.md | ๐Ÿ‡ท๐Ÿ‡บ ะ ัƒััะบะธะน https://github.com/HexmosTech/git-lrc/readme/README.ru.md | ๐Ÿ‡ฆ๐Ÿ‡ฑ Shqip https://github.com/HexmosTech/git-lrc/readme/README.sq.md | ๐Ÿ‡จ๐Ÿ‡ณ ไธญๆ–‡ https://github.com/HexmosTech/git-lrc/readme/README.zh.md | AI agents write code fast. They also silently remove logic , change behavior, and introduce bugs -- without telling you. You often find out in production. git-lrc fixes this. It hooks into git commit and reviews every diff git-lrc-intro-60s.mp4See git-lrc catch serious security issues such as leaked credentials, expensive cloud operations, and sensitive material in log statements