Skip to content

feat: support SQL object previews - #313

Merged
cxymds merged 1 commit into
mainfrom
cxymds/move-operations-menu
Nov 23, 2026
Merged

cxymds merged 1 commit into
mainfrom
cxymds/move-operations-menu

Conversation

@cxymds

@cxymds cxymds commented Nov 23, 2026 •

Copy link
Copy Markdown
Member

Description

Adds bounded SQL object previews to the Console browser. SQL objects identified by application/sql, text/x-sql, or a .sql extension now use the existing safe text renderer instead of the sandbox fallback. UTF-8 SQL uploads also retain the charset metadata used by the preview path.

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 change)
  • Documentation update
  • Code refactoring
  • Performance improvement
  • Test improvements
  • Security fix

Testing

  • Unit tests added/updated
  • Manual testing completed

Validated in a clean worktree from origin/main with:

  • pnpm test:run — 1243 passed
  • pnpm type-check
  • pnpm lint
  • pnpm format:check
  • git diff --check

Checklist

  • Code follows the project's style guidelines
  • Self-review completed
  • TypeScript types are properly defined
  • All commit messages are in English (Conventional Commits)
  • All existing tests pass
  • No new dependencies added, or they are justified

Related Issues

Closes #306

Screenshots (if applicable)

No layout changes. The existing object preview dialog and safe text renderer are reused.

Additional Notes

The existing 2 MiB text preview limit and bounded UTF-8 validation remain unchanged.

Copilot AI balanced review requested due to automatic review settings November 23, 2026 02:43
Treat SQL objects as bounded safe text and preserve UTF-8 metadata on upload. Add regression coverage for MIME and extension-based preview paths.
@cxymds
cxymds force-pushed the cxymds/move-operations-menu branch from 1170956 to 2d2a1f2 Compare November 23, 2026 02:46

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🔵 Needs a closer look

The navigation and route-order changes introduce undocumented scope by altering the sidebar layout and permission-aware landing-page selection, so they need to be removed or explicitly documented and justified.

No open issues 🎉

What changed in this PR

Adds SQL objects to the Console browser’s existing bounded, safe text-preview path, addressing #306.

Changes:

  • Recognizes application/sql, text/x-sql, and .sql files for text previews.
  • Preserves UTF-8 charset metadata for SQL uploads and adds regression tests.
  • Moves Event Destinations and Tiered Storage to Operations, updating landing-route order and navigation tests.
File Description
tests/​lib/​upload-content-type.test.js Adds SQL upload charset coverage.
tests/​lib/​sidebar-navigation.test.ts Updates Operations grouping and landing-route expectations.
tests/​lib/​object-preview.test.ts Adds SQL MIME and extension preview coverage.
lib/​upload-content-type.ts Classifies SQL as textual for charset detection.
lib/​upload-content-type.js Mirrors SQL charset handling in JavaScript.
lib/​object-preview.ts Adds SQL MIME types and extension to safe-text recognition.
lib/​dashboard-route-meta.ts Aligns landing-route priority with the new navigation order.
config/​navs.ts Moves Event Destinations and Tiered Storage into Operations.

Review effort: Balanced

@cxymds
cxymds merged commit ae70fe6 into main Nov 23, 2026
10 checks passed
@cxymds
cxymds deleted the cxymds/move-operations-menu branch November 23, 2026 02:49
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.

[Feature] preview sql file can support

2 participants