Skip to content

Hide help UI when ?post parameter is present#139

Merged
danmarshall merged 4 commits into
mainfrom
copilot/hide-help-for-chartifact-url
Nov 17, 2025
Merged

Hide help UI when ?post parameter is present#139
danmarshall merged 4 commits into
mainfrom
copilot/hide-help-for-chartifact-url

Conversation

Copilot AI commented Nov 17, 2025

Copy link
Copy Markdown
Contributor

When the viewer is used with postMessage communication (e.g., embedded in an editor), the help instructions are unnecessary UI clutter.

Changes

  • Modified packages/host/src/listener.ts to parse URL parameters and conditionally hide help when ?post is present
// Check URL parameters for file to load
if (!this.options.url || (this.options.url && !checkUrlForFile(this))) {
  show(this.loadingDiv, false);
  // Hide help if URL contains ?post parameter
  const urlParams = new URLSearchParams(window.location.search);
  const hasPostParam = urlParams.has('post');
  show(this.helpDiv, !hasPostParam);
}

Behavior

  • https://microsoft.github.io/chartifact/view/ → help visible
  • https://microsoft.github.io/chartifact/view/?post → help hidden
  • https://microsoft.github.io/chartifact/view/?load=file.md → help hidden (unchanged)
Original prompt

In the host package, hide the help if the url is https://microsoft.github.io/chartifact/view/?post


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI and others added 2 commits November 17, 2025 23:24
Co-authored-by: danmarshall <11507384+danmarshall@users.noreply.github.com>
Co-authored-by: danmarshall <11507384+danmarshall@users.noreply.github.com>
Copilot AI changed the title [WIP] Hide help in host package for specific URL Hide help UI when ?post parameter is present Nov 17, 2025
Copilot AI requested a review from danmarshall November 17, 2025 23:31
@danmarshall danmarshall marked this pull request as ready for review November 17, 2025 23:49
@danmarshall danmarshall merged commit 35c957d into main Nov 17, 2025
5 checks passed
@danmarshall danmarshall deleted the copilot/hide-help-for-chartifact-url branch November 18, 2025 00:19
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.

2 participants