You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
fix(tui): show /btw answers inline in the chat instead of a dialog - #77
/btw answered side questions in a modal alert dialog: it blocked the view of the running session and the answer vanished on dismiss. Now each side question becomes an inline block appended to the end of the transcript, tracked in a small signal on the session route:
The command pushes an entry as soon as the question is submitted (shown as btw: <question> with a "thinking..." state), then patches it in place with the answer or an error message when the forked session responds. The block is rendered inside the scrollbox after the messages, styled like the existing revert notice, so it scrolls with the conversation and the sticky-bottom scroll keeps it in view while the main run streams. The fork/prompt flow itself is unchanged; the error and "thinking" toasts are gone since the inline block covers both states.
Entries are client-side only and reset when you leave the session — same lifetime the dialog had, minus the interruption.
How did you verify your code works?
bun typecheck and bun test in packages/tui (198 pass)
Ran the TUI, asked /btw questions during a run: the block appears at the bottom of the chat with "thinking...", fills in with the answer, and error paths (fork/prompt failure) render inline.
Screenshots / recordings
Terminal UI change; behavior described above.
Checklist
I have tested my changes locally
I have not included unrelated changes in this PR
Need help on this PR? Tag @codesmith-bot with what you need. Autofix is enabled.
We reviewed changes in 38ab443...aec6c5f on this pull request. Below is the summary for the review, and you can see the individual issues we found as inline review comments.
Some issues found as part of this review are outside of the diff in this pull request and aren't shown in the inline review comments due to GitHub's API limitations. You can see those issues on the DeepSource dashboard.
PR Report Card
Overall Grade
Focus Area: Reliability
Security
Reliability
Complexity
Hygiene
Feedback
React hooks and type safety getting bypassed
The useDialog calls inside callbacks, the any, and the multiple non-null assertions all point to React/TS safety rails being side-stepped to get the behavior working.
It’s worth treating this file as a hotspot: tightening types and hook usage in one pass will likely prevent subtle runtime bugs here.
Local complexity building up in one file
The early use of PART_MAPPING and the fragment misuse both come from this component doing a lot in one place and juggling several concerns.
As this TUI evolves, this file may be a good candidate for breaking out helpers/components so state and rendering stay easier to reason about.
AI Review is run only on demand for your team. We're only showing results of static analysis review right now. To trigger AI Review, comment @deepsourcebot review on this thread.
The reason will be displayed to describe this comment to others. Learn more.
Expected 'undefined' and instead saw 'void'
The void operator takes an operand and returns undefined. It can be used to ignore the value produced by an expression. However, this can lead to code that is difficult to understand and maintain. Historically, the void operator was used to get a "pure" undefined value, as the undefined variable was mutable prior to ES5.
The reason will be displayed to describe this comment to others. Learn more.
JSX tree is too deeply nested. Found 6 levels of nesting
Nesting JSX elements too deeply can confuse developers reading the code. To make maintenance and refactoring easier, DeepSource recommends limiting the maximum JSX tree depth to 4.
The reason will be displayed to describe this comment to others. Learn more.
Unknown property 'marginTop' found
React components use JSX, not HTML.
So we need to use JSX attributes and React replicate the respective HTML property/attribute while rendering.
Use of HTML property in JSX can sometimes lead to errors.
For example, class is a keyword in JavaScript (JSX is an extension of JavaScript), so it will throw an error.
However, in HTML it is a valid attribute.
Note: If you use React with Web Components, use the class attribute instead.
The reason will be displayed to describe this comment to others. Learn more.
Unknown property 'flexShrink' found
React components use JSX, not HTML.
So we need to use JSX attributes and React replicate the respective HTML property/attribute while rendering.
Use of HTML property in JSX can sometimes lead to errors.
For example, class is a keyword in JavaScript (JSX is an extension of JavaScript), so it will throw an error.
However, in HTML it is a valid attribute.
Note: If you use React with Web Components, use the class attribute instead.
The reason will be displayed to describe this comment to others. Learn more.
Unknown property 'customBorderChars' found
React components use JSX, not HTML.
So we need to use JSX attributes and React replicate the respective HTML property/attribute while rendering.
Use of HTML property in JSX can sometimes lead to errors.
For example, class is a keyword in JavaScript (JSX is an extension of JavaScript), so it will throw an error.
However, in HTML it is a valid attribute.
Note: If you use React with Web Components, use the class attribute instead.
The reason will be displayed to describe this comment to others. Learn more.
Unknown property 'fg' found
React components use JSX, not HTML.
So we need to use JSX attributes and React replicate the respective HTML property/attribute while rendering.
Use of HTML property in JSX can sometimes lead to errors.
For example, class is a keyword in JavaScript (JSX is an extension of JavaScript), so it will throw an error.
However, in HTML it is a valid attribute.
Note: If you use React with Web Components, use the class attribute instead.
The reason will be displayed to describe this comment to others. Learn more.
Unknown property 'fg' found
React components use JSX, not HTML.
So we need to use JSX attributes and React replicate the respective HTML property/attribute while rendering.
Use of HTML property in JSX can sometimes lead to errors.
For example, class is a keyword in JavaScript (JSX is an extension of JavaScript), so it will throw an error.
However, in HTML it is a valid attribute.
Note: If you use React with Web Components, use the class attribute instead.
The reason will be displayed to describe this comment to others. Learn more.
Unknown property 'fg' found
React components use JSX, not HTML.
So we need to use JSX attributes and React replicate the respective HTML property/attribute while rendering.
Use of HTML property in JSX can sometimes lead to errors.
For example, class is a keyword in JavaScript (JSX is an extension of JavaScript), so it will throw an error.
However, in HTML it is a valid attribute.
Note: If you use React with Web Components, use the class attribute instead.
The reason will be displayed to describe this comment to others. Learn more.
Unknown property 'flexShrink' found
React components use JSX, not HTML.
So we need to use JSX attributes and React replicate the respective HTML property/attribute while rendering.
Use of HTML property in JSX can sometimes lead to errors.
For example, class is a keyword in JavaScript (JSX is an extension of JavaScript), so it will throw an error.
However, in HTML it is a valid attribute.
Note: If you use React with Web Components, use the class attribute instead.
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
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.
Issue for this PR
Closes #76
Type of change
What does this PR do?
/btwanswered side questions in a modal alert dialog: it blocked the view of the running session and the answer vanished on dismiss. Now each side question becomes an inline block appended to the end of the transcript, tracked in a small signal on the session route:The command pushes an entry as soon as the question is submitted (shown as
btw: <question>with a "thinking..." state), then patches it in place with the answer or an error message when the forked session responds. The block is rendered inside the scrollbox after the messages, styled like the existing revert notice, so it scrolls with the conversation and the sticky-bottom scroll keeps it in view while the main run streams. The fork/prompt flow itself is unchanged; the error and "thinking" toasts are gone since the inline block covers both states.Entries are client-side only and reset when you leave the session — same lifetime the dialog had, minus the interruption.
How did you verify your code works?
bun typecheckandbun testinpackages/tui(198 pass)/btwquestions during a run: the block appears at the bottom of the chat with "thinking...", fills in with the answer, and error paths (fork/prompt failure) render inline.Screenshots / recordings
Terminal UI change; behavior described above.
Checklist
Need help on this PR? Tag
@codesmith-botwith what you need. Autofix is enabled.