fix: opening a share link reads right for one file or several
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
1 file changed
+5
-5
@@ -229,7 +229,7 @@ func (m *Model) offerShare(r ref.Ref) tea.Cmd {
|
||||
m.st.Muted.Render(plural(s.Files, "env file")) + from,
|
||||
m.st.Muted.Render("encrypted with ") + m.refLabel(s.Key),
|
||||
}, []option{
|
||||
{key: "o", label: "Decrypt them…", tip: "reads the secret, then asks before saving", run: func(m *Model) tea.Cmd { return m.openShare(s) }},
|
||||
{key: "o", label: "Decrypt…", tip: "reads the secret, then asks before saving", run: func(m *Model) tea.Cmd { return m.openShare(s) }},
|
||||
})
|
||||
return nil
|
||||
}
|
||||
@@ -287,9 +287,9 @@ func (m *Model) askShareDir(msg shareOpenedMsg) tea.Cmd {
|
||||
}
|
||||
in.SetValue(dir)
|
||||
in.CursorEnd()
|
||||
lines := []string{m.st.Muted.Render("Their paths are from the repo's root.")}
|
||||
lines := []string{m.st.Muted.Render("Paths are from the repo's root.")}
|
||||
if msg.sealed.Repo != "" {
|
||||
lines = append([]string{m.st.Muted.Render(msg.sealed.Repo + " isn't among your repos: save them where?")}, lines...)
|
||||
lines = append([]string{m.repoLabel(msg.sealed.Repo) + m.st.Muted.Render(" isn't among your repos. Save where?")}, lines...)
|
||||
}
|
||||
m.prompt = &modal{
|
||||
title: "Save the files", input: &in, lines: lines,
|
||||
@@ -344,9 +344,9 @@ func (m *Model) offerWrite(files []share.File, dir string) {
|
||||
var opts []option
|
||||
switch {
|
||||
case exist == 0:
|
||||
opts = append(opts, option{key: "w", label: "Save them", run: write(false)})
|
||||
opts = append(opts, option{key: "w", label: "Save", run: write(false)})
|
||||
case exist == len(targets):
|
||||
opts = append(opts, option{key: "w", label: "Replace " + map[bool]string{true: "it", false: "them"}[exist == 1], run: write(false)})
|
||||
opts = append(opts, option{key: "w", label: "Replace", run: write(false)})
|
||||
default:
|
||||
opts = append(opts,
|
||||
option{key: "w", label: fmt.Sprintf("Save all, replacing %d", exist), run: write(false)},
|
||||
|
||||
Reference in new issue
Block a user