Skip to content

Refine markdown path detection in CodeView#71

Merged
BunsDev merged 2 commits into
OpenCoven:mainfrom
qkal:codex/markdown-codeview-path-detection
May 20, 2026
Merged

Refine markdown path detection in CodeView#71
BunsDev merged 2 commits into
OpenCoven:mainfrom
qkal:codex/markdown-codeview-path-detection

Conversation

@qkal
Copy link
Copy Markdown
Contributor

@qkal qkal commented May 19, 2026

Summary

  • Deduplicate CodeView markdown path detection into shared helpers so markdown-specific UI decisions use the same precedence.
  • Apply that shared detection to both the markdown preview toggle and the left-padding behavior for markdown tabs.
  • Add focused regression tests covering path precedence: live local path first, then tab path, then source path.

Verification

  • cargo fmt --all
  • cargo test -p warp-app markdown_path_detection --lib (3 passed; 0 failed; 3992 filtered out)
  • git diff --check

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR refactors how CodeView decides whether the active view should be treated as “Markdown”, centralizing path-precedence logic so both the Markdown preview toggle and Markdown-specific layout behavior follow the same rules.

Changes:

  • Introduces shared helpers to pick a preferred path (local path → tab path → source path) and detect Markdown from it.
  • Reuses the shared Markdown detection for both the Markdown mode segmented control and the render-time padding behavior.
  • Adds focused unit tests covering the intended precedence order for Markdown detection.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread app/src/code/view.rs Outdated
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
@BunsDev BunsDev merged commit 643925b into OpenCoven:main May 20, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants