Commit 81a006d
Fix MD preview bleeding into log view after file switch
Root cause: showMarkdownPreview() set logViewerWrapper.style.display='none'
as an inline style. In edge cases (rapid tab switching, async timing) this
inline style leaked onto newly-created wrapper elements.
Fix:
- Replace inline style with CSS class .markdown-active on editorContainer
(.editor-container.markdown-active .log-viewer-wrapper { display:none })
— CSS class cannot leak across DOM element recreation
- Add hideMarkdownPreview() as the single authoritative reset function:
hides div, clears innerHTML, removes markdown-active class, resets button
- All code paths (loadFile, switchToTab) now call hideMarkdownPreview() first,
then showMarkdownPreview() if the new file is markdown
- showMarkdownPreview() guard (isMarkdownFile check) prevents accidental re-show
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>1 parent 60662b1 commit 81a006d
2 files changed
Lines changed: 92 additions & 37 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9327 | 9327 | | |
9328 | 9328 | | |
9329 | 9329 | | |
9330 | | - | |
9331 | | - | |
| 9330 | + | |
| 9331 | + | |
9332 | 9332 | | |
9333 | | - | |
9334 | | - | |
9335 | | - | |
9336 | | - | |
9337 | | - | |
9338 | | - | |
9339 | | - | |
| 9333 | + | |
9340 | 9334 | | |
9341 | 9335 | | |
9342 | 9336 | | |
| |||
9395 | 9389 | | |
9396 | 9390 | | |
9397 | 9391 | | |
9398 | | - | |
9399 | | - | |
9400 | | - | |
9401 | 9392 | | |
9402 | 9393 | | |
9403 | 9394 | | |
| |||
12112 | 12103 | | |
12113 | 12104 | | |
12114 | 12105 | | |
12115 | | - | |
12116 | | - | |
12117 | | - | |
12118 | | - | |
12119 | | - | |
12120 | | - | |
| 12106 | + | |
| 12107 | + | |
12121 | 12108 | | |
12122 | 12109 | | |
12123 | 12110 | | |
12124 | 12111 | | |
12125 | 12112 | | |
12126 | 12113 | | |
12127 | | - | |
| 12114 | + | |
12128 | 12115 | | |
12129 | 12116 | | |
| 12117 | + | |
| 12118 | + | |
| 12119 | + | |
| 12120 | + | |
| 12121 | + | |
12130 | 12122 | | |
12131 | | - | |
12132 | | - | |
12133 | | - | |
12134 | | - | |
12135 | | - | |
| 12123 | + | |
| 12124 | + | |
| 12125 | + | |
| 12126 | + | |
12136 | 12127 | | |
12137 | 12128 | | |
12138 | 12129 | | |
| |||
14272 | 14263 | | |
14273 | 14264 | | |
14274 | 14265 | | |
| 14266 | + | |
14275 | 14267 | | |
14276 | | - | |
14277 | | - | |
14278 | | - | |
14279 | 14268 | | |
14280 | 14269 | | |
14281 | | - | |
14282 | | - | |
14283 | | - | |
14284 | | - | |
14285 | | - | |
14286 | | - | |
14287 | | - | |
14288 | | - | |
14289 | | - | |
14290 | | - | |
14291 | 14270 | | |
14292 | 14271 | | |
14293 | 14272 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4366 | 4366 | | |
4367 | 4367 | | |
4368 | 4368 | | |
| 4369 | + | |
| 4370 | + | |
| 4371 | + | |
| 4372 | + | |
| 4373 | + | |
| 4374 | + | |
| 4375 | + | |
| 4376 | + | |
| 4377 | + | |
| 4378 | + | |
| 4379 | + | |
| 4380 | + | |
| 4381 | + | |
| 4382 | + | |
| 4383 | + | |
| 4384 | + | |
| 4385 | + | |
| 4386 | + | |
| 4387 | + | |
| 4388 | + | |
| 4389 | + | |
| 4390 | + | |
| 4391 | + | |
| 4392 | + | |
| 4393 | + | |
| 4394 | + | |
| 4395 | + | |
| 4396 | + | |
| 4397 | + | |
| 4398 | + | |
| 4399 | + | |
| 4400 | + | |
| 4401 | + | |
| 4402 | + | |
| 4403 | + | |
| 4404 | + | |
| 4405 | + | |
| 4406 | + | |
| 4407 | + | |
| 4408 | + | |
| 4409 | + | |
| 4410 | + | |
| 4411 | + | |
| 4412 | + | |
| 4413 | + | |
| 4414 | + | |
| 4415 | + | |
| 4416 | + | |
| 4417 | + | |
| 4418 | + | |
| 4419 | + | |
| 4420 | + | |
| 4421 | + | |
| 4422 | + | |
| 4423 | + | |
| 4424 | + | |
| 4425 | + | |
| 4426 | + | |
| 4427 | + | |
| 4428 | + | |
| 4429 | + | |
| 4430 | + | |
| 4431 | + | |
| 4432 | + | |
| 4433 | + | |
| 4434 | + | |
| 4435 | + | |
| 4436 | + | |
| 4437 | + | |
| 4438 | + | |
| 4439 | + | |
| 4440 | + | |
4369 | 4441 | | |
4370 | 4442 | | |
4371 | 4443 | | |
| |||
4819 | 4891 | | |
4820 | 4892 | | |
4821 | 4893 | | |
| 4894 | + | |
| 4895 | + | |
| 4896 | + | |
| 4897 | + | |
4822 | 4898 | | |
4823 | 4899 | | |
4824 | 4900 | | |
| |||
0 commit comments