Skip to content

fix: ensure the entire $id cell is hidden if user hides#2691

Merged
stnguyen90 merged 1 commit intomainfrom
fix-blank-hidden-id-cells
Dec 9, 2025
Merged

fix: ensure the entire $id cell is hidden if user hides#2691
stnguyen90 merged 1 commit intomainfrom
fix-blank-hidden-id-cells

Conversation

@stnguyen90
Copy link
Copy Markdown
Contributor

@stnguyen90 stnguyen90 commented Dec 9, 2025

What does this PR do?

Since the logic is inside the Spreadsheet.Cell, there's still a element so we need to make sure that is hidden too.

Fixes #2687

Test Plan

Manual test:

image

Related PRs and Issues

Have you read the Contributing Guidelines on issues?

Yes

Summary by CodeRabbit

  • New Features
    • Columns in the database table spreadsheet view can now be hidden based on their configuration.

✏️ Tip: You can customize this high-level summary in your review settings.

Since the logic is inside the Spreadsheet.Cell, there's still a <button> element so we need to make sure that is hidden too.
@appwrite
Copy link
Copy Markdown

appwrite Bot commented Dec 9, 2025

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

Deploy functions via zip upload or connect directly to your Git repo

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Dec 9, 2025

Walkthrough

A Svelte component for database table spreadsheet rendering has been updated to support column visibility. The destructuring of table column objects now includes a new hide property alongside existing id and isEditable properties. The conditional logic for rendering the '$id' column has been extended to additionally check that the hide property is false, preventing the column's expand button and related UI from displaying when the hide flag is enabled.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

  • Single file modification with minimal scope
  • Addition of a straightforward property to destructuring pattern
  • Single conditional logic extension that follows an existing pattern
  • No complex state management or logic density introduced

Pre-merge checks and finishing touches

✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'fix: ensure the entire $id cell is hidden if user hides' directly describes the main code change—adding logic to hide the $id cell when the column is hidden.
Linked Issues check ✅ Passed The changes add a hide property check to prevent blank cells when the $id column is hidden, directly addressing issue #2687's requirement that the table renders correctly without the $id column.
Out of Scope Changes check ✅ Passed All changes are scoped to the spreadsheet component's column rendering logic to fix the reported issue; no unrelated modifications are present.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fix-blank-hidden-id-cells

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between a499ae5 and 1e1f024.

📒 Files selected for processing (1)
  • src/routes/(console)/project-[region]-[project]/databases/database-[database]/table-[table]/spreadsheet.svelte (1 hunks)
🧰 Additional context used
📓 Path-based instructions (5)
**/*.{ts,tsx,js,jsx,svelte}

📄 CodeRabbit inference engine (AGENTS.md)

**/*.{ts,tsx,js,jsx,svelte}: Import reusable modules from the src/lib directory using the $lib alias
Use minimal comments in code; reserve comments for TODOs or complex logic explanations
Use $lib, $routes, and $themes aliases instead of relative paths for module imports

Files:

  • src/routes/(console)/project-[region]-[project]/databases/database-[database]/table-[table]/spreadsheet.svelte
src/routes/**/*.svelte

📄 CodeRabbit inference engine (AGENTS.md)

Use SvelteKit file conventions: +page.svelte for components, +page.ts for data loaders, +layout.svelte for wrappers, +error.svelte for error handling, and dynamic route params in square brackets like [param]

Files:

  • src/routes/(console)/project-[region]-[project]/databases/database-[database]/table-[table]/spreadsheet.svelte
**/*.{ts,tsx,js,jsx,svelte,json}

📄 CodeRabbit inference engine (AGENTS.md)

Use 4 spaces for indentation, single quotes, 100 character line width, and no trailing commas per Prettier configuration

Files:

  • src/routes/(console)/project-[region]-[project]/databases/database-[database]/table-[table]/spreadsheet.svelte
**/*.svelte

📄 CodeRabbit inference engine (AGENTS.md)

Use Svelte 5 + SvelteKit 2 syntax with TypeScript for component development

Files:

  • src/routes/(console)/project-[region]-[project]/databases/database-[database]/table-[table]/spreadsheet.svelte
src/routes/**

📄 CodeRabbit inference engine (AGENTS.md)

Configure dynamic routes using SvelteKit convention with [param] syntax in route directory names

Files:

  • src/routes/(console)/project-[region]-[project]/databases/database-[database]/table-[table]/spreadsheet.svelte
🧠 Learnings (2)
📓 Common learnings
Learnt from: ItzNotABug
Repo: appwrite/console PR: 2373
File: src/routes/(console)/project-[region]-[project]/databases/database-[database]/(suggestions)/empty.svelte:536-552
Timestamp: 2025-09-25T04:21:57.071Z
Learning: In the Appwrite console database suggestions flow, after successfully creating columns via `createColumns()`, the `await invalidate(Dependencies.TABLE)` call causes the view to be destroyed and another view (populated table view) to be rendered, automatically cleaning up component state without needing manual reset.
Learnt from: ItzNotABug
Repo: appwrite/console PR: 2290
File: src/routes/(console)/project-[region]-[project]/databases/database-[database]/table-[table]/spreadsheet.svelte:952-961
Timestamp: 2025-09-04T03:59:03.485Z
Learning: In the Appwrite console spreadsheet component, for relationship columns, the columnId corresponds to the tableId of the related table. When calling openSideSheetForRelationsToMany(tableId, rows), the columnId can be passed directly as the tableId parameter for relationship columns.
📚 Learning: 2025-09-30T07:41:06.679Z
Learnt from: ItzNotABug
Repo: appwrite/console PR: 2425
File: src/routes/(console)/project-[region]-[project]/databases/database-[database]/(suggestions)/empty.svelte:454-468
Timestamp: 2025-09-30T07:41:06.679Z
Learning: In `src/routes/(console)/project-[region]-[project]/databases/database-[database]/(suggestions)/empty.svelte`, the column suggestions API (console.suggestColumns) has a maximum limit of 7 columns returned, which aligns with the initial placeholder count of 7 in customColumns.

Applied to files:

  • src/routes/(console)/project-[region]-[project]/databases/database-[database]/table-[table]/spreadsheet.svelte
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
  • GitHub Check: build
  • GitHub Check: e2e
🔇 Additional comments (1)
src/routes/(console)/project-[region]-[project]/databases/database-[database]/table-[table]/spreadsheet.svelte (1)

904-906: LGTM! The fix correctly addresses the blank cell issue.

The addition of the hide property to the destructuring and the && !hide condition ensures that when users hide the $id column, the entire button wrapper (including the expand icon) is properly skipped. This prevents blank cells from appearing and allows the standard Spreadsheet.Cell rendering to handle column visibility correctly.


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.

@stnguyen90 stnguyen90 requested a review from ItzNotABug December 9, 2025 00:58
@stnguyen90 stnguyen90 self-assigned this Dec 9, 2025
@stnguyen90 stnguyen90 merged commit c278a79 into main Dec 9, 2025
4 checks passed
@stnguyen90 stnguyen90 deleted the fix-blank-hidden-id-cells branch December 9, 2025 21:43
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.

Empty cells when hiding $id column

2 participants