Skip to content

fix(frontend): align log region column and disable selection on metadata#5105

Merged
jog1t merged 1 commit into
mainfrom
05-26-fix_frontend_align_log_region_column_and_disable_selection_on_metadata
May 26, 2026
Merged

fix(frontend): align log region column and disable selection on metadata#5105
jog1t merged 1 commit into
mainfrom
05-26-fix_frontend_align_log_region_column_and_disable_selection_on_metadata

Conversation

@jog1t
Copy link
Copy Markdown
Contributor

@jog1t jog1t commented May 26, 2026

Description

Please include a summary of the changes and the related issue. Please also include relevant motivation and context.

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

How Has This Been Tested?

Please describe the tests that you ran to verify your changes.

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes

Copy link
Copy Markdown
Contributor Author

jog1t commented May 26, 2026

Merge activity

  • May 26, 10:23 PM UTC: A user started a stack merge that includes this pull request via Graphite.
  • May 26, 10:31 PM UTC: Graphite rebased this pull request as part of a merge.
  • May 26, 10:31 PM UTC: @jog1t merged this pull request with Graphite.

@claude
Copy link
Copy Markdown
Contributor

claude Bot commented May 26, 2026

PR #5105 Review: fix(frontend): align log region column and disable selection on metadata

Status: MERGED | +35 / -6 | 2 files changed


Overview

This PR fixes two UX issues in the deployment logs view:

  1. Column alignment — the region label column width is now sized to the longest datacenter name, so log messages always start at the same horizontal position
  2. Selection disabled — timestamps and region labels now have select-none so copying log content doesn't inadvertently grab metadata

Code Quality

Positive aspects:

  • The +2 offset for brackets is explained inline with a comment — good.
  • Using style for the dynamic gridTemplateColumns value is correct; Tailwind can't handle runtime-computed values.
  • The empty <span /> placeholder when region is absent is a necessary correctness fix. Previously, returning null would collapse the grid to 2 columns, pushing the message into the region slot for region-less entries.
  • The regionColumnWidth is only passed to data rows, not sentinel/loading rows — those return early before using it, so no issue there.

Concerns

1. Possible undefined crash on datacenters.reduce

// logs.tsx
const regionLabelLength = datacenters.reduce(
    (max, dc) => Math.max(max, dc.name.length),
    0,
);

If datacenters is undefined while the query is loading, this will throw. The diff doesn't show whether datacenters is guarded upstream. A defensive guard would be:

const regionLabelLength = (datacenters ?? []).reduce(
    (max, dc) => Math.max(max, dc.name.length),
    0,
);

2. Minor: comment typo

// Width all region labels to the longest datacenter name so messages line up.

Should be "Widen" not "Width".

3. Minor: "16ch" magic string duplicated

The fallback "16ch" appears in both deployment-logs.tsx (the width computation) and as the fallback in LogRowData. Not worth a constant for such a small change, but worth noting for future refactors.


Summary

The core logic is correct and the fix is minimal and focused. The main risk is the potential undefined crash on datacenters if the query hasn't resolved yet — worth verifying that the parent ensures a defined array before this line runs. The comment typo and duplicated default are cosmetic. Overall a clean, low-risk fix.

@jog1t jog1t changed the base branch from 05-26-fix_frontend_clickable_namespaces_in_deployments_table to graphite-base/5105 May 26, 2026 22:28
@jog1t jog1t changed the base branch from graphite-base/5105 to main May 26, 2026 22:29
@jog1t jog1t force-pushed the 05-26-fix_frontend_align_log_region_column_and_disable_selection_on_metadata branch from 38ae0e4 to b1f1d5c Compare May 26, 2026 22:30
@jog1t jog1t merged commit 1f91914 into main May 26, 2026
8 of 11 checks passed
@jog1t jog1t deleted the 05-26-fix_frontend_align_log_region_column_and_disable_selection_on_metadata branch May 26, 2026 22:31
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