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

Add screenReaderText, Fix XTerm.js crash, Improve console log messages #1977

Merged
merged 3 commits into from
Jan 27, 2025

Conversation

martinpitt
Copy link
Member

@martinpitt martinpitt commented Jan 26, 2025

Fixups that I split out from #1976.

See this log for the dimensions crash:

error: TypeError: Cannot read properties of undefined (reading 'dimensions')

This fixes the avalanche of

> Th: Table headers must have an accessible name. If the Th is intended to be visually empty, pass in screenReaderText. If the Th contains only non-text, interactive content such as a checkbox or expand toggle, pass in an aria-label.

console messages, which completely drown any actually useful messages
for debugging.
During terminal initialization, the `_renderService` or its
`.dimensions` attribute may not yet be defined. Exit the resizing
function in this case instead of crashing with a `TypeError`.

Add a reference to the upstream issue about this internal API hackery.
@martinpitt martinpitt changed the title Add screenReaderText, Fix XTerm.js crash, Rewrite Application.init() async Add screenReaderText, Fix XTerm.js crash Jan 26, 2025
@martinpitt martinpitt marked this pull request as ready for review January 26, 2025 09:36
@martinpitt martinpitt requested a review from jelly January 26, 2025 09:36
@martinpitt martinpitt changed the title Add screenReaderText, Fix XTerm.js crash Add screenReaderText, Fix XTerm.js crash, Improve console log messages Jan 26, 2025
@@ -80,11 +80,14 @@ class ContainerLogs extends React.Component {
}

resize(width) {
if (!this.term?._core?._renderService?.dimensions)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This added line is not executed by any test.

Comment on lines +203 to +204
.catch(e => console.warn("initContainers", system ? "system" : "user",
"getContainers failed:", e.toString()));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These 2 added lines are not executed by any test.

@jelly jelly merged commit ff30e1c into cockpit-project:main Jan 27, 2025
33 checks passed
@martinpitt martinpitt deleted the fixups branch January 27, 2025 12:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants