Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
61 changes: 60 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -329,6 +329,32 @@ jobs:
# half-written target directory into the next release.
cache-on-failure: false

# The bundler's own tools: NSIS, nsis_tauri_utils.dll and WiX on Windows, linuxdeploy,
# its plugins and AppRun on Linux. tauri-bundler downloads each from GitHub into
# `<cache dir>/tauri` and skips any that is already there, so restoring that directory
# takes GitHub out of the bundle step. v1.11.5's first attempt lost both x86_64 legs to
# it: a 504 on nsis_tauri_utils.dll, and linuxdeploy failing after a download in the
# same two minutes - with the binaries already built and every other leg green.
#
# Keyed on the exact @tauri-apps/cli version, which is what decides the tool versions.
# No `restore-keys`: the bundler only checks that a tool's folder exists, not which
# version is in it, so a cache from an older CLI would bundle with its old NSIS without
# a word. A new CLI version is one cold download per leg, then cached again.
- name: Read the Tauri CLI version
id: tauri_cli
shell: bash
run: |
echo "version=$(node -p "require('./package-lock.json').packages['node_modules/@tauri-apps/cli'].version")" >> "$GITHUB_OUTPUT"

- name: Cache Tauri bundler tools
uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
with:
path: |
~/.cache/tauri
~/Library/Caches/tauri
~/AppData/Local/tauri
key: tauri-tools-${{ matrix.cache_key }}-cli-${{ steps.tauri_cli.outputs.version }}

# Same widening as above, and it matters more here: skipping this step does not fail
# the leg, it fails the build twenty minutes later with a missing webkit2gtk.
- name: install dependencies (ubuntu only)
Expand Down Expand Up @@ -459,7 +485,10 @@ jobs:
printf '%s\n' "$delim"
} >> "$GITHUB_ENV"

- uses: tauri-apps/tauri-action@1deb371b0cd8bd54025b384f1cd735e725c4060f # action-v1.0.0
# Allowed to fail once - see "Build, second attempt" below.
- id: build
continue-on-error: true
uses: tauri-apps/tauri-action@1deb371b0cd8bd54025b384f1cd735e725c4060f # action-v1.0.0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
Expand Down Expand Up @@ -506,6 +535,36 @@ jobs:

args: ${{ matrix.args }}

# One retry, for the network rather than the code. A leg that fails here costs the whole
# release - `cleanup` deletes the draft - and the failures seen so far were GitHub
# answering 504 to a download in the middle of bundling, after a clean compile. The
# second attempt reuses the compiled target directory, so it only re-bundles: about a
# minute, against twenty for a re-run of the release. A real build error fails both
# attempts the same way and the leg still goes red.
#
# Safe after a partial first attempt: tauri-action deletes an asset of the same name
# before uploading it again, and latest.json is rewritten whole. The inputs must stay
# identical to the step above.
- name: Wait before the second attempt
if: steps.build.outcome == 'failure'
shell: bash
run: |
echo "::warning::The first build attempt failed; retrying once in 60 seconds."
sleep 60

- name: Build, second attempt
if: steps.build.outcome == 'failure'
uses: tauri-apps/tauri-action@1deb371b0cd8bd54025b384f1cd735e725c4060f # action-v1.0.0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
releaseId: ${{ needs.draft.outputs.release_id }}
releaseBody: ${{ env.RELEASE_BODY }}
uploadUpdaterJson: true
releaseDraft: true
prerelease: ${{ needs.prepare.outputs.prerelease }}
args: ${{ matrix.args }}

# The signing keys went into $GITHUB_ENV above, conditionally, because an exported
# empty value makes the bundler try to sign with nothing and fail - so they cannot
# simply be scoped to the tauri-action step with `env:`. That leaves them visible to
Expand Down
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,15 @@ popover, not for the person who wrote the commit.

## [Unreleased]

## [1.11.6] - 2026-11-05

### Fixed

- **The list and heading shortcuts work on an empty line again.** Pressing Ctrl+Shift+8,
Ctrl+Shift+7 or Ctrl+Alt+3 (Cmd on macOS) on an empty line did nothing, so you had to type
something first and add the marker afterwards. They now start the bullet, numbered item or
heading right there, with the cursor after the marker

## [1.11.5] - 2026-11-05

### Fixed
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "stashpad",
"version": "1.11.5",
"version": "1.11.6",
"description": "The staging area for your AI context.",
"author": {
"name": "Nico Wiedemann",
Expand Down
2 changes: 1 addition & 1 deletion src-tauri/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion src-tauri/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "stashpad"
version = "1.11.5"
version = "1.11.6"
description = "The staging area for your AI context."
authors = ["Nico Wiedemann <nico.wiedemann@gmail.com>"]
repository = "https://github.com/EarMaster/stashpad"
Expand Down
2 changes: 1 addition & 1 deletion src-tauri/tauri.conf.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"$schema": "../node_modules/@tauri-apps/cli/config.schema.json",
"productName": "stashpad",
"version": "1.11.5",
"version": "1.11.6",
"identifier": "org.stashpad",
"build": {
"frontendDist": "../dist",
Expand Down
13 changes: 13 additions & 0 deletions src/lib/utils/__tests__/markdown-format.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,19 @@ describe('applyLinePrefix', () => {
expect(result.content).toBe('- one\n\n- two');
});

it('starts an item on an empty line, with the caret after the marker', () => {
// Treating the line like any other blank one made the shortcut do nothing there,
// which is exactly where a list is usually started.
expect(marked(applyLinePrefix('one\n\ntwo', 4, 4, '- '))).toBe('one\n- ||\ntwo');
expect(marked(applyLinePrefix('', 0, 0, '1. '))).toBe('1. ||');
expect(marked(applyLinePrefix('one\n ', 6, 6, '### '))).toBe('one\n### ||');
});

it('toggles an item just started on an empty line back off', () => {
expect(applyLinePrefix('- ', 2, 2, '- ').content).toBe('');
expect(applyLinePrefix('1. ', 3, 3, '1. ').content).toBe('');
});

it('toggles off even when the selection contains a blank line', () => {
// Counting the blank line as "not prefixed" meant a selection like this never
// read as fully prefixed, so it kept adding instead of removing.
Expand Down
13 changes: 13 additions & 0 deletions src/lib/utils/markdown-format.ts
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,19 @@ export function applyLinePrefix(
// bare `###`, and counting it would stop a mixed selection ever reading as "all
// prefixed" and so make the button impossible to toggle off.
const filled = lines.filter((line) => line.trim());

// An empty line on its own is the one place an empty item is wanted: it is how a list
// or heading is started before anything is typed. Skipping it like any other blank line
// made the shortcut do nothing there.
if (filled.length === 0 && lines.length === 1) {
const caret = lineStart + prefix.length;
return {
content: content.slice(0, lineStart) + prefix + content.slice(lineEnd),
selectionStart: caret,
selectionEnd: caret,
};
}

const allPrefixed = filled.length > 0 && filled.every(has);

let counter = 0;
Expand Down
Loading