Skip to content

feat(threads): archive threads from the sidebar with one click - #549

Merged
nixuuu merged 3 commits into
devfrom
feat/sidebar-quick-archive
Nov 12, 2026
Merged

nixuuu merged 3 commits into
devfrom
feat/sidebar-quick-archive

Conversation

@nixuuu

@nixuuu nixuuu commented Nov 12, 2026 •

Copy link
Copy Markdown
Member

Hovering or focusing a sidebar thread now swaps its provider mark for an Archive button in the reserved bottom-right slot. The existing actions menu stays in place. Archived rows offer Unarchive, and bot rows reuse their existing archive handler in the unread-count slot.

  • The swap uses CSS hover/focus selectors and motion tokens, with an instant swap for reduced motion. Hover does not update list state. The quick action stays hidden for coarse pointers and devices without hover; the existing menu remains available.
  • Quick actions stop propagation, preserve computer/branch truncation, and transfer focus to the next root row after success, falling back to the previous row or search. They share menu confirmations, gateway calls, read-only restrictions and cascade-unarchive behavior. Archiving still stops running turns and cancels schedules; Undo restores the archive state without restarting work.
  • Web and mobile thread archiving now offer the existing toast pattern with Undo. Mobile thread rows also support a left swipe using the installed React Native PanResponder and Reanimated. Taps, long presses and vertical scrolling retain their responders. No dependencies, native configuration, lockfiles or EAS fingerprint inputs were changed.

Validation

Rebased onto origin/dev at b78c6f54e, including the mobile thread-row parity changes in #545. The shared provider opacity, working-row contrast, activity/status components and independent age subscriptions are retained. Quick archive uses ProviderIcon size="sm" so both marks fit the same 14 px slot; the mobile swipe wrappers compose around the updated rows. Current head: 87d2ea8735a4d0f6e927df8aed91eaf62cf5bcca.

Both commit headers pass local commitlint. The worktree uses the main repository's installed node_modules through a local, untracked symlink; the formatting follow-up commit passed the normal commit hook without skipping it.

  • After the rebase, local bun install, gen:check, web/mobile typecheck, changed-file lint/format checks, commitlint and git diff --check pass. The existing sidebar-lifecycle.test.ts -t archive integration cases pass: 4 tests, 36 assertions, covering durable archive/read metadata, archived side threads, cascading archive with running-turn interruption, and cancellation without replay after restoration. No UI tests were added. The full check:tmp was deliberately not repeated locally, as requested; CI runs the suite.
  • CI is running again for the rebased head. The previous fully reviewed head passed static checks, commitlint, all four test shards, web/Linux builds and the aggregate check. The PR remains ready for review.
  • Real Chromium review passed in light/dark at a 1440×900 viewport, with the sidebar at 288 px and its 220 px minimum, plus a 393 px phone viewport. Short, typical and very long titles and long computer/path text truncate without overlapping the action. Hover preserves row rectangles and DOM identities; the archive icon shares the provider icon's center and 14 px resting size. Tooltip and contextual accessible labels are present.
  • Archive removes the row without opening/selecting it; Undo restores it. Archived-section Unarchive works. Keyboard Tab reaches the quick action, and successful archive moves focus to the next row, including after confirmation. With reduced motion, computed swap transition durations are zero. Both the quick action and the menu show the same working-thread confirmation when Confirm archive is enabled. With it disabled, archive acts immediately. The disposable offline-worker fixture persisted the archive, enqueued interruptTurn, and cancelled its schedule; no live provider process was used.
  • Phone emulation with (hover: none) and (pointer: coarse) keeps quick actions hidden; an actual emulated touch hold opens the existing actions sheet without navigation. No page errors were observed. The T3 browser disconnected, so review used one isolated local Chromium session through agent-browser, with Playwright CLI attached to that same browser for touch emulation. All browser and stack processes are stopped after review.
  • After the rebase, a fresh T3 Chromium review passed in light/dark: both provider and quick archive icons measure 14 px at the same center, hover preserves row rectangles and identities, archive preserves the current URL and focuses the next row, and Undo restores the row. At the 220 px sidebar minimum, the updated working row retains its contrast and the long title/metadata have no horizontal overflow. Browser and disposable stack were stopped after review.
  • EAS/Expo fingerprints were remeasured against the latest dev in the same worktree and nightly environment and are equal: iOS 6ddec9ef559ee0095ac33e94ff9418a942053b17; Android 5f6eae3ab278f1cd543e9ed763f923a319b65ec9. No native dependency or configuration changes. The native mobile swipe was statically reviewed; no iOS/Android device session was run.

Copy audit — docs/copy.md §8

Before → after Reason
No quick-action tooltip → Archive / Unarchive Short verb-first labels matching the action; reused on mobile's swipe reveal.
No quick-action accessible name → Archive thread {title} / Unarchive thread {title} Names the action and its target for keyboard and screen-reader users.
No bot quick-action accessible name → Archive bot {title} / Unarchive bot {title} Uses the bot glossary term and the same contextual-label pattern.
No thread archive confirmation toast → Thread archived + Undo Reuses the existing past-tense toast and single-action undo pattern.
Mobile This also archives its side threads. → This also archives its side threads. Running turns stop and schedules are cancelled. Makes the existing running-thread effects explicit, consistent with the web confirmation.
Audit item Result
1. Clarity, length, voice, case and punctuation Static pass: brief sentence-case actions, past-tense toast, complete confirmation sentences. User titles remain dynamic values.
2. Glossary Pass: thread, side thread, bot and turn retain their documented meanings; no new terms.
3. Verb-first actions and confirmation consistency Pass: Archive, Unarchive and Undo; existing Archive thread confirmation retained.
4. Errors No new error text; existing lifecycle/undo error handling reused.
5. Empty states No empty-state text changes.
6. Repetition Static pass: concise tooltips name the action; accessible names add the target, without duplicating visible descriptions.
7. External gaps and dependencies No new dependency or external-gap messages.
8. Soul/humour No new humorous copy.
9. Short, typical and long names at desktop/phone widths Pass in real Chromium: light/dark, desktop, 220 px sidebar and 393 px phone viewport. Thread titles and long computer/path text truncate cleanly.
10. Meaning beyond colour, shape or position Pass: contextual accessible button names, Archive/Unarchive tooltips, keyboard access, Undo text and the existing touch actions sheet. The native swipe reveal has a text label.

Documentation was updated in docs/threads.md, docs/mobile.md and docs/bots.md. The mobile row visual component was left untouched to reduce conflicts with the concurrent mobile-row work; the gesture wrapper is attached at its tree call sites.

@nixuuu
nixuuu force-pushed the feat/sidebar-quick-archive branch 2 times, most recently from 49ddf01 to 2aac4f4 Compare November 12, 2026 12:04
@nixuuu
nixuuu marked this pull request as ready for review November 12, 2026 12:14
@nixuuu
nixuuu force-pushed the feat/sidebar-quick-archive branch from 2aac4f4 to b3ab51d Compare November 12, 2026 12:20
@nixuuu
nixuuu merged commit fec39a4 into dev Nov 12, 2026
10 checks passed
@nixuuu
nixuuu deleted the feat/sidebar-quick-archive branch November 12, 2026 12:31
nixuuu added a commit that referenced this pull request Nov 12, 2026
Wide Markdown tables can lose horizontal drags to navigation on iOS,
while Android readers can be left with clipped columns. Tables,
unwrapped code, display math and diffs now share a native Gesture
Handler scroller with Android nested scrolling, a horizontal indicator
and an overflow shadow. Main-stack back navigation starts at the screen
edge; dragging inside a block keeps the conversation open.

### Diagnosis and change

- The main Expo Router stack left `fullScreenGestureEnabled` unset. The
installed `react-native-screens` 4.30.1 explicitly treats that state as
**enabled on iOS 26** (`RNSScreen.mm`,
`isFullScreenSwipeEffectivelyEnabled`), despite the router documentation
describing a false default. Set it to false in the main stack,
preserving the native edge recognizer and leaving `gestureEnabled`
intact. This covers threads, side threads and bot conversations.
- The timeline is an inverted Reanimated `FlatList`, with a native iOS
scroll view and `KeyboardChatScrollView` on Android. Embedded
tables/code/diffs used React Native horizontal `ScrollView`s without
Android nested scrolling. Replace them with one `HorizontalScroll` using
Gesture Handler's installed v3 `ScrollView`, `nestedScrollEnabled` and
iOS directional locking; also enable nesting on the timeline. Its local
gesture root supports blocks rendered inside Android modal viewers. No
competing pan was found on timeline rows. Native reproduction was
unavailable, so Android interception and the exact failing gesture
sequence remain device checks.
- The sidebar is a column toggled by a button, without a screen-wide
drawer pan. #549's archive PanResponder is attached only to sidebar
thread rows. #554's disclosure changes animate height and anchoring
without adding a pan recognizer. Neither introduced this conflict. #281
introduced the table/code scroll containers with the current screens
version and missing nesting/navigation restriction.
- Bound both header and body column widths to 72–224 dp plus padding;
long headings wrap too. Memoize width estimates and avoid spreading
every row into `Math.max`. Tall tables retain natural height so vertical
drags scroll the timeline. The 16 dp right-edge overflow shadow
disappears at the right end and when content fits. Scroll offsets and
shadow opacity stay on the UI thread through Reanimated; no per-frame JS
callback, pan loop, list reconfiguration or item-height estimate is
added.
- Gesture Handler 3.3.0 was already locked, installed and autolinked on
both platforms through the existing dependency graph. Declare that exact
version directly in mobile; the lock change only adds the workspace
dependency entry. No native package version, native source, app config
or EAS profile changes. Polish mobile documentation updated. Copy audit
(`docs/copy.md` §8): no UI strings changed. No UI tests or diagnostic
artifacts added.

### Verification

- `bun install --frozen-lockfile` passed, followed by `bunx expo install
[email protected] --bun` using the already installed
version.
- Mobile `bun run typecheck`, root `bun run lint apps/mobile`, `bun run
format:check apps/mobile docs/mobile.md`, and `git diff --check` pass.
Expo ESLint passes for all six changed TSX files, including the new
scroller.
- Mobile `bun run lint` (Expo ESLint) reports 63 errors and 10 warnings
in existing source files. An independent archive of untouched `dev` with
the same installed tooling reports the same 63 source errors and 10
warnings (direct `eslint .` additionally checks `metro.config.cjs` and
reports its existing `__dirname` diagnostic). All six changed TSX files
have zero ESLint errors/warnings. Repository oxlint is clean. No lint
rules were disabled.
- Production fingerprints generated before and after in the same
checkout/environment with `bunx [email protected] fingerprint:generate
--platform <ios|android> --build-profile production --json
--non-interactive` are byte-for-byte identical: iOS
`6ddec9ef559ee0095ac33e94ff9418a942053b17`; Android
`5f6eae3ab278f1cd543e9ed763f923a319b65ec9`. These match the prior
production-compatible baseline; this remains JS-only.
- No device session, native frame-time/memory measurement, UI test, full
`check:tmp`, web build, CNG prebuild or bundle export was run. Device
behavior/performance is **unverified**, not inferred from static checks.
CI owns the full repository checks, as requested.

### Maintainer device checklist

Use the same installed native build and same thread for baseline versus
this branch's JS. Record OS/device, app version/runtime/update ID and
channel. Include an iPhone on iOS 26 and an Android phone; check an
older supported iOS version if available. Test light/dark,
portrait/landscape and a wide layout with the sidebar open/closed.

1. **Horizontal ownership:** open a three-column table like `Zgłoszenie
| Nowy status | Dlaczego…`, with enough text to overflow. Start 20
alternating horizontal drags on header text, body text and blank cell
padding, away from the left screen edge. Drag left to reveal the last
column, right from halfway to recover the first, then right again at
offset zero. Every interior drag should stay in the conversation; every
column must be reachable. Repeat in an assistant answer, a human
message, a bot bubble and expanded tool/summary content. Include short
cells, a very long heading, long unbroken text, and a table that fits
entirely.
2. **Back/sidebar:** from a thread with a previous screen, swipe right
starting within the leftmost 16 dp of the display; native back must
still work. Cancel one edge swipe and complete another. Interior swipes
must never navigate, including when already at the table's left end.
Repeat in a side thread and bot conversation. Toggle the wide sidebar,
scroll its list vertically, and confirm its archive swipe still works
only on sidebar rows.
3. **Tall tables and vertical feed:** use a table at least two
screen-heights tall. Drag vertically starting over header/body/padding
and diagonally with mostly vertical movement, including while
horizontally offset. The outer inverted timeline should move through the
full table without trapping the gesture, clipping the settled content or
folding the composer from a horizontal-only drag. Repeat with keyboard
open/closed, during a streaming response, after loading older history,
and after closing/reopening a work disclosure. Confirm jump-to-latest
still works.
4. **Other blocks and affordance:** repeat interior horizontal drags on
a long code line, display math, stacked and split diffs, and a full-diff
modal viewer. Toggle Wrap code/Wrap diffs and confirm wrapped content
still scrolls vertically. The horizontal indicator should appear during
scrolling; the subtle right shadow should show only while content
remains to the right, disappear at the end, and update after
rotation/font-size changes. Check both themes and Reduce Motion; no
content or controls should move when the shadow changes. Check
VoiceOver/TalkBack can reach all content and ignores the decorative
edge.
5. **Long-thread performance:** on the same device/build mode, compare
baseline and changed JS on the same 1,000-turn thread with multiple
tables/code/diffs. After warmup, record three 30-second vertical flings
and 20 horizontal table drags in the native profiler. Compare dropped
frames/UI frame time, JS activity and settled memory after
opening/closing many summaries. Expect no new React render or JS
callback per horizontal-scroll frame and no repeatable
frame-pacing/memory regression; record the measured result before
merging. Restore normal settings afterward.

Fixes: #281
Related: #549
Related: #554
nixuuu added a commit that referenced this pull request Nov 12, 2026
The sidebar time/actions swap appeared instantly while the
provider/archive swap animated. Both slots now use shared CSS swap
classes with the same motion tokens, timing, easing and reduced-motion
behavior in Threads and Bots. Hover and focus-within reveal both
actions; an open menu keeps them visible. Existing slot widths stay
reserved, including the bot time slot before its first message.

Rows now use a shared 12px content gutter, composed of a 4px background
inset and 8px inner padding. Group headings, search, footer controls and
archived rows use the same spacing tokens. The sidebar reserves its
scrollbar at the trailing edge, removing the extra leading scrollbar
gutter. Native mobile files and fingerprint inputs are untouched.

Fixes: #549

Validation:
- Changed-file lint, formatting and `git diff --check` pass. Self-review
covered reserved widths, truncation, action positioning, open menus and
reduced-motion selectors. No UI tests were added.
- An isolated Linux checkout at
`ac98bf4039e6ab33a1e21104eb3e13e009ee1cf9` passed `bun install`, `bun
run gen:check`, `bun run typecheck`, `bun run lint`, `bun run
format:check`, and the production web build. Svelte reported zero errors
and warnings. CI is green, including all four test shards with
temp-directory checks and the aggregate check.
- Real headless Chromium reviewed the production build against a
disposable gateway/database. Threads and Bots passed in light/dark at
220px, 288px and 560px sidebar widths, with short, typical and long
names. Both slots animate opacity/scale/blur in and out on 250ms
`ease-in-out`, without movement delay. Row and title bounds stay fixed;
bot names retain separation from the reserved 64px time slot, including
before the first message.
- Keyboard focus reveals both actions, Tab reaches the menu and quick
action, open menus preserve both slots, and Escape closes the menu.
Reduced motion gives zero-duration swaps in both tabs. The row content,
section heading, search icon, logo and footer icon align at 12px;
backgrounds retain a 4px inset from the sidebar edge and scrollbar.
- Archived-row swapping also passed. The web phone drawer was checked in
light/dark at 393px with a coarse pointer; quick actions remain hidden.
No page errors were observed in the completed review. Screenshots and
disposable browser drivers were kept outside the repository. No
application fixes were needed after review.
- UI copy is unchanged; no copy audit is required. Polish documentation
describes the shared gutter and motion behavior.
nixuuu added a commit that referenced this pull request Nov 12, 2026
)

Working sidebar threads gained a neutral fill in #545 that looks too
close to the selected thread, especially in dark mode. Remove that fill
on web and mobile: an unselected working thread now uses its spinner and
Working label, while the current thread retains the selected background
regardless of activity.

Only unselected web thread and Bots conversation rows receive the
lighter hover fill. Keyboard focus keeps its separate outline. Bots
already have no working-only fill; selected bot/group conversations now
retain their selected fill on hover. Keep the normal title/metadata
contrast from #545 and the action swaps, reduced-motion behavior,
reserved slots and gutters from #576. Update the related Polish
documentation; UI copy is unchanged.

Fixes: #545

Validation:
- Rebased onto `dev` at `968757a4c`, including #591 and #594. Reviewed
head: `070efea27b73c7fec7049b1be061c42258e7f17e`. Blame and patches
identify #545 (`1c65b9317`) as introducing the working fill on both
clients. Reviewed #549, #576 and #583; they did not introduce it.
- On the assigned review server, `bun install --frozen-lockfile`, `bun
run gen:check`, full `bun run typecheck`, `bun run lint`, `bun run
format:check` and the production web build pass after the rebase. Svelte
reports zero errors and warnings. Changed-file mobile ESLint, repository
formatting, commitlint and `git diff --check` also pass. No web UI tests
were added or run.
- A single Chromium browser reviewed the production build against a
disposable gateway/database: light/dark at 1440px desktop and 1100px
narrow widths, 288px and 220px sidebars, plus the 393px phone drawer.
Checked working-only, selected-only, selected+working, hover and
keyboard focus in Threads and Bots, including a working side thread and
short/long labels. Working-only rows are transparent; hover uses 4%,
selection uses 6% light / 8% dark, and keyboard focus retains its
separate 2px outline. Selected rows keep their fill on hover. Row bounds
remain fixed and labels do not overflow. Reduced motion gives
zero-duration action swaps. Final navigation reports no console errors.
- The mobile change only removes the `busy ? c.well` background branch
from a TSX file. Native dependencies, configuration, fingerprint
configuration, assets and lockfile are unchanged. Base/head fingerprints
generated on the assigned server with `nice -n 19`, using `expo-updates
fingerprint:generate` and the production/nightly environment, are
identical: iOS `6ddec9ef559ee0095ac33e94ff9418a942053b17`, Android
`5f6eae3ab278f1cd543e9ed763f923a319b65ec9`. This uses Expo's underlying
runtime fingerprint engine. The maintainer confirmed that this local
comparison is sufficient for the JS-only change; authenticated EAS
verification is not required. No build or OTA publication was started.
- Browser, gateway, web and disposable database are stopped. Assigned
ports are free. Verification artifacts remain outside the repository.
Ready for review; the maintainer will merge once CI is green.

Copy audit: no UI text changes; no copy audit required.
nixuuu added a commit that referenced this pull request Nov 15, 2026
The archive and unarchive responses carry the saved thread. When the
overview stream is not live the response applies at once; otherwise it
waits 2 s for the echo. It goes through the same path as a stream event
(saved archive cache + overview list), so a later echo finds the row in
place and moves nothing. A response whose archive state the list already
shows is dropped.

Related: #549
nixuuu added a commit that referenced this pull request Nov 15, 2026
## What jumped (Android recording, nightly)
Frames from the report, at 30 fps:
1. **Swipe snapped back**: releasing a committed swipe returned the row
to rest, and it sat there for about 0.5 s until the gateway update
removed it instantly.
2. **Counter out of step with its rows**: the archived rows come from
the saved cache, which the stream update changes in the same render.
`Archived · N` and "No archived threads" came from the pager, which
refetches after a 100 ms debounce. Archiving showed `Archived · 0` over
the new row. Unarchiving showed `Archived · 1` over "No archived
threads.", and then the whole section vanished in one frame.
3. Rows other than archived ones, the archived heading and the empty
state had no exit, so they disappeared abruptly while neighbours moved.

## Fix (mobile only)
- `ThreadArchiveSwipe`: a committed swipe slides the row off on
`motion.quick` with `smoothOut`, and the row stays off. With reduced
motion it only fades. The gateway update then removes the row, and the
cells below glide into place (`SidebarOrderCell` `LinearTransition` on
`fast`). A failed request or a confirmation dialog brings the row back.
`useThreadActions.commit()` returns the outcome; `run()` behaves as
before.
- `useArchivedThreads`: the count follows the rows it describes
(`saved?.totalCount ?? page.totalCount`). Row and counter now change in
the same frame, and the section's visibility uses the same value.
- `SettingsThreadList`: every leaving entry fades out (`rise.exiting`).
That covers active rows, the archived heading and status, and the empty
state. `LayoutAnimationConfig skipExiting` stops those exits when the
whole list unmounts (Threads/Bots switch).
- `useSettleThread` (overview): the archive/unarchive response, and the
response to Undo, carries the saved thread. It applies immediately when
the stream isn't live, else after 2 s without an echo. It uses the same
path as a stream `thread` event (saved archive cache `reconcile` +
overview upsert), so a swiped row never stays an empty slot. A response
whose archive state the list already shows is dropped. A later echo is a
no-op: `mergeArchivedThread` keeps a known row at its index and leaves
the count unchanged, and the overview upsert replaces the row in place.
The pager refetch that follows returns the same rows.
- No optimistic list mutation: the server echo is the only move, so
there is no double move. The pager's refetch, triggered by the same
update, matches the saved rows: same keyset order, and the row already
in place keeps its index.

The web sidebar takes rows and count from the same pager state, so it
was not affected and is unchanged.

## Checks
- `bun install`, mobile `typecheck`, `bun run lint`, `bun run
format:check`: clean.
- Native fingerprint (`@expo/fingerprint`, ios + android) compared
against `origin/dev`: all source hashes are identical. Only TS sources
changed; no native modules and no config-plugin changes, so this ships
over OTA.
- Device: not checked. The MacStudio device hub timed out (40 s), and
the EAS cloud simulators would need a new build.

## Copy audit (docs/copy.md §8)
No UI text added or changed.

Related: #549
Related: #423
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.

1 participant