Skip to content

Personal-project threads render twice in project mode: once under a "Personal" section and again under "Threads" #4093

Closed

Description

@benwaffle

Summary

In the sidebar's project organization mode, threads in the Personal project are rendered twice: once under a Personal project section, and again under the built-in Threads section. Both sections list the same rows, with the same titles and the same links.

Expected: the Personal project's threads appear exactly once. Before the built-in thread list was replaced by the bundled thread-list plugin, the Personal project was deliberately not given a project section — its threads were the contents of the Threads section. The plugin now receives the Personal project in its projects array, so it renders both.

Observed, from a clean data directory with one standard project (App, one thread) and one Personal-project thread:

sidebar showing App, Personal and Threads sections with My personal thread listed under both Personal and Threads

Versions and environment

  • Built from source at 07a741bc2014561bf5721ba6dadbfc25c6eb3812 (Add a screenshot lightbox to marketplace plugin details (#4059)), run with pnpm dev.
  • Also still present in the code at main = 9b8c1d3457b00359af206e3fd423fe50520182c2 (Prepare bb-app 0.43.4 (#4091)) — see "What I ruled out".
  • macOS 26.6, arm64. Node v26.8.2.
  • No provider involved; the threads were created with a future sendAt so no agent ran.
  • Default thread-list preferences except organizationMode.

Steps to reproduce

  1. Start a dev instance against an empty data directory:

    pnpm dev
  2. Create one standard project and one thread in each of it and the Personal project. sendAt is set a day out so creation never starts an agent:

    API=http://127.0.0.1:<server-port>/api/v1
    HOST=$(curl -s "$API/hosts" | jq -r '.[0].id')
    SEND=$(( ($(date +%s) + 86400) * 1000 ))
    mkdir -p /tmp/repro-app && git -C /tmp/repro-app init -q
    
    PID=$(curl -s -X POST "$API/projects" -H 'content-type: application/json' \
      -d "{\"name\":\"App\",\"source\":{\"hostId\":\"$HOST\",\"type\":\"local_path\",\"path\":\"/tmp/repro-app\"}}" \
      | jq -r .id)
    
    curl -s -X POST "$API/threads" -H 'content-type: application/json' \
      -d "{\"projectId\":\"proj_personal\",\"origin\":\"app\",\"title\":\"My personal thread\",\"input\":[{\"type\":\"text\",\"text\":\"hello\"}],\"environment\":{\"type\":\"host\",\"workspace\":{\"type\":\"personal\"}},\"sendAt\":$SEND}" >/dev/null
    
    curl -s -X POST "$API/threads" -H 'content-type: application/json' \
      -d "{\"projectId\":\"$PID\",\"origin\":\"app\",\"title\":\"An App thread\",\"input\":[{\"type\":\"text\",\"text\":\"hello\"}],\"environment\":{\"type\":\"project-default\"},\"sendAt\":$SEND}" >/dev/null
  3. Switch the sidebar to project mode:

    pnpm bb:dev thread-list prefs set organizationMode project
  4. Open the app and look at the sidebar.

The smallest form still reproduces with no standard project at all — one Personal-project thread is enough, because hasThreadsSection is also true when projectRows.length === 0.

Expected vs actual

Actual section headings and rows:

App
    An App thread
Personal
    My personal thread     <- same thread
Threads
    My personal thread     <- same thread

Expected:

App
    An App thread
Threads
    My personal thread

The same thing shows against real data — with 5 standard projects and 13 Personal-project threads, the sidebar renders Pinned, bb, hss, mav-skills, raycast, claude-plugins, Personal, Threads, where Personal and Threads each list all 13 Personal threads. Counting anchors inside the sidebar gives 11 project-scoped links plus the 12 loose Personal links twice, 35 in total.

The server payload is correct — GET /api/v1/sidebar-bootstrap keeps them separate, so this is purely client-side composition:

{
  "standard": [{ "name": "App", "threads": ["An App thread"] }],
  "personal": { "name": "Personal", "threads": ["My personal thread"] }
}

Evidence

The duplication is deterministic and reproducible as a unit test at the exact code path. Dropping this into plugins/thread-list/ and running pnpm exec turbo run test --filter=bb-plugin-thread-list prints SECTION HEADERS: ["Personal","App","Threads"] and thr_personal row count: 2:

// @vitest-environment jsdom
import { cleanup, screen } from "@testing-library/react";
import { afterEach, describe, expect, it, vi } from "vitest";
import type { PluginThreadListProps } from "@get-bb/plugin-sdk/app";
import { loadPluginApp, renderSlot } from "@get-bb/plugin-sdk/testing/app";
import { PERSONAL_PROJECT_ID } from "@bb/domain";
import { makePluginProject, makeSidebarThread } from "./app/model/fixtures.js";
import {
  resetPreferencesSyncForTest,
  setPreferencesMirrorStorageForTest,
} from "./app/preferences/preferences-sync.js";
import { defaultPreferences } from "./shared/preferences.js";

const app = await loadPluginApp(() => import("./app"));
const registration = app.threadLists[0];
if (!registration) throw new Error("thread-list slot not registered");

const PROJECTS = [
  makePluginProject({ id: PERSONAL_PROJECT_ID, name: "Personal", isPersonal: true }),
  makePluginProject({ id: "proj_app", name: "App" }),
];
const THREADS = [
  makeSidebarThread({
    id: "thr_personal",
    projectId: PERSONAL_PROJECT_ID,
    title: "Personal thread",
    createdAt: 5,
    updatedAt: 5,
    latestAttentionAt: 5,
  }),
];

afterEach(() => {
  cleanup();
  resetPreferencesSyncForTest();
  setPreferencesMirrorStorageForTest(undefined);
});

describe("personal project duplication in project mode", () => {
  it("renders the single personal thread once", async () => {
    setPreferencesMirrorStorageForTest(null);
    renderSlot(
      registration,
      {
        activeThreadId: null,
        activeProjectId: null,
        isCompactViewport: false,
        onNavigate: vi.fn(),
        searchQuery: "",
      } satisfies PluginThreadListProps,
      {
        sidebarThreads: { projects: PROJECTS, sections: [], threads: THREADS },
        rpc: {
          listPreferences: () => ({
            preferences: { ...defaultPreferences(), organizationMode: "project" },
          }),
          setPreference: (input: unknown) => input,
        },
      },
    );

    await screen.findByTitle("App");
    expect(
      document.querySelectorAll('[data-sidebar-thread-id="thr_personal"]'),
    ).toHaveLength(1);
  });
});

Where it comes from

The host SDK bridge appends the Personal project to the projects array it hands to thread-list plugins:

ProjectModeSections then turns every entry of that array into a project section, Personal included:

…while the built-in threads section is, by construction, the Personal project's threads:

The built-in list that the plugin replaced in #4041 read only the standard projects, which is why this did not happen before. At 3bcba17f3^, apps/app/src/components/sidebar/ProjectList.tsx had:

const projects = useMemo(
  () => sidebarNavigation?.projects.map(stripProjectThreads),
  ...
);
...
sidebarThreads.push(...sidebarNavigation.personalProject.threads);

sidebarNavigation.projects comes from listPublicProjects, which filters to kind = "standard" and therefore excludes Personal, while personalProject was collected separately into the loose-threads section.

The duplication is also visible in the group list behind More: ProjectList.tsx#L700-L746 builds a visibilityGroups entry titled Threads and another titled Personal, both backed by the Personal project's threads.

Note that the current project-mode test encodes the duplicate headings as expected output, which is likely why this went unnoticed — plugins/thread-list/app.test.tsx#L194-L215 asserts ["Pinned", "Personal", "App", "Web", "Threads"] and only checks that Personal thread is inside the Threads group, never that it is absent from a Personal group.

I have not formed a view on which way the fix should go — dropping the Personal project from the array the plugin consumes, filtering it inside ProjectModeSections, or dropping the separate Threads section in project mode — since that is a product decision about whether project mode should show a Personal heading at all.

What I ruled out

  • Not a fork-local problem. Found while testing a fork, but the fork's 20 commits touch none of this code: git diff 07a741bc2 fork/main -- plugins/thread-list apps/app/src/components/sidebar apps/app/src/lib/plugin-sidebar-hooks.ts packages/client-core/src/sidebar returns only SidebarHistoryNavigationControls.tsx (+9), apps/server/src/routes/projects.ts (+35, provider session slash-commands) and plugins/thread-list/app/model/sidebar-thread.ts (+2, extra display fields). None affect project/section composition.
  • Still present on main. 9b8c1d345 leaves allProjects, projectRows, personalThreads and the threads section content identical to 07a741bc2; its project-mode test still asserts the duplicate headings. Refine sidebar More hierarchy #4061 and Hide loose threads in nested overflow menus #4063 change More hierarchy and nested overflow menus, not this composition. I verified the code at main, not a running build of it.
  • Not a stale or malformed preference. Reproduced with default thread-list preferences, sectionOrder = ["pinned","projects","threads"] and hiddenGroups = [], on a clean data directory.
  • Not the section-order normalizer. normalizeSidebarSectionOrder deduplicates via its seen set; the two sections carry distinct ids (project:proj_personal and threads), so both are legitimately in the order.
  • Not a server bug. GET /api/v1/sidebar-bootstrap returns Personal only in personalProject, never in projects.
  • Not mode-specific to my data. Only project mode is affected; chronological and machine modes render the Personal threads once.

Suggested priority and effort

Hits every user who has any thread in the Personal project and uses project organization mode, which includes anyone whose threads default to Personal. No data loss, and the workaround is to hide one of the two groups under More. Cosmetic but constant and confusing, and it doubles the sidebar rows for Personal-heavy users. The fix itself looks small; choosing which of the two sections should win is the actual decision.

AGENT GENERATED

Activity

  1. added theissue type on Sep 22, 2026
  2. added
    ui
    confirmed-repro
    on Sep 22, 2026
  3. bb-slop-cop commented on Sep 22, 2026

    @bb-slop-cop
    Contributor

    🚨 SLOP COP 🚨 · new-issue-autopilot

    Bug · Priority: Medium · Effort: Low · Labels: ui, confirmed-repro.

    Report: REPRODUCED, high confidence, repeated in two clean checkouts of trusted main. Project rows include Personal while the dedicated Threads section renders the same threads.

    Opened ready PR #4094, excluding Personal from project groups. Regression cases fail before the fix and pass afterward; all 311 plugin tests and typecheck pass. Two files, 46 changed text lines. Screenshot evidence is a component render, not a full-app smoke test.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    confirmed-reproui

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions