Repository navigation
feat(threads): archive threads from the sidebar with one click - #549
Merged
Merged
Conversation
nixuuu
force-pushed
the
feat/sidebar-quick-archive
branch
2 times, most recently
from
November 12, 2026 12:04
49ddf01 to
2aac4f4
Compare
nixuuu
marked this pull request as ready for review
November 12, 2026 12:14
nixuuu
force-pushed
the
feat/sidebar-quick-archive
branch
from
November 12, 2026 12:20
2aac4f4 to
b3ab51d
Compare
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.
Validation
Rebased onto
origin/devatb78c6f54e, 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 usesProviderIcon 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.
bun install,gen:check, web/mobile typecheck, changed-file lint/format checks, commitlint andgit diff --checkpass. The existingsidebar-lifecycle.test.ts -t archiveintegration 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 fullcheck:tmpwas deliberately not repeated locally, as requested; CI runs the suite.interruptTurn, and cancelled its schedule; no live provider process was used.(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.devin the same worktree and nightly environment and are equal: iOS6ddec9ef559ee0095ac33e94ff9418a942053b17; Android5f6eae3ab278f1cd543e9ed763f923a319b65ec9. 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
Archive/UnarchiveArchive thread {title}/Unarchive thread {title}Archive bot {title}/Unarchive bot {title}Thread archived+UndoThis also archives its side threads.→This also archives its side threads. Running turns stop and schedules are cancelled.Documentation was updated in
docs/threads.md,docs/mobile.mdanddocs/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.