Repository: Textualize/textual
File: src/textual/dom.py (Python)

Code before:
                        highlighter(f"region={child.region!r}"),
                        highlighter(
                            f"virtual_size={child.virtual_size!r}",
                        ),
                    ]
                )
                css = child.styles.css
                if css:
                    info = Group(
                        info,
                        Panel.fit(
                            Text(child.styles.css),
                            border_style="dim",
                            title="css",
                            title_align="left",
                        ),
                    )
                branch = tree.add(info)
                if tree.children:
                    add_children(branch, child)

        add_children(tree, self)
        return tree

    @property
    def displayed_children(self) -> NodeList:
        return NodeList([child for child in self.children if child.display])

    def get_pseudo_classes(self) -> Iterable[str]:
        """Get any pseudo classes applicable to this Node, e.g. hover, focus.

        Returns:
            Iterable[str]: Iterable of strings, such as a generator.
        """
        return ()

    def reset_styles(self) -> None:
        from .widget import Widget

        for node in self.walk_children():
            node._css_styles.reset()
            if isinstance(node, Widget):
                node.set_dirty()
                node._layout_required = True

    def on_style_change(self) -> None:
        pass

    def add_child(self, node: DOMNode) -> None:
        """Add a new child node.


Review comment (suggestion):
I don't think this needs to be a `NodeList`, which is used to control how the dev adds widgets. Plain old List is fine.

Code after:
                        highlighter(f"region={child.region!r}"),
                        highlighter(
                            f"virtual_size={child.virtual_size!r}",
                        ),
                    ]
                )
                css = child.styles.css
                if css:
                    info = Group(
                        info,
                        Panel.fit(
                            Text(child.styles.css),
                            border_style="dim",
                            title="css",
                            title_align="left",
                        ),
                    )
                branch = tree.add(info)
                if tree.children:
                    add_children(branch, child)

        add_children(tree, self)
        return tree

    @property
    def displayed_children(self) -> list[DOMNode]:
        return [child for child in self.children if child.display]

    def get_pseudo_classes(self) -> Iterable[str]:
        """Get any pseudo classes applicable to this Node, e.g. hover, focus.

        Returns:
            Iterable[str]: Iterable of strings, such as a generator.
        """
        return ()

    def reset_styles(self) -> None:
        from .widget import Widget

        for node in self.walk_children():
            node._css_styles.reset()
            if isinstance(node, Widget):
                node.set_dirty()
                node._layout_required = True

    def on_style_change(self) -> None:
        pass

    def add_child(self, node: DOMNode) -> None:
        """Add a new child node.