Repository: zellij-org/zellij
File: zellij-server/src/ui/pane_boundaries_frame.rs (Rust)

Code before:
                ret
            } else {
                self.empty_undertitle(max_undertitle_length)
            }
        } else {
            if first_part_len <= max_undertitle_length {
                // render first part
                let full_text_len = first_part_len;
                let mut padding = String::new();
                for _ in full_text_len..max_undertitle_length {
                    padding.push_str(boundary_type::HORIZONTAL);
                }
                let mut ret = vec![];
                ret.append(&mut left_boundary);
                ret.append(&mut first_part);
                ret.append(&mut foreground_color(&padding, self.color));
                ret.append(&mut right_boundary);
                ret
            } else {
                self.empty_undertitle(max_undertitle_length)
            }
        };
        Ok(res)
    }
    pub fn render(&self) -> Result<(Vec<CharacterChunk>, Option<String>)> {
        let err_context = || "failed to render";
        let mut character_chunks = vec![];
        for row in 0..self.geom.rows {
            if row == 0 {
                // top row
                let title = self.render_title().with_context(err_context)?;
                let x = self.geom.x;
                let y = self.geom.y + row;
                character_chunks.push(CharacterChunk::new(title, x, y));
            } else if row == self.geom.rows - 1 {
                // bottom row
                if self.exit_status.is_some() {
                    let x = self.geom.x;
                    let y = self.geom.y + row;
                    character_chunks.push(CharacterChunk::new(
                        self.render_held_undertitle().with_context(err_context)?,
                        x,
                        y,
                    ));
                } else {
                    let mut bottom_row = vec![];
                    for col in 0..self.geom.cols {
                        let boundary = if col == 0 {
                            // bottom left corner
                            self.get_corner(boundary_type::BOTTOM_LEFT)
                        } else if col == self.geom.cols - 1 {

Review comment (bug):
We have many functions called `render` in the code, so we can add some additional information:

```suggestion
        let err_context = || "failed to render pane frame";
```

Code after:
                ret
            } else {
                self.empty_undertitle(max_undertitle_length)
            }
        } else {
            if first_part_len <= max_undertitle_length {
                // render first part
                let full_text_len = first_part_len;
                let mut padding = String::new();
                for _ in full_text_len..max_undertitle_length {
                    padding.push_str(boundary_type::HORIZONTAL);
                }
                let mut ret = vec![];
                ret.append(&mut left_boundary);
                ret.append(&mut first_part);
                ret.append(&mut foreground_color(&padding, self.color));
                ret.append(&mut right_boundary);
                ret
            } else {
                self.empty_undertitle(max_undertitle_length)
            }
        };
        Ok(res)
    }
    pub fn render(&self) -> Result<(Vec<CharacterChunk>, Option<String>)> {
        let err_context = || "failed to render pane frame";
        let mut character_chunks = vec![];
        for row in 0..self.geom.rows {
            if row == 0 {
                // top row
                let title = self.render_title().with_context(err_context)?;
                let x = self.geom.x;
                let y = self.geom.y + row;
                character_chunks.push(CharacterChunk::new(title, x, y));
            } else if row == self.geom.rows - 1 {
                // bottom row
                if self.exit_status.is_some() {
                    let x = self.geom.x;
                    let y = self.geom.y + row;
                    character_chunks.push(CharacterChunk::new(
                        self.render_held_undertitle().with_context(err_context)?,
                        x,
                        y,
                    ));
                } else {
                    let mut bottom_row = vec![];
                    for col in 0..self.geom.cols {
                        let boundary = if col == 0 {
                            // bottom left corner
                            self.get_corner(boundary_type::BOTTOM_LEFT)
                        } else if col == self.geom.cols - 1 {