Skip to content

improvement(workspace): allocate more space to name column in resource tables#4645

Open
waleedlatif1 wants to merge 1 commit into
stagingfrom
waleedlatif1/file-name-truncation
Open

improvement(workspace): allocate more space to name column in resource tables#4645
waleedlatif1 wants to merge 1 commit into
stagingfrom
waleedlatif1/file-name-truncation

Conversation

@waleedlatif1
Copy link
Copy Markdown
Collaborator

Summary

  • Switched narrow metadata columns (Size, Type, Created, Owner, Last Updated, etc.) to fixed pixel widths in all Resource-based tables
  • Name / primary column now flexes to absorb remaining space, so longer file/KB/table names no longer truncate on wide screens
  • Pages updated: Files, Knowledge, KB documents, KB chunks, Tables, Scheduled Tasks, Logs

Type of Change

  • Improvement

Testing

Tested manually

Checklist

  • Code follows project style guidelines
  • Self-reviewed my changes
  • Tests added/updated and passing
  • No new warnings introduced
  • I confirm that I have read and agree to the terms outlined in the Contributor License Agreement (CLA)

@vercel
Copy link
Copy Markdown

vercel Bot commented May 17, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated (UTC)
docs Skipped Skipped May 17, 2026 6:27pm

Request Review

@cursor
Copy link
Copy Markdown

cursor Bot commented May 17, 2026

PR Summary

Low Risk
Low risk UI-only change that adjusts table column sizing logic; main risk is minor layout regressions in Resource-based tables (especially with checkbox selection) on different screen widths.

Overview
Updates Resource table column sizing to support fixed pixel widths via a new ResourceColumn.widthPx, while keeping remaining columns proportionally sized.

Applies fixed widths to narrow metadata columns across workspace list pages (Files, Knowledge bases, KB documents/chunks, Tables, Scheduled Tasks, Logs) so the primary name/content column flexes and truncates less on wide screens.

Reviewed by Cursor Bugbot for commit ca5b33e. Configure here.

@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps Bot commented May 17, 2026

Greptile Summary

This PR improves column layout across all resource tables by switching metadata columns (Size, Type, Created, Owner, etc.) from proportional weights to fixed pixel widths, allowing the primary name/content column to flex and absorb all remaining table space.

  • resource.tsxResourceColGroup now tracks a reservedPx total (all fixed-px columns + checkbox) and distributes only the remaining width among flexible columns via calc(percent% - offset px). The math is correct and handles mixed fixed/flex configurations cleanly.
  • Seven consumer files (Files, Knowledge, KB Documents, KB Chunks, Tables, Scheduled Tasks, Logs) — metadata columns gain widthPx values sized to their content; each table's first/primary column is left without widthPx so it fills available space.

Confidence Score: 5/5

Safe to merge — changes are purely presentational, scoped to column width declarations, and the core layout arithmetic in ResourceColGroup is mathematically sound.

The width-distribution logic correctly subtracts all fixed-px columns and the checkbox from the total table width before dividing the remainder among flexible columns. No data, state, or API paths are touched. Every changed file only updates static COLUMNS constants.

No files require special attention.

Important Files Changed

Filename Overview
apps/sim/app/workspace/[workspaceId]/components/resource/resource.tsx Core layout logic updated: ResourceColGroup now distributes flexible-column widths correctly after subtracting all fixed-px columns and the checkbox from the total table width.
apps/sim/app/workspace/[workspaceId]/files/files.tsx Size/Type/Created/Owner/Last Updated columns switched to fixed pixel widths; Name column becomes the sole flex column.
apps/sim/app/workspace/[workspaceId]/knowledge/knowledge.tsx Documents/Tokens/Connectors/Created/Owner/Last Updated columns converted to fixed widths; Name column flexes.
apps/sim/app/workspace/[workspaceId]/knowledge/[id]/base.tsx KB document columns (Size, Tokens, Chunks, Uploaded, Status, Tags) converted to fixed widths; Name flexes.
apps/sim/app/workspace/[workspaceId]/knowledge/[id]/[documentId]/document.tsx Chunk columns (Index, Tokens, Status) converted to fixed widths; Content column flexes.
apps/sim/app/workspace/[workspaceId]/logs/logs.tsx Date/Status/Cost/Trigger/Duration columns converted to fixed widths; Workflow column flexes.
apps/sim/app/workspace/[workspaceId]/scheduled-tasks/scheduled-tasks.tsx Next Run and Last Run columns converted to fixed 160px widths; Task and Schedule remain flexible.
apps/sim/app/workspace/[workspaceId]/tables/tables.tsx Columns/Rows/Created/Owner/Last Updated converted to fixed widths; Name column flexes.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A[ResourceColGroup receives columns + hasCheckbox] --> B{col.widthPx set?}
    B -- Yes --> C[Render col with fixed width px]
    B -- No --> D[Assign flexible weight\ncolIdx==0 → 2.5x, else 1.0x × widthMultiplier]
    D --> E[Compute flexibleTotal\nsum of all flexible weights]
    E --> F[reservedPx = fixedPxTotal + checkboxPx]
    F --> G[columnRatio = weight / flexibleTotal]
    G --> H{reservedOffset > 0?}
    H -- Yes --> I[calc percent% minus reservedOffset px]
    H -- No --> J[columnPercent%]
Loading

Reviews (1): Last reviewed commit: "improvement(workspace): allocate more sp..." | Re-trigger Greptile

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