Skip to content

Commit

Permalink
Combine excerpt footer and header into a single block (#19441)
Browse files Browse the repository at this point in the history
This simplifies rendering of excerpt headers and footers, and removes
the need to store a `BlockDisposition` on these boundary blocks. It's a
step toward implementing "replace blocks", which we want to use in the
assistant panel.

We've also cleaned up the way heights are specified for headers and
footers and fixed some visual asymmetries between the "expand upward"
and "expand downward" buttons.

Release Notes:

- N/A

---------

Co-authored-by: Richard <[email protected]>
  • Loading branch information
maxbrunsfeld and rtfeldman authored Oct 19, 2024
1 parent 3e0c5c1 commit d209eab
Show file tree
Hide file tree
Showing 7 changed files with 397 additions and 549 deletions.
4 changes: 1 addition & 3 deletions crates/diagnostics/src/diagnostics_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -962,7 +962,6 @@ fn random_diagnostic(

const FILE_HEADER: &str = "file header";
const EXCERPT_HEADER: &str = "excerpt header";
const EXCERPT_FOOTER: &str = "excerpt footer";

fn editor_blocks(
editor: &View<Editor>,
Expand Down Expand Up @@ -998,7 +997,7 @@ fn editor_blocks(
.ok()?
}

Block::ExcerptHeader {
Block::ExcerptBoundary {
starts_new_buffer, ..
} => {
if *starts_new_buffer {
Expand All @@ -1007,7 +1006,6 @@ fn editor_blocks(
EXCERPT_HEADER.into()
}
}
Block::ExcerptFooter { .. } => EXCERPT_FOOTER.into(),
};

Some((row, name))
Expand Down
Loading

0 comments on commit d209eab

Please sign in to comment.