Skip to content

fix: col width for index cols#2918

Merged
HarshMN2345 merged 2 commits intomainfrom
fix-col-width-for-index-col
Mar 16, 2026
Merged

fix: col width for index cols#2918
HarshMN2345 merged 2 commits intomainfrom
fix-col-width-for-index-col

Conversation

@HarshMN2345
Copy link
Member

@HarshMN2345 HarshMN2345 commented Mar 16, 2026

What does this PR do?

BEFORE

image

AFTER

image

Test Plan

(Write your test plan here. If you changed any code, please provide us with clear instructions on how you verified your changes work.)

Related PRs and Issues

(If this PR is related to any other PR or resolves any issue or related to any issue link all related PR and issues here.)

Have you read the Contributing Guidelines on issues?

(Write your answer here.)

Summary by CodeRabbit

  • Style
    • Increased the width of the Key column in the database spreadsheet view for improved visibility on larger screens.

@appwrite
Copy link

appwrite bot commented Mar 16, 2026

Console (appwrite/console)

Project ID: 688b7bf400350cbd60e9

Sites (1)
Site Status Logs Preview QR
 console-stage
688b7cf6003b1842c9dc
Ready Ready View Logs Preview URL QR Code

Tip

Schedule functions to run as often as every minute with cron expressions

@HarshMN2345 HarshMN2345 requested a review from hmacr March 16, 2026 13:50
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Mar 16, 2026

Walkthrough

A single UI adjustment to a database management interface. The "Key" column width properties in a spreadsheet header are increased from 200 to 280 pixels for non-small viewports. Both the width and minimumWidth values are modified identically. No logic, control flow, or functional behavior is altered.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~2 minutes

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'fix: col width for index cols' directly and specifically describes the main change: adjusting column width for index columns in the Indexes view.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fix-col-width-for-index-col
📝 Coding Plan
  • Generate coding plan for human review comments

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Tip

You can customize the high-level summary generated by CodeRabbit.

Configure the reviews.high_level_summary_instructions setting to provide custom instructions for generating the high-level summary.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In
`@src/routes/`(console)/project-[region]-[project]/databases/database-[database]/(entity)/views/indexes/view.svelte:
- Around line 77-78: The saved column width from getColumnWidth('key',
$isSmallViewport ? 250 : 280) can be smaller than the new desktop minimum, so
enforce the minimum when applying persisted widths by taking the max between the
persisted value and the intended minimum; update the assignment that sets
minimumWidth and the width calculation for the 'key' column (referring to
getColumnWidth, minimumWidth and $isSmallViewport) so the effective width is
Math.max(persistedWidth, $isSmallViewport ? 250 : 280) (and set minimumWidth to
$isSmallViewport ? 250 : 280) to ensure returning users get at least the new
desktop minimum.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 3b49566a-1875-493a-acbc-486b006d6d99

📥 Commits

Reviewing files that changed from the base of the PR and between adf369e and a635c99.

📒 Files selected for processing (1)
  • src/routes/(console)/project-[region]-[project]/databases/database-[database]/(entity)/views/indexes/view.svelte

Comment on lines +77 to +78
width: getColumnWidth('key', $isSmallViewport ? 250 : 280),
minimumWidth: $isSmallViewport ? 250 : 280,
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

Persisted widths can bypass the new desktop minimum

On Line 77, getColumnWidth can return an older saved width (e.g., 200), so the widened default at Line 78 (280) won’t apply for returning users. That means the PR fix may not take effect when a prior preference exists.

Proposed fix
 function getColumnWidth(columnId: string, defaultWidth: number): number {
     const savedWidth = columnsWidth?.[columnId];
     if (!savedWidth) return defaultWidth;
 
-    return savedWidth.resized;
+    return Math.max(savedWidth.resized, defaultWidth);
 }
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In
`@src/routes/`(console)/project-[region]-[project]/databases/database-[database]/(entity)/views/indexes/view.svelte
around lines 77 - 78, The saved column width from getColumnWidth('key',
$isSmallViewport ? 250 : 280) can be smaller than the new desktop minimum, so
enforce the minimum when applying persisted widths by taking the max between the
persisted value and the intended minimum; update the assignment that sets
minimumWidth and the width calculation for the 'key' column (referring to
getColumnWidth, minimumWidth and $isSmallViewport) so the effective width is
Math.max(persistedWidth, $isSmallViewport ? 250 : 280) (and set minimumWidth to
$isSmallViewport ? 250 : 280) to ensure returning users get at least the new
desktop minimum.

@HarshMN2345 HarshMN2345 merged commit f6b5c27 into main Mar 16, 2026
4 checks passed
@HarshMN2345 HarshMN2345 deleted the fix-col-width-for-index-col branch March 16, 2026 13:59
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.

2 participants