@@ -133,7 +133,7 @@ func RenderFocusView(mysis MysisInfo, logs []LogEntry, width, height int, isLoad
133133 }
134134
135135 // RenderFocusViewWithViewport renders the detailed mysis view using a scrollable viewport.
136-func RenderFocusViewWithViewport(mysis MysisInfo, vp viewport.Model, width int, isLoading bool, spinnerView string, autoScroll bool, verbose bool) string {
136+func RenderFocusViewWithViewport(mysis MysisInfo, vp viewport.Model, width int, isLoading bool, spinnerView string, autoScroll bool, verbose bool, totalLines int) string {
137137 var sections []string
138138
139139 // Header with mysis name - spans full width
@@ -171,9 +171,33 @@ func RenderFocusViewWithViewport(mysis MysisInfo, vp viewport.Model, width int,
171171 logTitle := renderSectionTitleWithSuffix("CONVERSATION LOG", scrollInfo, width)
172172 sections = append(sections, logTitle)
173173
174- // Viewport content (scrollable)
175- // Add horizontal padding (2 spaces each side) for content inside panel border
176- vpView := logStyle.Width(width-2).Padding(0, 2).Render(vp.View())
174+ // Viewport content (scrollable) with scrollbar
175+ // Render scrollbar based on viewport state
176+ scrollOffset := vp.YOffset
177+ scrollbarStr := renderScrollbar(vp.Height, totalLines, scrollOffset)
178+ scrollbarLines := strings.Split(scrollbarStr, "\n")
179+
180+ // Get viewport content lines
181+ vpContentLines := strings.Split(vp.View(), "\n")
182+
183+ // Combine each line with scrollbar
184+ combinedLines := make([]string, vp.Height)
185+ for i := 0; i < vp.Height; i++ {
186+ var contentLine string
187+ if i < len(vpContentLines) {
188+ contentLine = vpContentLines[i]
189+ }
190+ var scrollLine string
191+ if i < len(scrollbarLines) {
192+ scrollLine = " " + scrollbarLines[i] // Space before scrollbar
193+ } else {
194+ scrollLine = " " // Empty if no scrollbar line
195+ }
196+ combinedLines[i] = contentLine + scrollLine
197+ }
198+
199+ combinedContent := strings.Join(combinedLines, "\n")
200+ vpView := logStyle.Width(width-2).Padding(0, 2).Render(combinedContent)
177201 sections = append(sections, vpView)
178202
179203 // Footer with scroll hints and verbose toggle