Skip to content

Commit

Permalink
fix InformaionScreen scroll issue: height do not match.
Browse files Browse the repository at this point in the history
  • Loading branch information
laixintao committed Oct 21, 2023
1 parent ca5bd96 commit 95e7c2b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 15 deletions.
2 changes: 1 addition & 1 deletion flameshow/pprof_parser/parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ def render_detail(self, sample_index: int, sample_unit: str):
)
frame = frame.parent

return Text.assemble(*detail), len(detail)
return Text.assemble(*detail)

def render_title(self) -> str:
return self.display_name
Expand Down
18 changes: 4 additions & 14 deletions flameshow/render/framedetail.py
Original file line number Diff line number Diff line change
Expand Up @@ -340,9 +340,7 @@ def compose(self):
FrameStatAll(self.frame, self.profile, self.sample_index),
id="stat-container",
)
content, *_ = self.frame.render_detail(
self.sample_index, self.sample_unit
)
content = self.frame.render_detail(self.sample_index, self.sample_unit)
span_detail = Static(
content,
id="span-detail",
Expand All @@ -363,11 +361,8 @@ def _rerender(self):
except NoMatches:
return
span_stack_container.border_title = self.frame.render_title()
content, height = self.frame.render_detail(
self.sample_index, self.sample_unit
)
content = self.frame.render_detail(self.sample_index, self.sample_unit)
span_detail.update(content)
span_detail.styles.height = height

try:
frame_this_widget = self.query_one("FrameStatThis")
Expand Down Expand Up @@ -419,14 +414,11 @@ def __init__(
def compose(self):
center_text = "Stack detail information"
yield FlameshowHeader(center_text)
content, height = self.frame.render_detail(
self.sample_index, self.sample_unit
)
content = self.frame.render_detail(self.sample_index, self.sample_unit)
span_detail = Static(
content,
id="span-detail",
)
span_detail.styles.height = height
span_stack_container = VerticalScroll(
span_detail, id="span-stack-container"
)
Expand All @@ -445,9 +437,7 @@ def watch_sample_index(self, new_sample_index):
def _rerender(self):
if not self.composed:
return
content, _ = self.frame.render_detail(
self.sample_index, self.sample_unit
)
content = self.frame.render_detail(self.sample_index, self.sample_unit)
try:
span_detail = self.query_one("#span-detail")
except NoMatches:
Expand Down

0 comments on commit 95e7c2b

Please sign in to comment.