Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change conversation height calculation from Javascript to CSS #406

Open
marc-farre opened this issue Jul 18, 2024 · 5 comments
Open

Change conversation height calculation from Javascript to CSS #406

marc-farre opened this issue Jul 18, 2024 · 5 comments

Comments

@marc-farre
Copy link
Contributor

The conversation HTML element height is calculated in real time with JavaScript:

image

With this function: https://github.com/humhub/mail/blob/master/resources/js/humhub.mail.ConversationView.js#L378-L404

This function could be removed if we have the following LESS code:

#mail-conversation-root > .panel {
    display: flex;
    flex-direction: column;
    height: calc(100vh - 165px); // 165px depends on the top menu and should be adpated for different screen width using the @media rule
    
    > .panel-body {
        flex: 1;
        min-height: 150px;
        overflow: auto;
    }

    .mail-message-form {
        .content-create-input-group {
            position: relative;
        }
    }
}

For testing, we need to overwrite existing LESS code which should be removed:

    .conversation-entry-list {
        max-height: none;
        height: auto;
        overflow: unset;
    }

    .mail-message-form {
        position: static;
    }

Benefits:

  • More reliable
  • Instant height resizing when adding new lines in the reply form
  • Reduced processor resource consumption
  • possibility to change the height calculation in custom theme by overwriting the height: calc(100vh - 165px);

This would solve the issue we currently have with the Clean Theme on mobile, where the bottom bar is displayed on top of the reply form.

@marc-farre
Copy link
Contributor Author

@luke- would you accept such a PR?

@marc-farre
Copy link
Contributor Author

See humhub/humhub#7131 for the CSS height calculation of #mail-conversation-root > .panel

@luke-
Copy link
Contributor

luke- commented Jul 19, 2024

@marc-farre Thanks, looks good for me.

@yurabakhtin Can you please check?

@marc-farre
Copy link
Contributor Author

@yurabakhtin I'll send a PR so you can test the changes, but after creating the --fixed-header-height and --fixed-footer-height CSS variables in HumHub core (see humhub/humhub#7131).

So, this PR will change HumHub minimum version to HumHub 1.17.

@marc-farre
Copy link
Contributor Author

@luke- @yurabakhtin PR #407

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants