Skip to content

Drag threads into the composer, a Watching section for PR-waiting threads, and run-once automations - #1813

Merged
currentbits merged 6 commits into
mainfrom
feat/thread-drag-watching-once
Oct 31, 2026
Merged

currentbits merged 6 commits into
mainfrom
feat/thread-drag-watching-once

Conversation

@currentbits

Copy link
Copy Markdown
Owner

Three small additions for running many threads: drag a thread into another as context, a quieter sidebar for threads that are only waiting on a PR, and automations that run once.

Drag a thread into the composer (#1810)

  • Drop a sidebar thread, including a search result, onto another thread's composer. It adds the same thread context chip the @-mention menu adds. Dropping the composer's own thread, or one that's already chipped, is ignored. Reordering and detach-to-window still work.

"Watching" sidebar section (#1811)

  • Idle threads whose only open work is a watched PR (open PR, watch on, not working, not waiting on you) move into a collapsed "Watching · N" section between Working and Snoozed. Each row shows "Watching Per-orchestration budget ceiling for fan-outs (#67) #123".
  • When the watch wakes the thread, it moves back to Working. Pinned and snoozed threads stay where they are, the collapsed state is remembered, and keyboard navigation and settle-advance include the section. This only changes the sidebar view; nothing new is sent from the main process.

Run an automation once (#1812)

  • A new "Once" schedule with a date and time. It fires once at that time and then turns itself off ("Ran once").
  • If the app was closed at that moment, it still runs on the next start within 24 hours. After that it's marked "Missed" and doesn't run.
  • A past time is rejected in the form, in the backend, and in the automation_create tool, which now accepts runAt.

Checks (run locally on the merged branch, electron suite in a CI-matching environment)

  • npm run typecheck and the preload sync check: clean
  • npm run test:renderer: 3761 pass, 0 fail
  • npm run test:electron: 5577 pass, 0 fail
  • npm run test:core: 38 pass. npm run test:memory: 246 pass.
  • npx vite build: succeeds

Closes #1810, closes #1811, closes #1812.

🤖 Generated with Claude Code

Willem and others added 6 commits October 31, 2026 13:51
Dropping a thread row (the same application/x-solenta-thread payload
ThreadCard's dragstart already sets for detach-to-window and the #1769
reorder) onto the composer now adds the same thread context chip the
@-mention menu's thread row would, instead of falling through to the
file-drop path. Own-thread and already-chipped drops are no-ops, and
the composer's existing drop overlay shows while the drag hovers.

useFileDrop gets an onThreadDrop option checked before the OS-file
path, mirroring the #1794 onMentionPath pattern. dropFiles.ts exports
THREAD_DRAG_MIME/isThreadDrag so ThreadCard, useFileDrop, and tests
share one constant instead of a duplicated string literal. Sidebar
search results render through the same ThreadCard component as the
rest of the list, so they were already covered by the dragstart
change with no extra wiring.

Co-Authored-By: Claude Sonnet 5 <[email protected]>
Idle, unpinned, unsnoozed, unsettled threads with an active PR watch
(prWatch !== false, open PR) now carve out of the inbox into their own
"Watching · N" shelf, below the active rows and above Snoozed. A wake
makes the thread working, which routes it to the Working shelf instead,
so it leaves Watching on its own. Collapsed state persists the same way
as the other shelves. Rows show "Watching #123" in the status line via
a new isWatchingPr helper reused by both sidebarGroups and status.ts.

No IPC changes needed: prWatch/prWatchState/prNumber/prState already
reach the renderer's ThreadInfo unstripped by services-threads.js
listRow.

Co-Authored-By: Claude Sonnet 5 <[email protected]>
Grouping precedence (idle+watched -> Watching, working/pinned/snoozed
override it, prWatch:false and closed/merged PRs keep threads out),
collapsed-by-default state, the "Watching #123" status text, and
flatVisibleThreadIds/nextThreadAfterSettle keyboard-order parity.

Two pre-existing sidebar.test.tsx fixtures (card anatomy, PR hover
card) used an idle thread with an open PR purely to test PR badge
rendering; they now default into the new Watching shelf like any real
thread would, so mark them prWatch: false to keep testing what they
were meant to test.

Co-Authored-By: Claude Sonnet 5 <[email protected]>
Adds a single-fire schedule alongside hourly/daily/weekly/cron: preset
"once" with a future local-time runAt. The scheduler fires it at or
after runAt (within a 24h grace window if the app was closed, otherwise
marks it missed) and then disables it with lastRunAt stamped, so it
never fires twice. Validation rejects a past runAt on create, and on
edit only when runAt itself is being set (editing an already-fired row
otherwise must not re-litigate a timestamp that is now, correctly, in
the past).

Threaded through: solenta.json shared-automation rows and their hash,
store migration healing, the automations IPC/service layer, the
automation_create MCP tool schema + description, and the Automations
UI (schedule picker, datetime-local input with min = now + 1 minute,
and row labels: "Once · <time>", "Ran once", "Missed").

Co-Authored-By: Claude Sonnet 5 <[email protected]>
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 31, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-31T13:20:49.653389Z 4799320 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 47993206ee

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/useFileDrop.ts
Comment on lines +79 to +82
if (isThreadDrag(e.dataTransfer)) {
if (!onThreadDropRef.current) return;
e.preventDefault();
if (e.dataTransfer) e.dataTransfer.dropEffect = "copy";

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Use a drop effect allowed by the sidebar drag source

When dragging an actual sidebar thread onto the composer, ThreadCard sets dataTransfer.effectAllowed = "move", but this handler requests dropEffect = "copy". Since copying is not permitted by the source, the browser rejects the drop and never delivers the event that inserts the context chip. Use a compatible effect here or allow copying at the source while preserving reordering. The new tests dispatch synthetic drop events directly, so they bypass this browser negotiation.

Useful? React with 👍 / 👎.

Comment thread src/automations.ts
Comment on lines +273 to +278
if (input.preset === "once" && !input.event) {
const raw = (input.runAt ?? "").trim();
if (!raw) return "Run time is required";
const t = new Date(raw).getTime();
if (Number.isNaN(t)) return "Run time is not a valid date";
if (t <= Date.now()) return "Run time must be in the future";

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Allow unchanged past run times when editing once automations

After a once automation has fired or been marked missed, editing its name, prompt, memory, or stage cannot be saved: the edit form retains the original runAt, and this unconditional future check rejects it. The new input's min constraint also blocks native submission, and the edit payload always includes runAt, causing the backend to reject it as an explicitly supplied past time as well. Distinguish creating or rescheduling from editing other fields, allow an unchanged past instant through the form, and omit it from the update payload.

Useful? React with 👍 / 👎.

@currentbits
currentbits merged commit 4e35938 into main Oct 31, 2026
6 checks passed
@currentbits
currentbits deleted the feat/thread-drag-watching-once branch October 31, 2026 13:31
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.

One-time scheduled automations "Watching" sidebar section for idle threads waiting on a PR Drag a thread into the composer as context

1 participant