Skip to content

fix(ui): keep the selected pull request when its URL loads - #89

Open
0froq wants to merge 1 commit into
antfu:mainfrom
0froq:fix/keep-selection-on-reload
Open

0froq wants to merge 1 commit into
antfu:mainfrom
0froq:fix/keep-selection-on-reload

Conversation

@0froq

@0froq 0froq commented Nov 17, 2026

Copy link
Copy Markdown

🔗 Linked issue

resolves #86

🧭 Context

The list clears the selection as soon as the selected item is missing from the filtered list. After a reload the tab resets to Issues, so a pull request restored from /:number never shows up in the list and the selection is dropped right away.

📚 Description

Selections the list has not shown yet are now tracked. When such an item turns up in the other tab, the tab follows it and the details stay open. The same applies to /{owner}/{repo}/{number} in hub mode.

Picking a tab by hand behaves as before. The details of an item that tab does not list are closed.

Checked by hand on a local dev build against a real mirror. Opening a pull request from the Pulls tab and reloading brings back the Pulls tab and the selected pull request, with the URL intact. Pressing i on that pull request still opens the Issues tab and closes the details.

The list clears the selection whenever the active tab does not contain the
item, so restoring a pull request URL landed on the default issue tab and
dropped it. Track selections the list has not shown yet and switch the tab
instead, while an explicit tab change still closes the details.
@0froq

0froq commented Nov 17, 2026

Copy link
Copy Markdown
Author

👁️‍🗨️ Review this pull request with grouped, summarized diffs at:
👉 https://pulls.review/gh/antfu/ghfs/89?from=0froq

raw result

💭 analyzed by openai-compatible/opencode-go/deepseek-v4.1-flash
🕰️ 2026-11-17 04:31 UTC
🔗 head 66b6c4f
🤖 automated by pulls.review

{
  "headSha": "66b6c4f3e5cd73dc3247b73535a2502a2d166781",
  "result": {
    "overallSummary": "Fixes #86: after a reload the list tab resets to Issues, so a pull request restored from the URL was never listed and its selection was immediately cleared. The panel now remembers a selected number the current tab has not listed yet and, once that item appears in the other tab, switches to that tab instead of closing the details.",
    "groups": [
      {
        "key": "selection-sync",
        "label": "Keep pending selection",
        "summary": "Introduces a `pendingNumber` that holds a selected item the current tab does not list, so a reloaded `/:number` (or hub `/{owner}/{repo}/{number}`) URL can switch the tab to the item instead of dropping the selection. A manual tab change still closes details of items that tab does not list.",
        "category": "ui",
        "filePaths": [
          "ui/components/panel/SingleProject.vue"
        ],
        "critical": false,
        "fileNotes": [
          {
            "path": "ui/components/panel/SingleProject.vue",
            "text": "The tab switch relies on `pendingNumber` being cleared **before** assigning `state.filters.kind`: the assignment re-triggers the `filteredItems` watcher, and the pending flag is what distinguishes a URL-restored selection from a user picking a tab by hand. Only `state === 'open'` items are followed.",
            "critical": false
          }
        ],
        "lineNotes": [
          {
            "path": "ui/components/panel/SingleProject.vue",
            "side": "additions",
            "line": 81,
            "text": "The `item?.state === 'open'` guard means a closed/merged item restored from the URL still gets its details closed on reload — intentional per the issue, but worth confirming."
          }
        ]
      }
    ],
    "schemaVersion": 1,
    "source": "llm",
    "generatedAt": "2026-11-17T04:31:59.095Z",
    "model": "openai-compatible/opencode-go/deepseek-v4.1-flash",
    "locale": "en"
  }
}

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.

Preserve PR selection when opening or reloading its URL

1 participant