Table - part of tree table node looks clickable but is not
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 3/5
- 見積もり時間
- 1〜2日
- 初心者へのやさしさ
- 56/100
- issue の種類
- バグ
- 明瞭さ
- おおむね明確
- 活発さ
- 活発
- 技術スタック
- react, typescript
調査の方向性
Start with the table tree view example at https://www.patternfly.org/components/table#tree-table and compare its click behavior with the checkbox tree view example and the data-view tree table example linked in the issue. The supplied TableTree code shows TreeRowWrapper and Td with treeRow; determine whether the pointer area should trigger the existing row action and whether a basic non-checkbox example is needed. Done when the tree table’s pointer affordance matches its actual clickable area and the expected behavior is documented or demonstrated.
索引モデルが issue の本文から書いたものです。
説明
Here's a link to the example - https://www.patternfly.org/components/table#tree-table. There is also an example below that and another in the data-view extension - https://www.patternfly.org/extensions/data-view/table/#tree-table
Right now the .pf-v6-c-table__tree-view-main element that wraps the entire first part of the node row (toggle + checkbox + node text, and all the space around those things) has a cursor pointer, but only the toggle and checkbox are clickable. Clicking the text or area around the toggle/check (including to the left of them on nested rows) doesn't appear to do anything.
If you compare to the checkbox tree view component example, the entire rows in tree view are clickable because on a non-checkbox node, the whole row is wrapped in a <button>, and the whole row on checkbox nodes is wrapped in a <label> pointing to the checkbox.
Should there be parity between the two? cc @andrew-ronaldson
Also should we add a basic/non-checkbox tree table example? I tried removing the checkboxes from the current example and the text field wasn't clickable but I don't know if I did it correctly. Below is the code I used:
import { useState } from 'react';
import { Table, Thead, Tr, Th, Tbody, Td, TreeRowWrapper, TdProps } from '@patternfly/react-table';
import LeafIcon from '@patternfly/react-icons/dist/esm/icons/leaf-icon';
import RhUiFolderFillIcon from '@patternfly/react-icons/dist/esm/icons/rh-ui-folder-fill-icon';
import RhUiFolderOpenFillIcon from '@patternfly/react-icons/dist/esm/icons/rh-ui-folder-open-fill-icon';
interface RepositoriesTreeNode {
name: string;
branches: string;
pullRequests: string;
workspaces: string;
children?: RepositoriesTreeNode[];
}
export const TableTree: React.FunctionComponent = () => {
// In real usage, this data would come from some external source like an API via props.
const data: RepositoriesTreeNode[] = [
{
name: 'Repositories one',
branches: 'Branch one',
pullRequests: 'Pull request one',
workspaces: 'Workplace one',
children: [
{
name: 'Repositories two',
branches: 'Branch two',
pullRequests: 'Pull request two',
workspaces: 'Workplace two',
children: [
{
name: 'Repositories three',
branches: 'Branch three',
pullRequests: 'Pull request three',
workspaces: 'Workplace three'
},
{
name: 'Repositories four',
branches: 'Branch four',
pullRequests: 'Pull request four',
workspaces: 'Workplace four'
}
]
},
{
name: 'Repositories five',
branches: 'Branch five',
pullRequests: 'Pull request five',
workspaces: 'Workplace five'
},
{
name: 'Repositories six',
branches: 'Branch six',
pullRequests: 'Pull request six',
workspaces: 'Workplace six'
}
]
},
{
name: 'Repositories seven',
branches: 'Branch seven',
pullRequests: 'Pull request seven',
workspaces: 'Workplace seven',
children: [
{
name: 'Repositories eight',
branches: 'Branch eight',
pullRequests: 'Pull request eight',
workspaces: 'Workplace eight'
}
]
},
{
name: 'Repositories nine',
branches: 'Branch nine',
pullRequests: 'Pull request nine',
workspaces: 'Workplace nine'
}
];
const columnNames = {
name: 'Repositories',
branches: 'Branches',
prs: 'Pull requests',
workspaces: 'Workspaces'
};
const [expandedNodeNames, setExpandedNodeNames] = useState<string[]>(['Repositories one']);
const [expandedDetailsNodeNames, setExpandedDetailsNodeNames] = useState<string[]>([]);
/**
Recursive function which flattens the data into an array of flattened TreeRowWrapper components
params:
- nodes - array of a single level of tree nodes
- level - number representing how deeply nested the current row is
- posinset - position of the row relative to this row's siblings
- currentRowIndex - position of the row relative to the entire table
- isHidden - defaults to false, true if this row's parent is expanded
*/
const renderRows = (
[node, ...remainingNodes]: RepositoriesTreeNode[],
level = 1,
posinset = 1,
rowIndex = 0,
isHidden = false
): React.ReactNode[] => {
if (!node) {
return [];
}
const isExpanded = expandedNodeNames.includes(node.name);
const isDetailsExpanded = expandedDetailsNodeNames.includes(node.name);
let icon = <LeafIcon />;
if (node.children) {
icon = isExpanded ? <RhUiFolderOpenFillIcon /> : <RhUiFolderFillIcon />;
}
const treeRow: TdProps['treeRow'] = {
onCollapse: () =>
setExpandedNodeNames((prevExpanded) => {
const otherExpandedNodeNames = prevExpanded.filter((name) => name !== node.name);
return isExpanded ? otherExpandedNodeNames : [...otherExpandedNodeNames, node.name];
}),
onToggleRowDetails: () =>
setExpandedDetailsNodeNames((prevDetailsExpanded) => {
const otherDetailsExpandedNodeNames = prevDetailsExpanded.filter((name) => name !== node.name);
return isDetailsExpanded ? otherDetailsExpandedNodeNames : [...otherDetailsExpandedNodeNames, node.name];
}),
rowIndex,
props: {
isExpanded,
isDetailsExpanded,
isHidden,
'aria-level': level,
'aria-posinset': posinset,
'aria-setsize': node.children ? node.children.length : 0,
icon
}
};
const childRows =
node.children && node.children.length
? renderRows(node.children, level + 1, 1, rowIndex + 1, !isExpanded || isHidden)
: [];
return [
<TreeRowWrapper key={node.name} row={{ props: treeRow.props }}>
<Td dataLabel={columnNames.name} treeRow={treeRow}>
{node.name}
</Td>
<Td dataLabel={columnNames.branches}>{node.branches}</Td>
<Td dataLabel={columnNames.prs}>{node.pullRequests}</Td>
<Td dataLabel={columnNames.workspaces}>{node.workspaces}</Td>
</TreeRowWrapper>,
...childRows,
...renderRows(remainingNodes, level, posinset + 1, rowIndex + 1 + childRows.length, isHidden)
];
};
return (
<Table isTreeTable aria-label="Tree table">
<Thead>
<Tr>
<Th width={40}>{columnNames.name}</Th>
<Th>{columnNames.branches}</Th>
<Th>{columnNames.prs}</Th>
<Th>{columnNames.workspaces}</Th>
</Tr>
</Thead>
<Tbody>{renderRows(data)}</Tbody>
</Table>
);
};
Jira Issue: PF-4745
Jira Issue: FELT-4421
- 主要言語
- TypeScript
- スター
- 859
- フォーク
- 395
- 平均マージ
- 3日 13時間
- マージ済み PR(30日)
- 15
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
patternfly/patternfly-react のほかの issue
-
fix(table): CollapseColumn uses wrong caret icon for expandable row toggle対応中かも @redhat-chai-bot が今日担当しました。 オープン
難易度 1/5 1時間未満 初心者へのやさしさ 85/100
patternfly/patternfly-react#12727 ·
メンテナーはふだん 1 日以内に返信
-
Bug - PageSidebar - collapsed sidebar is aria-hidden but its navigation links stay in the tab order対応中かも @Sophran-fbj が 4 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100
patternfly/patternfly-react#12693 ·
メンテナーはふだん 1 日以内に返信
-
Bug - Label - Doesn't allow ref forwarding対応中かも @tarunvashishth が 28 日前に担当しました。 オープンPF Team Stale
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
patternfly/patternfly-react#12651 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
Bug - [Menu] - Flyout stays open when hovering a disabled item対応中かも @fallmo が 64 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
patternfly/patternfly-react#12637 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
PF Team Stale
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
patternfly/patternfly-react#12617 · コメント 2 件 ·
メンテナーはふだん 1 日以内に返信
patternfly/patternfly-react の issue をすべて見る
似ている issue
-
[Site] Active section detection should respect scroll-margin-top対応中かも このイシューにリンクされたプルリクエストがオープン中、またはマージ済みです。 オープンarea/web reproduced type/bug
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
anomalyco/opencode#65384 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
swc-project/swc-ai-issues#1001 ·
-
check:passed streams:add
難易度 1/5 1時間未満 初心者へのやさしさ 62/100
メンテナーはふだん 1 日以内に返信
-
CLI OAuth login fails behind an authenticating proxy: GET /api/v1/user omits Proxy-Authorizationオープン
難易度 1/5 1時間未満 初心者へのやさしさ 85/100
lightdash/lightdash#33086 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
assessment bug course exercise programming
難易度 2/5 1〜3時間 初心者へのやさしさ 64/100
メンテナーはふだん 1 日以内に返信