Skip to content

fix: logs Message column collapsing on narrow viewports + cross-platform dev:mock#134

Draft
Hazer wants to merge 3 commits into
LizardByte:feat/initial-conceptfrom
Hazer:fix/logs-message-column-width
Draft

fix: logs Message column collapsing on narrow viewports + cross-platform dev:mock#134
Hazer wants to merge 3 commits into
LizardByte:feat/initial-conceptfrom
Hazer:fix/logs-message-column-width

Conversation

@Hazer

@Hazer Hazer commented Jun 19, 2026

Copy link
Copy Markdown

Description

Two small, self-contained client-web fixes:

  1. Logs table: Message column no longer crushes to ~7 chars wide. On small windows the auto-layout table squeezed the wrapped <pre> in the Message column down to a few characters, making the log viewer effectively unreadable on narrow viewports. Since the table is already horizontally scrollable, the column now keeps a guaranteed ~70-character minimum width.
  2. npm run dev:mock now works on macOS/Linux. The script used cmd.exe-only set VITE_USE_MOCK_API=true&& syntax and failed on Unix shells. It now uses Vite's first-class --mode mock flag (auto-loads a new .env.mock), which is OS-agnostic and requires no new dependencies.

Details

Logs Message column (crates/client-web/src/app/dashboardView.ts + crates/client-web/src/style.css):

  • Tagged the Message <th> and its <td> cells with class="log-message-col".

  • Added a CSS rule pinning the column to a character-based minimum:

    .log-entries-table .log-message-col {
      min-width: 70ch;
      width: 70ch;
    }
  • ch units track the 0 glyph width, so the column reliably holds ~70 characters regardless of viewport size. Because the table lives inside a horizontally scrollable .table-shell, this never clips content — it only stops the column from being crushed.

Cross-platform dev:mock (crates/client-web/package.json + new crates/client-web/.env.mock):

  • dev:mock now runs vite --mode mock, which makes Vite auto-load the new .env.mock file (VITE_USE_MOCK_API=true). The import.meta.env reading in api.ts is unchanged.
  • The previous Windows-specific command is preserved as dev:mock:win so nobody is broken.

Verification

  • npm run check (tsc --noEmit) — ✅ passes
  • npm run build (vite build) — ✅ passes
  • npm run dev:mock — ✅ confirmed serving with "VITE_USE_MOCK_API": "true" inlined into import.meta.env, mock mode active, served at http://127.0.0.1:4173/

Testing instructions (mock API)

cd crates/client-web
npm run dev:mock   # now works on macOS/Linux/Windows

Log in with the seeded mock admin (defined in src/mockApi.ts, browser-only — never touches the server):

username: admin
password: adminpass

Then navigate to Settings → Logs and resize the window narrow to confirm the Message column stays readable (~70 chars) and the table scrolls horizontally.

Notes

  • No backend, API, or DB changes.
  • No new runtime dependencies (lucide remains the only one).
  • Targets feat/initial-concept.

Screenshot

Issues Fixed or Closed

Roadmap Issues

Type of Change

  • feat: New feature (non-breaking change which adds functionality)
  • fix: Bug fix (non-breaking change which fixes an issue)
  • docs: Documentation only changes
  • style: Changes that do not affect the meaning of the code (white-space, formatting, missing semicolons, etc.)
  • refactor: Code change that neither fixes a bug nor adds a feature
  • perf: Code change that improves performance
  • test: Adding missing tests or correcting existing tests
  • build: Changes that affect the build system or external dependencies
  • ci: Changes to CI configuration files and scripts
  • chore: Other changes that don't modify src or test files
  • revert: Reverts a previous commit
  • BREAKING CHANGE: Introduces a breaking change (can be combined with any type above)

Checklist

  • Code follows the style guidelines of this project
  • Code has been self-reviewed
  • Code has been commented, particularly in hard-to-understand areas
  • Code docstring/documentation-blocks for new or existing methods/components have been added or updated
  • Unit tests have been added or updated for any new or modified functionality

AI Usage

  • None: No AI tools were used in creating this PR
  • Light: AI provided minor assistance (formatting, simple suggestions)
  • Moderate: AI helped with code generation or debugging specific parts
  • Heavy: AI generated most or all of the code changes

Hazer added 3 commits June 19, 2026 02:51
The log-entries table used table auto-layout with no per-column sizing, so the
Message column's wrapped <pre> could be crushed down to a few characters wide
on small screens. Tag the Message header/cells with .log-message-col and give
them a 70ch min/width. Since the table lives in a horizontally scrollable
.table-shell, this never clips content; it just guarantees a readable minimum.
The dev:mock script used `set VAR=true&&`, cmd.exe syntax that breaks on
macOS/Linux (shells that don't understand `set X=Y`). Switch to Vite's
first-class --mode flag: `vite --mode mock` auto-loads the new .env.mock,
which sets VITE_USE_MOCK_API=true. This is OS-agnostic and requires no new
dependencies. The old Windows behavior is preserved as dev:mock:win for
anyone who needs it.
@sonarqubecloud

Copy link
Copy Markdown

@Hazer Hazer changed the title Fix logs Message column collapsing on narrow viewports + cross-platform dev:mock fix: logs Message column collapsing on narrow viewports + cross-platform dev:mock Jun 19, 2026
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.

1 participant