Skip to content

desktop: file tree unusable out of the box — showFileTree defaults to false with no Settings UI #56057

Closed

Description

@darya-lev

C:\Users...\AppData\Local\Temp\opencode\issue-3-showfiletree.md

Факты в репорте подтверждены по свежей копии приложения 2.0.30:

Проверка и Результат
showFileTree в коде | 6 вхождений — только хранилище настроек
setShowFileTree (сеттер) | 1 вхождение — только определение, ни одного вызова
Значение по умолчанию | false (kk = { general: { showFileTree: !1 … } })
Строка в настройках | отсутствует (в каталоге 12 settings.general.row.*, файлового дерева нет)
Контраст | у showCustomAgents и строка в настройках, и переключатель есть

Activity

  1. opencode-agent commented on Oct 16, 2026

    @opencode-agent
    Contributor

    Thanks for the detailed check. I couldn't run the Desktop app in my sandbox, so I haven't seen this on screen. The code agrees with your findings, both in 2.0.30 and on the latest dev (b0d7621):

    • general.showFileTree defaults to false, and nothing calls setShowFileTree.
    • Settings → General has no row for it, unlike showCustomAgents.
    • The same setting also controls whether the "Toggle file tree" command (Ctrl+\ / Cmd+\) is registered, so that shortcut isn't available as a workaround either.

    A maintainer with the Desktop app will need to confirm this and decide whether hiding the tree is intentional or a regression.

    Related issues:

  2. rodrigoborquez commented on Oct 25, 2026

    @rodrigoborquez

    Additional evidence from #59047 (Windows x64, desktop 2.1.4), which confirms this report and shows the missing Settings row is not the only blocker.

    general.showFileTree: true does not make the tree appear. That install already had it enabled in opencode.settings, and the file tree was still unreachable:

    • persisted layout (drafts.sqlite, opencode.global.dat / layout): "fileTree": {"opened": false, "width": 200, "tab": "changes"}
    • the sidebar toggle button.session-review-v2-sidebar-toggle (aria-label="Toggle File Tree" / "Mostrar u ocultar árbol de archivos") renders with disabled === true, reproduced in both a git repository and a non-git directory
    • no fileTree.toggle command in the command palette
    • [data-component="file-tree-v2"] is mounted but has height === 0 (223x0) with empty text

    Setting fileTree.opened: true and tab: "all" in the persisted layout makes the tree render correctly (223x508, full project listing), so the tree itself works. The actual gate is fileTree.opened, not showFileTree, and fileTree.opened has no reachable UI control.

    So wiring up the Settings row would not fix the issue on its own: the toggle that is supposed to open the tree is shipped disabled, so even with showFileTree on, the tree stays hidden.

  3. Dante-dan commented on Oct 25, 2026

    @Dante-dan
    Contributor

    Thanks for adding the 2.1.4 evidence. I checked current dev at 7b5b7a8020040d7ffc9cf59d4b5c6d7f8d33d3e0 and found two separate controls:

    • The legacy side-region file tree still opens only when both settings.visibility.fileTree() and layout.fileTree.opened() are true in screen-layout.ts.
    • The Review panel passes no disabled prop to SessionReviewV2SidebarToggle in panel.tsx, so current dev source does not explain a disabled Review-panel toggle.

    PR #57539 is merged into beta; it removes the legacy tree there, while current dev still contains that gate. Could you confirm the exact 2.1.4 build/channel and whether the disabled control was the Review-panel sidebar toggle or the legacy file-tree command/menu? That will distinguish which state/control your report exercises. I have compared source and your report only; I have not reproduced the Desktop behavior.

  4. rodrigoborquez commented on Oct 26, 2026

    @rodrigoborquez

    Build confirmed first, then which control.

    Exact build/channel

    • OpenCode Desktop 2.1.4, Windows x64. FileVersion 2.1.4, ProductVersion 2.1.4.0, signed CN="Anomaly Innovations, Inc", installed at %LOCALAPPDATA%\Programs\@opencodedesktop.
    • Channel latest, from resources/app-update.yml:
    provider: generic
    url: https://opencode.ai/update/api/latest/desktop/opencode/
    channel: latest
    • Bundled CLI: resources/opencode-cli.version = 2.1.4; the standalone CLI of the same build reports v2.1.4.

    Which control was disabled

    The Review-panel sidebar toggle, not the legacy command/menu.

    Observed on the web UI served by the same 2.1.4 server (same bundle):

    <div data-slot="session-review-v2-sidebar-toggle">
      <button class="... session-review-v2-sidebar-toggle" disabled
              aria-label="Mostrar u ocultar árbol de archivos">
    </div>

    disabled === true, inside [data-component="session-review-v2"], next to [data-component="session-review-v2-sidebar-root"] which contains [data-component="file-tree-v2"].

    Separately: fileTree.toggle does exist in the View menu (labelKey: desktop.menu.toggleFileTree) but did not appear in the command palette in this build.

    Your source read matches the 2.1.4 bundle

    The legacy gate is there verbatim:

    d = W(() => e.isDesktop() && t.sidebar() && r.visibility.fileTree() && n.fileTree.opened())

    So both visibility.fileTree and layout.fileTree.opened exist in 2.1.4. Note that the settings key in this build is settings.v3.general.showFileTree (schema default false), which is a different key from visibility.fileTree.

    On the missing disabled prop

    2.1.4 does have one, in the file-panel variant of the toggle:

    sidebarToggle: k(() => !!e.mobile)() ? void 0 : P(pe, {
      get opened(){ return f() },
      get disabled(){ return e.placeholder },
      get onToggle(){ return e.state.toggle }
    })

    The other variant (get sidebarToggle(){ ... e.state.sidebar.toggle }) passes no disabled. That would explain the difference you found against current dev.

    Scope caveat

    In every observation the panel was in its empty state ("Selecciona un archivo para abrir" / "Select a file to open"), so placeholder was truthy. I did not test with a file actually open, so I cannot distinguish "disabled whenever no file is open" from "always disabled in 2.1.4". State at the time: settings.v3.general.showFileTree: true, layout.fileTree: {opened: false, tab: "changes"}; setting opened: true + tab: "all" rendered the tree (223x0 -> 223x508, full project listing).

  5. Dante-dan commented on Oct 26, 2026

    @Dante-dan
    Contributor

    The empty-state detail explains the disabled prop in current source. At 350dc1a, the file browser computes sidebarOpened = placeholder || state.opened(), then passes both opened={sidebarOpened()} and disabled={placeholder} to that button. While the file launcher is empty, its sidebar is forced open and its collapse button is disabled. The separate Review-tab variant still passes no disabled prop.

    That explains why the button can be disabled without proving that disabling it caused the hidden tree. It does not explain your zero-height tree: the placeholder file browser should already be showing its sidebar. Removing disabled alone would not change its forced-open state.

    The remaining distinction is whether the zero-height element belongs to that forced-open file-browser sidebar or the separately gated legacy tree. Opening a file would also test whether this button becomes enabled when placeholder becomes false. I have traced source against your bundle excerpt; I have not reproduced the Windows layout.

  6. rodrigoborquez commented on Oct 26, 2026

    @rodrigoborquez

    Tested it — you were right, and the premise of my report was wrong.

    With the file panel active (Abrir archivo), the tree renders normally with layout.fileTree.opened still false:

    [data-component="file-tree-v2"]  h=508  w=223  data-total-rows="17"  children=17
    text: .cursor .git .github .vscode backend bruno deploy docs frontend
          postman scripts .editorconfig .gitignore AGENTS.md README.md .env.pentest.local
    

    So the 223x0 reading was my measurement error, not a layout bug: I measured while the file panel was not the active dock tab, so the element was not rendered and getBoundingClientRect() returned 0. The ancestor chain I reported (scroll-view__viewport h=700 -> session-review-v2-sidebar-tree h=700 -> session-review-v2-sidebar h=783) is the forced-open placeholder sidebar you described.

    Opening a file confirms the placeholder binding end to end:

    State toggle disabled aria-expanded tree
    file launcher empty true true rendered, 17 rows
    AGENTS.md opened false true rendered, toggle enabled
    toggle clicked while file open false false sidebar collapsed, file-tree-v2 unmounted

    So the button is enabled exactly when placeholder becomes false, and it then behaves as a working collapse control. No disabled-state bug in this build.

    What remains from my original report after this correction:

    • The Review-panel file tree in 2.1.4 is reachable and functional: Review -> Abrir archivo -> tree in the left sidebar of that panel.
    • I could not exercise the legacy side-region tree. desktop.menu.toggleFileTree / fileTree.toggle produced no visible change in this build, which may simply be the part refactor(app): retire the legacy side-panel file tree #57539 removes.
    • settings.v3.general.showFileTree is true in this install and does not appear to gate the Review-panel tree at all.

    I'll correct my duplicate #59047 as well. Sorry for the noise: the zero-height was my measurement, not the widget.

  7. jox51 commented on Nov 5, 2026

    @jox51

    Confirming on the current release, and the reproduction has changed since the report.

    Desktop 2.2.5, macOS arm64, latest channel. general.showFileTree is still false by default and still has no Settings row, so the report stands. But setting it no longer brings the command back:

    1. Set general.showFileTree: true and visibility.fileTree: true in drafts.sqlite (default.dat/settings.v3).
    2. Set layout.fileTree.opened: true in opencode.global.dat/layout.
    3. Quit and relaunch.

    Result: the values persist, and View still shows only Toggle Sidebar and Toggle Terminal. No Toggle File Tree, and Ctrl+\ does nothing. So showFileTree no longer registers the command on 2.2.5.

    The tree itself has not been removed. file-tree-v2 ships in the 2.2.5 bundle, rendered inside the file browser panel: file.browse ("Open file", View, ctrl+meta+p) opens that panel and the tree renders in its sidebar, with layout.fileTree.opened still false.

    So there are two separate things left: the retired side-panel entry point (this report), and a discoverability gap on the new one — nothing in the UI points at file.browse, and it is right-side only with no way to place it on the left.

  8. neriousy commented on Nov 23, 2026

    @neriousy
    Member

    This was fixed in #57539, which removed the old side panel file tree and its hidden setting. The file tree now lives in the Review panel (Ctrl+Shift+R). If you still see this on the latest version, comment here and we'll reopen.

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions