Repository navigation
Conversation
Greptile SummaryThis PR adds a word wrap toggle and a stretched (flex-based) layout to the Agent Files content viewer. The state management plumbing ( However, there is a meaningful logic bug in the toggle implementation:
Confidence Score: 2/5
Last reviewed commit: 56362f8 |
| <label class="field" style="margin-top: 12px;"> | ||
| <span>Content</span> | ||
| <textarea | ||
| class="${params.agentFileWordWrap ? "agent-file-textarea--wrap" : ""}" |
There was a problem hiding this comment.
Word wrap "off" state never actually disables wrapping
When agentFileWordWrap is false, the agent-file-textarea--wrap class is removed, but no class is added to force non-wrapping behaviour. The browser's user-agent stylesheet for <textarea> defaults to white-space: pre-wrap, so text continues to wrap in both states — making the "off" half of the toggle a no-op visually.
A nowrap variant class should be introduced and applied in the off state so the textarea actually overflows horizontally instead of wrapping:
In components.css, add:
.agent-file-textarea--nowrap {
white-space: pre;
overflow-x: auto;
}Then in the template:
| class="${params.agentFileWordWrap ? "agent-file-textarea--wrap" : ""}" | |
| class="${params.agentFileWordWrap ? "agent-file-textarea--wrap" : "agent-file-textarea--nowrap"}" |
Prompt To Fix With AI
This is a comment left during a code review.
Path: ui/src/ui/views/agents-panels-status-files.ts
Line: 435
Comment:
**Word wrap "off" state never actually disables wrapping**
When `agentFileWordWrap` is `false`, the `agent-file-textarea--wrap` class is removed, but no class is added to force non-wrapping behaviour. The browser's user-agent stylesheet for `<textarea>` defaults to `white-space: pre-wrap`, so text continues to wrap in both states — making the "off" half of the toggle a no-op visually.
A `nowrap` variant class should be introduced and applied in the off state so the textarea actually overflows horizontally instead of wrapping:
In `components.css`, add:
```css
.agent-file-textarea--nowrap {
white-space: pre;
overflow-x: auto;
}
```
Then in the template:
```suggestion
class="${params.agentFileWordWrap ? "agent-file-textarea--wrap" : "agent-file-textarea--nowrap"}"
```
How can I resolve this? If you propose a fix, please make it concise.| .agent-file-textarea--wrap { | ||
| white-space: pre-wrap !important; | ||
| overflow-wrap: break-word; | ||
| } |
There was a problem hiding this comment.
!important is unnecessary here
No existing rule in the stylesheet sets white-space on .field textarea or .agent-files-editor .field textarea, so !important is not needed to win the specificity battle. Removing it keeps the cascade clean and avoids making it harder to override later.
| .agent-file-textarea--wrap { | |
| white-space: pre-wrap !important; | |
| overflow-wrap: break-word; | |
| } | |
| .agent-file-textarea--wrap { | |
| white-space: pre-wrap; | |
| overflow-wrap: break-word; | |
| } |
Prompt To Fix With AI
This is a comment left during a code review.
Path: ui/src/styles/components.css
Line: 2467-2470
Comment:
**`!important` is unnecessary here**
No existing rule in the stylesheet sets `white-space` on `.field textarea` or `.agent-files-editor .field textarea`, so `!important` is not needed to win the specificity battle. Removing it keeps the cascade clean and avoids making it harder to override later.
```suggestion
.agent-file-textarea--wrap {
white-space: pre-wrap;
overflow-wrap: break-word;
}
```
How can I resolve this? If you propose a fix, please make it concise.| <button | ||
| class="btn btn--sm ${params.agentFileWordWrap ? "primary" : ""}" | ||
| title="${params.agentFileWordWrap ? "Word wrap on" : "Word wrap off"}" | ||
| @click=${() => params.onToggleWordWrap()} | ||
| > | ||
| <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" width="14" height="14" style="flex-shrink:0;"> | ||
| <line x1="3" y1="6" x2="21" y2="6"/> | ||
| <path d="M3 12h15a3 3 0 0 1 0 6h-4"/> | ||
| <polyline points="14 15 11 18 14 21"/> | ||
| <line x1="3" y1="18" x2="7" y2="18"/> | ||
| </svg> | ||
| Wrap | ||
| </button> |
There was a problem hiding this comment.
Inconsistent indentation on the word wrap button
The opening <button> tag has ~42 leading spaces while the immediately following attributes are at ~32 spaces, and the other sibling buttons (Reset, Save) use consistent 14-space indentation. This misalignment is distracting in diff review and in editors.
| <button | |
| class="btn btn--sm ${params.agentFileWordWrap ? "primary" : ""}" | |
| title="${params.agentFileWordWrap ? "Word wrap on" : "Word wrap off"}" | |
| @click=${() => params.onToggleWordWrap()} | |
| > | |
| <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" width="14" height="14" style="flex-shrink:0;"> | |
| <line x1="3" y1="6" x2="21" y2="6"/> | |
| <path d="M3 12h15a3 3 0 0 1 0 6h-4"/> | |
| <polyline points="14 15 11 18 14 21"/> | |
| <line x1="3" y1="18" x2="7" y2="18"/> | |
| </svg> | |
| Wrap | |
| </button> | |
| <button | |
| class="btn btn--sm ${params.agentFileWordWrap ? "primary" : ""}" | |
| title="${params.agentFileWordWrap ? "Word wrap on" : "Word wrap off"}" | |
| @click=${() => params.onToggleWordWrap()} | |
| > | |
| <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" width="14" height="14" style="flex-shrink:0;"> | |
| <line x1="3" y1="6" x2="21" y2="6"/> | |
| <path d="M3 12h15a3 3 0 0 1 0 6h-4"/> | |
| <polyline points="14 15 11 18 14 21"/> | |
| <line x1="3" y1="18" x2="7" y2="18"/> | |
| </svg> | |
| Wrap | |
| </button> |
Prompt To Fix With AI
This is a comment left during a code review.
Path: ui/src/ui/views/agents-panels-status-files.ts
Line: 394-406
Comment:
**Inconsistent indentation on the word wrap button**
The opening `<button>` tag has ~42 leading spaces while the immediately following attributes are at ~32 spaces, and the other sibling buttons (Reset, Save) use consistent 14-space indentation. This misalignment is distracting in diff review and in editors.
```suggestion
<button
class="btn btn--sm ${params.agentFileWordWrap ? "primary" : ""}"
title="${params.agentFileWordWrap ? "Word wrap on" : "Word wrap off"}"
@click=${() => params.onToggleWordWrap()}
>
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" width="14" height="14" style="flex-shrink:0;">
<line x1="3" y1="6" x2="21" y2="6"/>
<path d="M3 12h15a3 3 0 0 1 0 6h-4"/>
<polyline points="14 15 11 18 14 21"/>
<line x1="3" y1="18" x2="7" y2="18"/>
</svg>
Wrap
</button>
```
How can I resolve this? If you propose a fix, please make it concise.Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
|
This pull request has been automatically marked as stale due to inactivity. |
|
Thanks for the context here. I swept through the related work, and this is now duplicate or superseded. Keep open: current main still lacks an Agent Files word-wrap toggle, and this PR is a focused UI feature, but the submitted branch is not merge-ready because it conflicts with current main, the off state is a no-op, and the screenshot proof only shows one UI state. Canonical path: Close this stale PR. The latest review rated it F, the branch still lacks merge-ready proof, and there has been no human follow-up after the durable review. So I’m closing this here because the remaining work is already tracked in the canonical issue. Review detailsBest possible solution: Close this stale PR. The latest review rated it F, the branch still lacks merge-ready proof, and there has been no human follow-up after the durable review. Do we have a high-confidence way to reproduce the issue? Yes for the PR blockers: source inspection of the diff shows the off state emits no nowrap class, and live GitHub metadata reports the branch as conflicting. This is not a current-main bug reproduction because current main does not include the feature. Is this the best way to solve the issue? No as-is. The maintainable path is to refresh onto current main, keep the current Agent Files state and localization structure, add explicit wrap/nowrap behavior, and prove both states visually. Security review: Security review cleared: The diff is limited to Control UI state, rendering, and CSS, with no dependency, workflow, permission, secret, network, or code-execution changes. What I checked:
Likely related people:
Codex review notes: model gpt-5.5, reasoning high; reviewed against 9ff1a4371f68. |
|
Codex review: needs changes before merge. What this changes: The PR branch adds Control UI Agent Files word-wrap state plumbing, a Wrap button, and stretched file-content styling across app state, render, view, and CSS files. Required change before merge: This is a narrow UI repair/replacement candidate: main lacks the feature, the PR has an exact off-state CSS defect, the current files and focused tests are clear, and no product or security decision is required first. Review findings:
Review detailsBest possible solution: Land a narrow Control UI implementation that wires word-wrap state through the current nested AgentFilesState/AgentsProps path, adds accessible wrap and nowrap editor states with explicit CSS, preserves the markdown preview/editor behavior, avoids unrelated stylesheet churn, and covers both toggle states in focused render tests. Full review comments:
Overall correctness: patch is incorrect Acceptance criteria:
What I checked:
Likely related people:
Remaining risk / open question:
Codex review notes: model gpt-5.5, reasoning high; reviewed against e46dccb35374. |
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
ClawSweeper PR egg 🎁 Pass real behavior proof to wake the egg and unlock a hatchable treat. Where did the egg go?
|
|
ClawSweeper applied the proposed close for this PR.
|
Summary
Describe the problem and fix in 2–5 bullets:
Change Type (select all)
Scope (select all touched areas)
Linked Issue/PR
User-visible / Behavior Changes
List user-visible changes (including defaults/config).
If none, write
None.Security Impact (required)
Yes/No) NoYes/No) NoYes/No) NoYes/No) NoYes/No) NoYes, explain risk + mitigation:Repro + Verification
Environment
Steps
Expected
Actual
Evidence
Attach at least one:
Human Verification (required)
What you personally verified (not just CI), and how:
Compatibility / Migration
Yes/No).Yes/No)Yes/No)Failure Recovery (if this breaks)
Risks and Mitigations
List only real risks for this PR. Add/remove entries as needed. If none, write
None.