Skip to content

Recall the last prompt with the Up arrow - #524

Merged
Lazarus-931 merged 6 commits into
Blaizzy:mainfrom
Lazarus-931:feature/recall-previous-prompt
Sep 9, 2026
Merged

Recall the last prompt with the Up arrow#524
Lazarus-931 merged 6 commits into
Blaizzy:mainfrom
Lazarus-931:feature/recall-previous-prompt

Conversation

@Lazarus-931

@Lazarus-931 Lazarus-931 commented Sep 8, 2026

Copy link
Copy Markdown
Collaborator

Pressing Up in an empty composer loads your last prompt back in for editing, reaching the edit flow that already existed without hunting for the small button on the sent message.

  • Recall only happens from an empty composer, so Up never stops being Up while there is text to move through and the gesture cannot discard something half-written; any modifier passes through, and an Up that recalls nothing still moves the caret.
  • A ↑ to show last hint appears in the placeholder only while the gesture would work, and retires permanently the first time it is used.
  • The editing banner is calmer and shorter: no accent colour, standard separator border, and one line saying what sending does rather than two.
Screen.Recording.2026-09-08.at.8.01.16.AM.mov

Editing the previous prompt meant hovering the sent message and finding a small
button on it. The machinery for the edit itself already existed —
beginEditingUserMessage snapshots the composer, loads the message, focuses, and
the banner above the composer explains what sending will do. This adds the
gesture that reaches it.

Up recalls only from an empty composer. Guarding on empty rather than on caret
position means Up never stops being Up while there is text to move through, and
it cannot discard something half-written: the snapshot beginEditingUserMessage
takes is for restoring a draft, not for rescuing one this gesture destroyed. Any
modifier is a selection or a jump, not a request for history, so those pass
through. The handler reports whether it recalled, so an Up that recalls nothing
still moves the caret.

A hint sits in the placeholder while — and only while — the gesture would work,
reading from the same property the gesture guards on, so the two cannot drift
into advertising something that does nothing.

Escape already cancels and restores the draft, and only the latest user message
is editable, both unchanged.
Every worktree builds to Nativ.app, so parallel checkouts overwrite each
other's output and it is not obvious which bundle came from which branch.

PRODUCT_NAME now reads NATIV_PRODUCT_NAME, which defaults to Nativ in
Signing.xcconfig and can be overridden in the git-ignored
Signing.local.xcconfig or on the command line:

    make xcode-run NATIV_PRODUCT_NAME=nativ-trace

The Makefile threads the same variable through the build, sign, run, and
smoke targets so the paths follow the rename. CFBundleDisplayName follows
it too, so a renamed build is distinguishable in the Dock as well as in
Finder.
Reads "↑ to show last", and disappears for good the first time the gesture is
used. It is a first-run affordance: once you know Up recalls the last prompt, a
permanent label in the placeholder is noise in the one place you are about to
type.

The flag lives in NativSettings so it survives relaunch, decoded with a default
like every other key, and is set by the composer — which already owns settings —
rather than by the view model, which does not.
It sits directly above the composer while you type into it, so it should read
as a state the editor is in rather than as something asking to be dealt with.

Dropped the accent colour entirely — the tinted pencil, the blue Cancel, and
the blue hairline around the whole thing. Everything is secondary now, and the
border is the standard separator. Two lines of copy ("Editing prompt" /
"Sending will replace the latest response.") became one that says what sending
does: "Replace the last response". Vertical padding 9 to 6, and one line
instead of two, which is most of the height.

The pencil stays, and so does Cancel — it carries the .cancelAction shortcut
and is the only way to back out without the keyboard.
@Lazarus-931
Lazarus-931 marked this pull request as ready for review September 8, 2026 12:02
Text("Sending will replace the latest response.")
.foregroundStyle(.secondary)
}
Text("Replace the last response")

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Should this be "Replace the last message"? I tend to think of "response" as the model response, not what I wrote.

<Scheme
LastUpgradeVersion = "2660"
version = "1.3">
LastUpgradeVersion = "1430"

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Ideally we don't go backwards here, or Xcode will put a bunch of "Recommended Project Changes" things into the Warnings & Errors panel, some of which aren't helpful/correct. Can we revert this?

I know xcodegen is the one that overwrites it -- maybe we should also add it to .gitignore so it's just a local reference.

@lucasnewman lucasnewman left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Looks good, see comments though

changed it to be simpler + clearer
Per review: xcodegen rewrote Nativ.xcscheme's LastUpgradeVersion from 2660 back
to 1430 and version from 1.3 to 1.7, which makes Xcode offer a panel of
Recommended Project Changes, not all of which are correct. Reverted to what
main has.

The revert is not durable on its own — any `xcodegen generate` reintroduces it,
which is how it reached both this branch and Blaizzy#519. Untracking the scheme so it
is only a local reference would fix it for good, but that removes a shared file
from everyone's checkout, so it wants a maintainer's call rather than being
folded in here.
Lazarus-931 added a commit to Lazarus-931/nativ that referenced this pull request Sep 8, 2026
Same regression Luca flagged on Blaizzy#524: xcodegen rewrote Nativ.xcscheme's
LastUpgradeVersion from 2660 back to 1430 and version from 1.3 to 1.7, which
makes Xcode offer a panel of Recommended Project Changes that are not all
correct. Reverted to what main has.

Not durable on its own — any `xcodegen generate` reintroduces it, which is how
it reached both branches. Untracking the scheme so it is only a local reference
would fix it for good, but that removes a shared file from everyone's checkout.
@Lazarus-931
Lazarus-931 merged commit 6d9c951 into Blaizzy:main Sep 9, 2026
1 check passed
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