Skip to content

Use hidePreviewButtons for side-by-side only#83

Merged
cyanzhong merged 4 commits intomainfrom
copilot/improve-hide-preview-buttons
Mar 20, 2026
Merged

Use hidePreviewButtons for side-by-side only#83
cyanzhong merged 4 commits intomainfrom
copilot/improve-hide-preview-buttons

Conversation

Copy link
Contributor

Copilot AI commented Mar 20, 2026

hidePreviewButtons was globally hiding .cm-md-previewWrapper in full build only, regardless of view mode. Two improvements:

  • Side-by-side scoping: Selector now uses .markdown-container .cm-md-previewWrapper.markdown-container is only present in side-by-side mode, so preview buttons remain visible in other modes
  • Full build only: After discussion, lite build support was intentionally omitted to keep behavior consistent — having hidePreviewButtons partially work (only table buttons) in lite would be confusing. This follows the same pattern as syntaxAutoDetect.
  • Docs: Updated README to reflect new behavior, marking hidePreviewButtons as not applicable for lite build
if (__FULL_BUILD__) {
  // ...katex, hljs imports...
  if (hidePreviewButtons) {
    appendStyle(`.markdown-container .cm-md-previewWrapper {
      display: none !important;
    }`);
  }
}
Original prompt

This section details on the original issue you should resolve

<issue_title>Improve hidePreviewButtons</issue_title>
<issue_description>1. For lite build, hide cm-md-previewWrapper under cm-md-tableWrapper too (may not be direct child)
2. The hiding logic applies only when the view mode is "side-by-side"</issue_description>

Comments on the Issue (you are @copilot in this section)


📍 Connect Copilot coding agent with Jira, Azure Boards or Linear to delegate work to Copilot in one click without leaving your project management tool.

…te build

Co-authored-by: cyanzhong <6745066+cyanzhong@users.noreply.github.com>
Copilot AI changed the title [WIP] Update hidePreviewButtons logic for side-by-side mode Improve hidePreviewButtons: scope to side-by-side mode, support lite build Mar 20, 2026
Copilot AI requested a review from cyanzhong March 20, 2026 07:44
README.md Outdated
- `updateBehavior`: `"quiet"` shows a button, `"notify"` shows an alert, `"never"` disables update checks.
- `syncScroll`: Whether to enable scroll synchronization.
- `hidePreviewButtons`: Whether to hide the built-in preview buttons (not applicable for lite build).
- `hidePreviewButtons`: Whether to hide the built-in preview buttons in side-by-side mode (for lite build, hides preview buttons under table wrappers only).
Copy link
Contributor

Choose a reason for hiding this comment

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

@copilot I don't think we should use the word under, for users, this is just a preview button for table.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed in aa46380 — changed to "hides table preview buttons only".

…-centric "under table wrappers"

Co-authored-by: cyanzhong <6745066+cyanzhong@users.noreply.github.com>
Copilot AI requested a review from cyanzhong March 20, 2026 07:58
@cyanzhong
Copy link
Contributor

@copilot Second thoughts made me think if we should add it for lite build at all, it feels inconsistent and harder to understand the pattern, what do you think as a senior product person?

Co-authored-by: cyanzhong <6745066+cyanzhong@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Mar 20, 2026

@copilot Second thoughts made me think if we should add it for lite build at all, it feels inconsistent and harder to understand the pattern, what do you think as a senior product pers...

I agree — the inconsistency hurts more than it helps. In full build, hidePreviewButtons hides all preview buttons, but in lite it would only hide table ones. That partial behavior under the same setting name creates confusion. The lite build is already a reduced feature set, so having this be full-build-only is the expected pattern (same as syntaxAutoDetect). Removed the lite build branch in 30c08a9.

Copilot AI changed the title Improve hidePreviewButtons: scope to side-by-side mode, support lite build Improve hidePreviewButtons: scope to side-by-side mode, full build only Mar 20, 2026
@cyanzhong cyanzhong changed the title Improve hidePreviewButtons: scope to side-by-side mode, full build only Use hidePreviewButtons for side-by-side only Mar 20, 2026
@cyanzhong cyanzhong requested a review from Copilot March 20, 2026 09:02
@cyanzhong cyanzhong marked this pull request as ready for review March 20, 2026 09:02
Copy link
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 adjusts the hidePreviewButtons behavior so it only hides MarkEdit’s built-in preview buttons when the extension is in side-by-side mode, and documents that the setting is intentionally not supported in the lite build.

Changes:

  • Scope the CSS selector for hidePreviewButtons to .markdown-container so it only applies in side-by-side mode.
  • Update inline comment to reflect side-by-side-only behavior.
  • Update README setting description to match the new scoping and clarify lite build applicability.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
src/view.ts Scopes hidePreviewButtons CSS to the side-by-side container class so other modes retain built-in preview buttons.
README.md Documents that hidePreviewButtons affects side-by-side mode only and is not applicable for the lite build.

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

@cyanzhong cyanzhong merged commit 9188b35 into main Mar 20, 2026
6 checks passed
@cyanzhong cyanzhong deleted the copilot/improve-hide-preview-buttons branch March 20, 2026 09:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Improve hidePreviewButtons

3 participants