Skip to content

Add user option to rotate table column headers - #12837

Merged
SchrodingersGat merged 6 commits into
inventree:masterfrom
wyyd-yxc:feature/12558-rotate-table-headers
Sep 12, 2026
Merged

SchrodingersGat merged 6 commits into
inventree:masterfrom
wyyd-yxc:feature/12558-rotate-table-headers

Conversation

@wyyd-yxc

Copy link
Copy Markdown
Contributor

Problem

All table headers render horizontally, so a long column title like Temperature coefficient [±ppm/°C] consumes a lot of width even when the data below it is tiny (100). For parameter-heavy tables this wastes a large part of the screen (#12558, includes before/after screenshots).

Solution

Adds a user setting (Display Options → Rotated Table Headers, key ROTATE_TABLE_HEADERS, default off) which renders table column header titles vertically:

  • ROTATE_TABLE_HEADERS added to USER_SETTINGS (common/setting/user.py), next to the existing STICKY_TABLE_HEADER
  • Listed in the Display Options panel of the user settings page
  • InvenTreeTable applies a rotate-table-headers class to the table when enabled
  • Scoped CSS in src/styles/overrides.css rotates the header title text (writing-mode: vertical-rl + 180° rotation, bottom-aligned cells) - following the implementation sketch from the issue discussion

The option is fully user-configurable and off by default, so existing tables are unchanged unless the user opts in.

Testing

  • yarn run build (full tsc typecheck + vite build) passes
  • With the setting off, tables render exactly as before (default false)
  • With the setting on, header titles render vertically and cells bottom-align, matching the mockup in the issue

Closes #12558

Wide column titles (e.g. "Temperature coefficient [±ppm/°C]") take a
lot of horizontal space for narrow data. Add a ROTATE_TABLE_HEADERS
user setting (Display Options) which renders table header titles
vertically via a scoped CSS class, following the implementation
sketch from the issue discussion.
@netlify

netlify Bot commented Sep 10, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for inventree-web-pui-preview canceled.

Name Link
🔨 Latest commit 98843cc
🔍 Latest deploy log https://app.netlify.com/projects/inventree-web-pui-preview/deploys/6aa422fa8eb0cf0008b5103d

@matmair matmair added enhancement This is an suggested enhancement or new feature User Interface Related to the frontend / User Interface labels Sep 10, 2026
@matmair matmair added this to the 1.6.0 milestone Sep 10, 2026

@matmair matmair 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.

LGTM; I think this would be worth a changelog entry

@wyyd-yxc

Copy link
Copy Markdown
Contributor Author

Two CI notes for reviewers:

  1. RTD build was failing on the earlier commits - the cause was the new ROTATE_TABLE_HEADERS setting missing from docs/docs/settings/user.md (the docs build tracks documented settings via the usersetting macro). Fixed in af62d79 by adding the entry; RTD now passes.

  2. The Tests [Firefox 1 / 2] failure on af62d79 looks like infrastructure flakiness rather than a code issue: that commit changes only a docs markdown file, and the failure log shows the Firefox process crashing mid-run (juggler NS_ERROR_FAILURE errors, "Test ended" locator errors) across unrelated specs (pui_company, pui_build, pui_purchasing). Could I ask for a rerun of the failed job?

@codecov

codecov Bot commented Sep 10, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 87.06%. Comparing base (028d1cb) to head (98843cc).
⚠️ Report is 2 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master   #12837      +/-   ##
==========================================
- Coverage   87.15%   87.06%   -0.10%     
==========================================
  Files        1487     1500      +13     
  Lines      101500   101900     +400     
  Branches    11640    11547      -93     
==========================================
+ Hits        88463    88715     +252     
- Misses      12974    13122     +148     
  Partials       63       63              
Flag Coverage Δ
backend 91.80% <ø> (+0.59%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Components Coverage Δ
Backend Apps 92.48% <ø> (-0.02%) ⬇️
Backend General 94.62% <ø> (-0.13%) ⬇️
Frontend 79.62% <ø> (-0.04%) ⬇️
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@SchrodingersGat

Copy link
Copy Markdown
Member

LGTM; I think this would be worth a changelog entry

@wyyd-yxc please add an entry into the CHANGELOG.md file - otherwise looks OK from me

@wyyd-yxc

Copy link
Copy Markdown
Contributor Author

Done — added a changelog entry for the ROTATE_TABLE_HEADERS user setting under the Unreleased → Added section (98843cc).

@SchrodingersGat
SchrodingersGat merged commit 9181097 into inventree:master Sep 12, 2026
84 of 87 checks passed
@SchrodingersGat

Copy link
Copy Markdown
Member

@wyyd-yxc thanks for the contribution

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

Labels

enhancement This is an suggested enhancement or new feature User Interface Related to the frontend / User Interface

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[FR] Option to rotate table headers 90°

3 participants