Skip to content

bug: PVE 虚拟机进入控制台后,顶部视图切换栏收缩为纯图标且不恢复 #1638

Description

@Infinifar

设备 / Device:Android 16,ServerBox 1.0.1719

🇨🇳 中文

描述 Bug
横屏下,虚拟机页选中一台 PVE 虚拟机后点「控制台」,顶部视图切换栏(概览/控制台/硬件/快照/备份/设置)收缩成纯图标、文字消失;再切到其他视图也仍保持收缩。

复现步骤

  1. 横屏打开「虚拟机」,选中 PVE 主机和一台虚拟机(右侧详情面板)
  2. 点右侧「控制台」
  3. 顶部视图栏收缩为纯图标(图 1)
  4. 再点「概览/硬件」等,仍保持收缩(图 2 为正常状态)

期望结果:切换视图后恢复显示文字标签。
实际结果:进过一次控制台后标签就再也不显示。

更多信息(可能原因)
fl_lib 的 SegmentedTabs._onMeasured:带标签所需宽度 > 可用宽度即进入 _compact(只留图标),并记住当时的 _fullWidth,之后只有可用宽度 ≥ _fullWidth 才恢复标签。选中「控制台」时该段多出二级切换(终端/图形),行变宽 → 进入 compact;而 _fullWidth 大于当前可用宽度,所以切到其他视图也回不来。

🇬🇧 English

Describe the bug
In landscape, on the Virtualization tab, selecting a PVE guest and tapping Console collapses the view switcher above (Overview / Console / Hardware / Snapshots / Backup / Settings) into icons only. Switching to any other view keeps it collapsed.

To reproduce

  1. In landscape, open Virtualization and pick a PVE host and one guest (detail pane on the right)
  2. Tap Console
  3. The switcher collapses to icons only (screenshot 1)
  4. Tap Overview / Hardware etc. — it stays collapsed (screenshot 2 is normal)

Expected: the switcher shows its labels again after switching views.
Actual: once Console has been opened, the labels never come back.

Additional context (likely cause)
SegmentedTabs._onMeasured in fl_lib: when the width needed with labels exceeds the room it goes _compact (icons only) and remembers _fullWidth as the width needed at that moment; labels return only once the room is at least _fullWidth. Selecting Console adds its second level (Terminal/Graphical), widening the row → compact; that _fullWidth is wider than the current room, so other views never bring the labels back.

Activity

  1. added
    bugSomething isn't working
    libcaused by third-party lib
    on Oct 4, 2026
  2. winnowl commented on Oct 4, 2026

    @winnowl

    Issue triage

    Feasibility:needs-clarification | Risk:medium

    Related code:

    • fl_lib · SegmentedTabs._onMeasured

    Information needed to reproduce:

    • Does this reproduce with other hypervisors or only PVE guests?
    • Does rotating to portrait and back restore the labels?
    • Which exact view transitions keep the tabs compact, and does resizing the detail pane affect it?

    Suggested labels(not applied automatically):bug, ui, android, virtualization

  3. Infinifar commented on Oct 4, 2026

    @Infinifar
    Author

    补充信息:

    • 只在 PVE 上复现;手头没有 libvirt/KVM 主机可以对比。
    • 转成竖屏再转回横屏,标签会恢复。
    • 触发条件:只有「同时提供终端与图形两种控制台」的虚拟机(例如 Linux 虚拟机)点「控制台」时触发;只有图形控制台的 Windows 虚拟机不会触发。触发后,切到概览/硬件/快照/备份/设置仍保持纯图标。
    • 拖动中间分隔条改变宽度是否影响:未测试。

    这与 SegmentedTabs._onMeasured 的行为一致:控制台的二级切换(终端/图形)把整行撑宽 → 进入 _compact → 记下的 _fullWidth 大于当前可用宽度 → 切到其他视图也不会恢复;而转屏时页面被重建,控件状态重置,所以标签回来了。


    Additional details:

    • Reproduces on PVE only; no libvirt/KVM host available to compare.
    • Rotating to portrait and back to landscape brings the labels back.
    • Trigger: only a guest that offers both consoles (terminal + graphical), e.g. a Linux guest, when its Console view is opened. A Windows guest (graphical only) does not trigger it. Once triggered, switching to Overview/Hardware/Snapshots/Backup/Settings keeps it icons-only.
    • Whether dragging the divider (pane width) affects it: not tested.

    This matches SegmentedTabs._onMeasured: the Console segment's second level (Terminal/Graphical) widens the row → _compact → the remembered _fullWidth is wider than the current room → other views do not bring the labels back; a rotation rebuilds the page and resets the state, which is why the labels return.

  4. lollipopkit commented on Oct 9, 2026

    @lollipopkit
    Owner

    已在 #1671 修复, 请等待下次发版

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

    bugSomething isn't workinglibcaused by third-party lib

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions