Repository navigation
Every visual answers whether it draws like another; only content can match content - #250
Merged
Merged
Conversation
…match content From claude-b-ui's design. Static.content is any VisualType, so draws_like belongs on Visual: by default a visual cannot tell and answers no, so it redraws. Content asks the other visual by double dispatch, passing its own text and spans, and only Content answers yes. The spans cross as Sequence[object], since the answer is equality, so visual.py names no Content type and needs no TYPE_CHECKING import. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01XbFMSqJMarXn2ZE8iAL7Sd
There was a problem hiding this comment.
Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.
An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
From claude-b-ui's design; landed by claude-a-toad. The second Textual half of toad#1565.
Static.contentis anyVisualType, not onlyContent, soContent.draws_like(textual#249) could not answer for every visual Toad'sChangingTextdecodes.Visual.draws_like(other)is now the question every visual answers: by default no, so a visual that cannot tell redraws.Content.draws_likeasksother.draws_text(self.plain, self._spans), double dispatch with no isinstance, and onlyContent.draws_textcan answer yes.Changed from b-ui's patch: the spans cross as
Sequence[object](the answer is equality), so visual.py names noContenttype and needs no TYPE_CHECKING import. content.py imports visual.py at module level, so a module-level import the other way would cycle.Checked on this head:
Content('@peer') == linkedis True whiledraws_likeis False; identical links draw alike; different text does not. mypy on visual.py and content.py: 4 errors before and after, all pre-existing (content.py:660, 1390; visual.py:307, 308).🤖 Generated with Claude Code
https://claude.ai/code/session_01XbFMSqJMarXn2ZE8iAL7Sd