feat(mobile-app): show all nodes in team tree with horizontal scroll

Remove the ellipsis logic that hides nodes when there are too many.
Now all nodes are displayed and users can scroll horizontally to see them.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
hailin 2026-01-03 23:52:44 -08:00
parent ef80a2f23b
commit f0f44aeb39
1 changed files with 4 additions and 32 deletions

View File

@ -113,30 +113,7 @@ class _TeamTreeWidgetState extends State<TeamTreeWidget> {
Widget _buildTreeLevel(List<TeamTreeNode> nodes, int level) {
if (nodes.isEmpty) return const SizedBox.shrink();
// 使 padding
final availableWidth = _containerWidth - 16; // padding (8*2)
final maxVisibleNodes = ((availableWidth + nodeHorizontalSpacing) / (nodeWidth + nodeHorizontalSpacing)).floor().clamp(1, 100);
//
List<TeamTreeNode> visibleNodes;
List<TeamTreeNode> hiddenNodes;
if (nodes.length <= maxVisibleNodes) {
visibleNodes = nodes;
hiddenNodes = [];
} else {
//
final showCount = maxVisibleNodes - 1; //
final frontCount = (showCount / 2).ceil();
final backCount = showCount - frontCount;
visibleNodes = [
...nodes.sublist(0, frontCount),
...nodes.sublist(nodes.length - backCount),
];
hiddenNodes = nodes.sublist(frontCount, nodes.length - backCount);
}
//
return Column(
children: [
//
@ -144,14 +121,9 @@ class _TeamTreeWidgetState extends State<TeamTreeWidget> {
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
for (int i = 0; i < visibleNodes.length; i++) ...[
if (i == (maxVisibleNodes - 1) ~/ 2 && hiddenNodes.isNotEmpty) ...[
//
_buildEllipsisNode(hiddenNodes),
SizedBox(width: nodeHorizontalSpacing),
],
_buildNodeWithChildren(visibleNodes[i]),
if (i < visibleNodes.length - 1) SizedBox(width: nodeHorizontalSpacing),
for (int i = 0; i < nodes.length; i++) ...[
_buildNodeWithChildren(nodes[i]),
if (i < nodes.length - 1) SizedBox(width: nodeHorizontalSpacing),
],
],
),