Co-authored-by: Albert Jiang <aj@mistral.ai>
Co-authored-by: Clément Drouin <clement.drouin@mistral.ai>
Co-authored-by: Laure Hugo <201583486+laure0303@users.noreply.github.com>
Co-authored-by: Mathias Gesbert <mathias.gesbert@mistral.ai>
Co-authored-by: Mert Unsal <mert.unsal@mistral.ai>
Co-authored-by: Michel Thomazo <51709227+michelTho@users.noreply.github.com>
Co-authored-by: Paul VEZIA <166131032+le-codeur-rapide@users.noreply.github.com>
Co-authored-by: Pierre Rossinès <pierre.rossines@mistral.ai>
Co-authored-by: Quentin <quentin.torroba@mistral.ai>
Co-authored-by: Mistral Vibe <vibe@mistral.ai>
This commit is contained in:
maiengineering 2026-07-01 19:03:09 +02:00 committed by GitHub
parent 4e495f658d
commit ac8f1a09fd
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
83 changed files with 1979 additions and 572 deletions

View file

@ -37,13 +37,12 @@
.terminal-r3 { fill: #68a0b3 }
.terminal-r4 { fill: #d0b344;font-weight: bold }
.terminal-r5 { fill: #868887 }
.terminal-r6 { fill: #cc555a;font-weight: bold }
.terminal-r6 { fill: #cc555a }
.terminal-r7 { fill: #8d7b39 }
.terminal-r8 { fill: #98a84b }
.terminal-r9 { fill: #d0b344 }
.terminal-r10 { fill: #98a84b;font-weight: bold }
.terminal-r11 { fill: #cc555a }
.terminal-r12 { fill: #6b753d;font-weight: bold }
.terminal-r11 { fill: #6b753d;font-weight: bold }
</style>
<defs>
@ -174,9 +173,9 @@
</text><text class="terminal-r1" x="0" y="556.8" textLength="12.2" clip-path="url(#terminal-line-22)"></text><text class="terminal-r1" x="1207.8" y="556.8" textLength="12.2" clip-path="url(#terminal-line-22)"></text><text class="terminal-r1" x="1220" y="556.8" textLength="12.2" clip-path="url(#terminal-line-22)">
</text><text class="terminal-r1" x="0" y="581.2" textLength="12.2" clip-path="url(#terminal-line-23)"></text><text class="terminal-r1" x="24.4" y="581.2" textLength="207.4" clip-path="url(#terminal-line-23)">&#160;&#160;3.&#160;Always&#160;allow</text><text class="terminal-r1" x="1207.8" y="581.2" textLength="12.2" clip-path="url(#terminal-line-23)"></text><text class="terminal-r1" x="1220" y="581.2" textLength="12.2" clip-path="url(#terminal-line-23)">
</text><text class="terminal-r1" x="0" y="605.6" textLength="12.2" clip-path="url(#terminal-line-24)"></text><text class="terminal-r1" x="1207.8" y="605.6" textLength="12.2" clip-path="url(#terminal-line-24)"></text><text class="terminal-r1" x="1220" y="605.6" textLength="12.2" clip-path="url(#terminal-line-24)">
</text><text class="terminal-r1" x="0" y="630" textLength="12.2" clip-path="url(#terminal-line-25)"></text><text class="terminal-r11" x="24.4" y="630" textLength="109.8" clip-path="url(#terminal-line-25)">&#160;&#160;4.&#160;Deny</text><text class="terminal-r1" x="1207.8" y="630" textLength="12.2" clip-path="url(#terminal-line-25)"></text><text class="terminal-r1" x="1220" y="630" textLength="12.2" clip-path="url(#terminal-line-25)">
</text><text class="terminal-r1" x="0" y="630" textLength="12.2" clip-path="url(#terminal-line-25)"></text><text class="terminal-r6" x="24.4" y="630" textLength="109.8" clip-path="url(#terminal-line-25)">&#160;&#160;4.&#160;Deny</text><text class="terminal-r1" x="1207.8" y="630" textLength="12.2" clip-path="url(#terminal-line-25)"></text><text class="terminal-r1" x="1220" y="630" textLength="12.2" clip-path="url(#terminal-line-25)">
</text><text class="terminal-r1" x="0" y="654.4" textLength="12.2" clip-path="url(#terminal-line-26)"></text><text class="terminal-r1" x="1207.8" y="654.4" textLength="12.2" clip-path="url(#terminal-line-26)"></text><text class="terminal-r1" x="1220" y="654.4" textLength="12.2" clip-path="url(#terminal-line-26)">
</text><text class="terminal-r1" x="0" y="678.8" textLength="12.2" clip-path="url(#terminal-line-27)"></text><text class="terminal-r12" x="24.4" y="678.8" textLength="61" clip-path="url(#terminal-line-27)">↑↓/jk</text><text class="terminal-r5" x="85.4" y="678.8" textLength="134.2" clip-path="url(#terminal-line-27)">&#160;navigate&#160;&#160;</text><text class="terminal-r12" x="219.6" y="678.8" textLength="61" clip-path="url(#terminal-line-27)">Enter</text><text class="terminal-r5" x="280.6" y="678.8" textLength="109.8" clip-path="url(#terminal-line-27)">&#160;select&#160;&#160;</text><text class="terminal-r12" x="390.4" y="678.8" textLength="36.6" clip-path="url(#terminal-line-27)">Esc</text><text class="terminal-r5" x="427" y="678.8" textLength="85.4" clip-path="url(#terminal-line-27)">&#160;reject</text><text class="terminal-r1" x="1207.8" y="678.8" textLength="12.2" clip-path="url(#terminal-line-27)"></text><text class="terminal-r1" x="1220" y="678.8" textLength="12.2" clip-path="url(#terminal-line-27)">
</text><text class="terminal-r1" x="0" y="678.8" textLength="12.2" clip-path="url(#terminal-line-27)"></text><text class="terminal-r11" x="24.4" y="678.8" textLength="61" clip-path="url(#terminal-line-27)">↑↓/jk</text><text class="terminal-r5" x="85.4" y="678.8" textLength="134.2" clip-path="url(#terminal-line-27)">&#160;navigate&#160;&#160;</text><text class="terminal-r11" x="219.6" y="678.8" textLength="61" clip-path="url(#terminal-line-27)">Enter</text><text class="terminal-r5" x="280.6" y="678.8" textLength="109.8" clip-path="url(#terminal-line-27)">&#160;select&#160;&#160;</text><text class="terminal-r11" x="390.4" y="678.8" textLength="36.6" clip-path="url(#terminal-line-27)">Esc</text><text class="terminal-r5" x="427" y="678.8" textLength="85.4" clip-path="url(#terminal-line-27)">&#160;reject</text><text class="terminal-r1" x="1207.8" y="678.8" textLength="12.2" clip-path="url(#terminal-line-27)"></text><text class="terminal-r1" x="1220" y="678.8" textLength="12.2" clip-path="url(#terminal-line-27)">
</text><text class="terminal-r1" x="0" y="703.2" textLength="1220" clip-path="url(#terminal-line-28)">└──────────────────────────────────────────────────────────────────────────────────────────────────┘</text><text class="terminal-r1" x="1220" y="703.2" textLength="12.2" clip-path="url(#terminal-line-28)">
</text><text class="terminal-r5" x="0" y="727.6" textLength="158.6" clip-path="url(#terminal-line-29)">/test/workdir</text><text class="terminal-r5" x="1000.4" y="727.6" textLength="219.6" clip-path="url(#terminal-line-29)">0/200k&#160;tokens&#160;(0%)</text>
</g>

Before

Width:  |  Height:  |  Size: 18 KiB

After

Width:  |  Height:  |  Size: 17 KiB

Before After
Before After

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 47 KiB

File diff suppressed because one or more lines are too long

Before

Width:  |  Height:  |  Size: 34 KiB

After

Width:  |  Height:  |  Size: 35 KiB

Before After
Before After

View file

@ -45,9 +45,10 @@ REPLACE_ALL_CONTENT = "\n".join([
" count = count + 1",
" return count",
"",
"def reset():",
" count = 0",
" return count",
"class Counter:",
" def reset(self):",
" count = 0 # start over",
" return count",
])
@ -69,6 +70,28 @@ class EditReplaceAllApprovalApp(BaseSnapshotTestApp):
await self._switch_to_approval_app("edit", args)
LONG_OLD = " message = " + " + ".join(f'"word_{i}"' for i in range(40))
LONG_NEW = " message = " + " + ".join(f'"token_{i}"' for i in range(40))
OVERFLOW_CONTENT = "\n".join(["def build_message():", LONG_OLD, " return message"])
class EditOverflowApprovalApp(BaseSnapshotTestApp):
_diff_theme: str = "tokyo-night"
async def on_ready(self) -> None:
await super().on_ready()
self.theme = self._diff_theme
path = Path("src/message.py")
path.parent.mkdir(parents=True, exist_ok=True)
path.write_text(OVERFLOW_CONTENT)
args = EditArgs(
file_path="src/message.py",
old_string=f"{LONG_OLD}\n return message",
new_string=f"{LONG_NEW}\n return message.upper()",
)
await self._switch_to_approval_app("edit", args)
def test_snapshot_edit_approval_diff(snap_compare: SnapCompare) -> None:
async def run_before(pilot: Pilot) -> None:
await pilot.pause(0.3)
@ -100,3 +123,16 @@ def test_snapshot_edit_approval_diff_replace_all(snap_compare: SnapCompare) -> N
terminal_size=(100, 30),
run_before=run_before,
)
def test_snapshot_edit_approval_diff_horizontal_overflow(
snap_compare: SnapCompare,
) -> None:
async def run_before(pilot: Pilot) -> None:
await pilot.pause(0.3)
assert snap_compare(
"test_ui_snapshot_edit_diff.py:EditOverflowApprovalApp",
terminal_size=(100, 30),
run_before=run_before,
)