Skip to content

luci-app-dockerman: fix whitespace rendering in container logs - #8977

Open
jjm2473 wants to merge 1 commit into
openwrt:masterfrom
jjm2473:pr-master/fix-dockermanjs-logs-spacebars
Open

jjm2473 wants to merge 1 commit into
openwrt:masterfrom
jjm2473:pr-master/fix-dockermanjs-logs-spacebars

Conversation

@jjm2473

@jjm2473 jjm2473 commented Aug 24, 2026

Copy link
Copy Markdown
Contributor

Container logs contain significant whitespace, which gets collapsed by
normal HTML rendering, and that "white-space: pre-wrap;" preserves
that whitespace while still allowing long lines to wrap.

Pull request details

Description

Fix logs missing spacebar on render.

Screenshot or video of changes (if applicable)

Before:
image

After:
image

Maintainer (preferred)

@systemcrash


Tested on

OpenWrt version: OpenWrt 25.12.5
LuCI version: LuCI openwrt-25.12 branch
Web browser(s): Chrome 151.0.7922.76


Checklist

  • (Nice to have) Includes what Issue it closes (e.g. openwrt/luci#issue-number).
  • (Nice to have) Includes what it depends on (e.g. openwrt/packages#pr-number in sister repo).

@openwrt-ai openwrt-ai left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Reviewed 1 new commit; one inline issue on the approach taken (see comment). Commit message matches its diff, and CI on 70abada is green.


Generated by Claude Code

Comment thread applications/luci-app-dockerman/htdocs/luci-static/resources/dockerman/common.js Outdated
@jjm2473
jjm2473 force-pushed the pr-master/fix-dockermanjs-logs-spacebars branch from 70abada to 329f284 Compare August 25, 2026 03:49

@openwrt-ai openwrt-ai left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Reviewed 1 new commit. The &nbsp; escaping approach flagged last round has been replaced with white-space: pre-wrap; on the logs container, which addresses the wrapping regression and the tab-collapsing gap as well — ansiToHtml() already rewrites \r\n/\r/\n to <br/> before the string reaches the DOM, so pre-wrap won't double up line breaks. Commit message matches its diff. One nit inline; CI on 329f284 is green (x86_64 build still running).


Generated by Claude Code

@jjm2473

jjm2473 commented Aug 27, 2026

Copy link
Copy Markdown
Contributor Author

ping @systemcrash

@BKPepe BKPepe left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

The code change makes sense, but the commit message does not explain the actual problem being fixed.

Saying that this was "recommended by AI" is not useful as commit history. Please describe what is wrong with the log rendering and why white-space: pre-wrap fixes it.

For example, the message could explain that container logs contain significant whitespace, which gets collapsed by normal HTML rendering, and that pre-wrap preserves that whitespace while still allowing long lines to wrap.

The commit should document the technical reason for the change, not where the suggestion came from.

Container logs contain significant whitespace, which gets collapsed by
normal HTML rendering, and that "white-space: pre-wrap;" preserves
that whitespace while still allowing long lines to wrap.

Co-authored-by: OpenWrt AI review account <openwrt-ai@hauke-m.de>
Signed-off-by: Liangbin Lian <jjm2473@gmail.com>
@jjm2473
jjm2473 force-pushed the pr-master/fix-dockermanjs-logs-spacebars branch from 329f284 to 61f8734 Compare September 14, 2026 10:11
@jjm2473 jjm2473 changed the title luci-app-dockerman: fix logs missing spacebars luci-app-dockerman: fix whitespace rendering in container logs Sep 14, 2026

@openwrt-ai openwrt-ai left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Commit checks

  • 61f8734f "luci-app-dockerman: fix whitespace rendering in container logs" — the body's second clause is a dangling fragment (..., and that "white-space: pre-wrap;" preserves ...), because the "the message could explain that" framing it was copied from was dropped. Make it two sentences, e.g. "Container logs contain significant whitespace, which gets collapsed by normal HTML rendering. white-space: pre-wrap preserves that whitespace while still allowing long lines to wrap."

Generated by Claude Code

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