Opening the chat column lands on a chat from last week

Open
#965 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 2 days

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
48/100
Issue type
Feature
Clarity
Clearly specified
Activity status
Active
Tech stack
swift
Domain
ai, desktop

Research direction

Start with ChatColumn.swift:153-156 and ChatColumn.swift:245-250 to trace chat selection, then read Chat.stale(after:) in Chat.swift:96-108 and the existing tidy behavior in Tidy.swift:55-56. Decide how a stale chat should affect selection while preserving pinned chat behavior; done means reopening a tab after the chosen freshness period starts a fresh chat and keeps the old thread in the list.

Written by the indexing model from the issue text.

Description

area: ai Polish proposal
Yab version

0.47.10 (202611102135)

Device

Mac

macOS or iOS version

27.2

Engine of the tab

Not about a page

Area

Side chat

Steps to reproduce
  1. Start a chat from a tab.
  2. Leave it for a few days.
  3. Go back to that tab and open the chat column.
What you expected

A fresh chat, with the old one still in the list. That's the Arc way everywhere else in Yab: when you come back, the first thing you get is a new window, a new tab or a new action, not last week's. Tabs already work like that here. A tab left alone for twelve hours is put away when you come back, so the morning starts with yesterday's forty tabs down to the ones you kept (Sources/Fast/Tidy.swift:5-21).

What happened instead

Last week's chat, as if I'd never left. It's jarring to land back in it just because I opened the column, and if I type, the message goes on in that old thread with whatever it was in the middle of (that's how #964 happened to me).

From the source (main at bdbdb37), the column picks chatPinned ?? chatOfTab(active) ?? chatShown (ChatColumn.swift:153-156). A tab a chat began on keeps pointing at it (chatOfTab, ChatColumn.swift:245-250), and nothing in that choice looks at the chat's age. Chats are tidied on the same coming back as tabs (Tidy.swift:55-56), but only into the archive after a month (Chat.swift:96-108), and a revived chat gets its old thread back (Agents.swift:741).

Chat.stale(after:) already exists, so a sketch:

func chatID(using agents: Agents) -> String? {
    if chatFresh { return nil }
    if let pinned = chatPinned { return pinned }
    let id = chatOfTab(active, agents: agents) ?? chatShown
    // Untouched for about a day: a fresh chat, the old one stays in the list.
    if let id, Chats.shared.chat(id)?.stale(after: Chat.freshAfter) == true { return nil }
    return id
}

A pinned chat stays as it is, like a pinned tab. The time could sit in Settings › Agents beside the archive setting, with the same choices as Tidy.

How often

Every time I come back to a tab after a few days.

Claude Code read the source and traced this for me.

Dominant language
Swift
Stars
648
Forks
56
Avg merge
21h 14m
Merged PRs (30d)
22

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from yetanotherbrowser/yab

All issues in yetanotherbrowser/yab

Similar issues

More Swift issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.