Browse Source

Add "This relay only" checkbox to compose UI

- Add localOnly checkbox to ComposeView, defaulting to checked
- When checked, event is published only to the local ORLY relay
- When unchecked, event is also broadcast to configured relays
  via nostrClient.publish() (SimplePool)
- Bump version to v0.58.4

Files modified:
- app/web/src/ComposeView.svelte: Add localOnly prop, checkbox UI, styles
- app/web/src/App.svelte: Wire composeLocalOnly state, conditional broadcast
- app/web/dist/: Rebuilt bundle
- pkg/version/version: v0.58.3 -> v0.58.4

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
main v0.58.4
woikos 4 months ago
parent
commit
2181411f06
No known key found for this signature in database
  1. 2
      app/web/dist/bundle.css
  2. 26
      app/web/dist/bundle.js
  3. 2
      app/web/dist/bundle.js.map
  4. 17
      app/web/src/App.svelte
  5. 23
      app/web/src/ComposeView.svelte
  6. 2
      pkg/version/version

2
app/web/dist/bundle.css vendored

File diff suppressed because one or more lines are too long

26
app/web/dist/bundle.js vendored

File diff suppressed because one or more lines are too long

2
app/web/dist/bundle.js.map vendored

File diff suppressed because one or more lines are too long

17
app/web/src/App.svelte

@ -147,6 +147,7 @@ @@ -147,6 +147,7 @@
// Compose tab state
let composeEventJson = "";
let composePublishError = "";
let composeLocalOnly = true;
// Recovery tab state
let recoverySelectedKind = null;
@ -2879,9 +2880,18 @@ @@ -2879,9 +2880,18 @@
if (result.success) {
composePublishError = "";
alert("Event published successfully to ORLY relay!");
// Optionally clear the editor after successful publish
// composeEventJson = '';
if (!composeLocalOnly) {
// Also broadcast to configured relays
try {
await nostrClient.publish(event);
} catch (broadcastErr) {
console.warn("Broadcast to other relays failed:", broadcastErr);
}
alert("Event published and broadcast to relays!");
} else {
alert("Event published to this relay only.");
}
} else {
// Parse the error reason and provide helpful guidance
const reason = result.reason || "Unknown error";
@ -3064,6 +3074,7 @@ @@ -3064,6 +3074,7 @@
{:else if selectedTab === "compose"}
<ComposeView
bind:composeEventJson
bind:localOnly={composeLocalOnly}
{userPubkey}
{userRole}
{policyEnabled}

23
app/web/src/ComposeView.svelte

@ -4,6 +4,7 @@ @@ -4,6 +4,7 @@
export let userRole = "";
export let policyEnabled = false;
export let publishError = "";
export let localOnly = true;
import { createEventDispatcher } from "svelte";
import EventTemplateSelector from "./EventTemplateSelector.svelte";
@ -53,6 +54,10 @@ @@ -53,6 +54,10 @@
>Reformat</button
>
<button class="compose-btn sign-btn" on:click={signEvent}>Sign</button>
<label class="local-only-label">
<input type="checkbox" bind:checked={localOnly} />
This relay only
</label>
<button class="compose-btn publish-btn" on:click={publishEvent}
>Publish</button
>
@ -149,6 +154,24 @@ @@ -149,6 +154,24 @@
filter: brightness(0.9);
}
.local-only-label {
display: flex;
align-items: center;
gap: 0.35em;
font-size: 0.85rem;
color: var(--text-color);
cursor: pointer;
user-select: none;
margin-left: auto;
padding: 0 0.5em;
white-space: nowrap;
}
.local-only-label input[type="checkbox"] {
cursor: pointer;
accent-color: var(--accent-color);
}
.publish-btn {
background: var(--success);
color: var(--text-color);

2
pkg/version/version

@ -1 +1 @@ @@ -1 +1 @@
v0.58.3
v0.58.4

Loading…
Cancel
Save