From dd1cd27e2e8e3febb2f658d2f75a58183639df65 Mon Sep 17 00:00:00 2001 From: Ireneusz Patalas Date: Wed, 25 Mar 2026 11:22:11 +0100 Subject: [PATCH 1/2] Update website with Chocolatey info --- .github/workflows/website-preview.yml | 101 +++++++++++++++++++++++++ website/index.html | 103 ++++++++++++++++++++++++++ 2 files changed, 204 insertions(+) create mode 100644 .github/workflows/website-preview.yml diff --git a/.github/workflows/website-preview.yml b/.github/workflows/website-preview.yml new file mode 100644 index 0000000..c602efe --- /dev/null +++ b/.github/workflows/website-preview.yml @@ -0,0 +1,101 @@ +name: Website Preview + +on: + pull_request: + branches: + - main + paths: + - "website/**" + types: + - opened + - synchronize + - reopened + +permissions: + contents: read + pull-requests: write + +jobs: + preview: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v6 + + - name: Resolve version + run: | + LATEST=$(curl -s \ + -H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" \ + "https://api.github.com/repos/${{ github.repository }}/releases/latest" \ + | jq -r '.tag_name') + echo "VERSION=${LATEST}" >> $GITHUB_ENV + + - name: Inject version into HTML + run: | + sed -i "s/{{VERSION}}/${{ env.VERSION }}/g" website/*.html + + - name: Minify HTML + run: | + npx html-minifier-terser \ + --input-dir website \ + --output-dir website \ + --file-ext html \ + --collapse-whitespace \ + --remove-comments \ + --remove-redundant-attributes \ + --remove-script-type-attributes \ + --remove-style-link-type-attributes \ + --minify-css true \ + --minify-js true + + - name: Deploy preview to Cloudflare Pages + id: deploy + uses: cloudflare/wrangler-action@v3 + with: + apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }} + accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }} + command: pages deploy website --project-name=app-switcher --commit-dirty=true --branch=pr-${{ github.event.pull_request.number }} + + - name: Comment preview URL on PR + uses: actions/github-script@v7 + with: + script: | + const deploymentUrl = '${{ steps.deploy.outputs.deployment-url }}'; + const sha = context.payload.pull_request.head.sha.slice(0, 7); + const body = [ + '## ๐Ÿš€ Website Preview', + '', + '| | |', + '|---|---|', + `| **Preview URL** | ${deploymentUrl} |`, + `| **Commit** | \`${sha}\` |`, + `| **Updated** | ${new Date().toUTCString()} |`, + '', + '_This comment is updated automatically on each push._', + ].join('\n'); + + const { data: comments } = await github.rest.issues.listComments({ + owner: context.repo.owner, + repo: context.repo.repo, + issue_number: context.issue.number, + }); + + const marker = '## ๐Ÿš€ Website Preview'; + const existing = comments.find( + c => c.user.login === 'github-actions[bot]' && c.body.includes(marker) + ); + + if (existing) { + await github.rest.issues.updateComment({ + owner: context.repo.owner, + repo: context.repo.repo, + comment_id: existing.id, + body, + }); + } else { + await github.rest.issues.createComment({ + owner: context.repo.owner, + repo: context.repo.repo, + issue_number: context.issue.number, + body, + }); + } diff --git a/website/index.html b/website/index.html index 1dcc7d7..407a34e 100644 --- a/website/index.html +++ b/website/index.html @@ -248,6 +248,67 @@ color: var(--muted); } + .install-command { + margin-top: 0.85rem; + display: inline-flex; + align-items: center; + justify-content: center; + flex-wrap: wrap; + gap: 0.5rem; + max-width: 100%; + background: var(--surface); + border: 1px solid var(--border); + border-radius: 8px; + padding: 0.45rem 0.75rem; + font-size: 0.85rem; + } + + .install-command-label { + color: var(--muted); + font-weight: 500; + } + + .install-command-code { + font-family: Consolas, 'Courier New', monospace; + color: var(--text); + max-width: 100%; + overflow-wrap: anywhere; + } + + .install-command-copy { + background: none; + border: none; + cursor: pointer; + color: var(--muted); + padding: 0; + display: flex; + align-items: center; + transition: color 0.15s; + } + + .install-command-copy:hover, + .install-command-copy:focus-visible { + color: var(--text); + } + + .install-command-copy:focus-visible { + outline: 2px solid var(--accent); + outline-offset: 4px; + border-radius: 4px; + } + + .visually-hidden { + position: absolute; + width: 1px; + height: 1px; + padding: 0; + margin: -1px; + overflow: hidden; + clip: rect(0, 0, 0, 0); + white-space: nowrap; + border: 0; + } + /* DEMO GIF */ .demo { max-width: 860px; @@ -680,6 +741,9 @@

Switch apps in an instant.
No more Alt+Tab.

๐Ÿ—œ๏ธ Portable (.zip) No install needed
+ ๐Ÿซ + Chocolatey choco install +
All releases on GitHub โ†’ @@ -687,6 +751,19 @@

Switch apps in an instant.
No more Alt+Tab.

See it in action

Windows 10 2004+ / 11 ยท Free ยท {{VERSION}}

+
+ via Chocolatey: + choco install ipatalas-appswitcher + + +
@@ -989,6 +1066,32 @@

Ready to ditch Alt+Tab?

answer.setAttribute('aria-hidden', 'false'); } } + + const copyIconMarkup = ''; + const copiedIconMarkup = ''; + + function setCopyFeedback(button, statusText, iconMarkup, ariaLabel) { + const icon = button.querySelector('svg'); + const status = button.parentElement.querySelector('.visually-hidden'); + + icon.innerHTML = iconMarkup; + button.setAttribute('aria-label', ariaLabel); + status.textContent = statusText; + + clearTimeout(button._copyResetTimeout); + button._copyResetTimeout = setTimeout(() => { + icon.innerHTML = copyIconMarkup; + button.setAttribute('aria-label', 'Copy Chocolatey install command'); + status.textContent = ''; + }, 1500); + } + + async function copyChoco(button) { + const command = button.parentElement.querySelector('.install-command-code').textContent.trim(); + + await navigator.clipboard.writeText(command); + setCopyFeedback(button, 'Copied Chocolatey install command', copiedIconMarkup, 'Copied Chocolatey install command'); + } From bcf4d63cf6cfb0d02e072f8d3c854ec586183b8c Mon Sep 17 00:00:00 2001 From: Ireneusz Patalas Date: Wed, 25 Mar 2026 11:27:44 +0100 Subject: [PATCH 2/2] CI workflow should not trigger when other workflows are modified --- .github/workflows/ci.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 9845074..d16e538 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -6,7 +6,8 @@ on: - "**" paths-ignore: - "website/**" - - ".github/workflows/website.yml" + - ".github/workflows/*.yml" + - "!.github/workflows/ci.yml" - "*.md" jobs: