Skip to content

Fix table page not loading when column name is 'actions'#2979

Open
swetalin-10 wants to merge 4 commits intoappwrite:mainfrom
swetalin-10:fix-actions-column-conflict
Open

Fix table page not loading when column name is 'actions'#2979
swetalin-10 wants to merge 4 commits intoappwrite:mainfrom
swetalin-10:fix-actions-column-conflict

Conversation

@swetalin-10
Copy link
Copy Markdown

Fixes #2977

Handled conflict when a user creates a column named "actions" by mapping it to a safe internal key to avoid collision with the system-defined "actions" column.

This prevents the table page from getting stuck on loading and ensures it renders correctly.

@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps bot commented Apr 14, 2026

Greptile Summary

The core fix avoids a naming collision between a user-defined 'actions' column and the Table component's internal actions slot by remapping the column prop on cells to '__actions'. However, the columns array forwarded to Table.Root still carries { id: 'actions' }, so the component's column-definition registry and the renamed cells diverge — configured widths are silently ignored and Table.Root may still encounter duplicate registration for the 'actions' key. The PR also inadvertently bundles two unrelated mainOAuth.svelte changes (a GitHub label rename and an unnecessary import type removal).

Confidence Score: 3/5

The fix resolves the loading hang but is incomplete — the columns array mismatch will cause rendering issues for any user-named 'actions' column.

A P1 correctness issue remains: the columns array passed to Table.Root still contains { id: 'actions' } while cells advertise column="__actions", causing lost column-width configuration and a likely duplicate-registration conflict within the Table component. The unrelated mainOAuth.svelte changes add minor review surface but are not blocking on their own.

table.svelte — the columns prop needs the same 'actions''__actions' remapping applied to the cell snippets.

Important Files Changed

Filename Overview
src/routes/(console)/project-[region]-[project]/databases/database-[database]/table.svelte Adds safeId remapping of 'actions''__actions' in Table.Header.Cell and Table.Cell to prevent conflict with the system-defined actions column, but does not remap the id field in the columns array passed to Table.Root, leaving a column-definition/cell mismatch that causes wrong widths and possible duplicate registration.
src/routes/(console)/project-[region]-[project]/auth/(providers)/mainOAuth.svelte Contains two unrelated changes: removal of type from the Provider import (unnecessary — it's type-only) and a GitHub-specific label rename ("App ID" → "Client ID") that should be in a separate PR.

Comments Outside Diff (1)

  1. src/routes/(console)/project-[region]-[project]/databases/database-[database]/table.svelte, line 56 (link)

    P1 columns array not transformed alongside cell column props

    The columns prop passed to MultiSelectionTable (and forwarded to Table.Root) still contains { id: 'actions', ... } from $tableViewColumns, while the header and cell components now reference that same column as column="__actions". Because Table.Root from @appwrite.io/pink-svelte uses the id field of each entry in columns to register sizing/layout context that cells look up by their column prop, the renamed cells will find no matching definition ('__actions''actions'), so configured widths are silently dropped and the column renders with defaults. Additionally, Table.Root may still register a duplicate internal 'actions' slot when it sees { id: 'actions' } in the user-supplied array.

    The fix should also map the column definition itself:

    <MultiSelectionTable
        resource={entitySingular}
        columns={$tableViewColumns.map((col) => ({ ...col, id: col.id === 'actions' ? '__actions' : col.id }))}
        allowSelection={$canWriteTables}
        {onDelete}>
    

Reviews (2): Last reviewed commit: "Update src/routes/(console)/project-[reg..." | Re-trigger Greptile

…base-[database]/table.svelte

Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
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.

Table page not loading if a column name is "actions"

1 participant