Title: fix(tables): sniff CSV delimiter and capture the real header row on import by waleedlatif1 · Pull Request #5888 · simstudioai/sim · GitHub
Open Graph Title: fix(tables): sniff CSV delimiter and capture the real header row on import by waleedlatif1 · Pull Request #5888 · simstudioai/sim
X Title: fix(tables): sniff CSV delimiter and capture the real header row on import by waleedlatif1 · Pull Request #5888 · simstudioai/sim
Description: Summary CSV table import derived the delimiter from the file extension only, so semicolon-delimited exports (European-locale Excel) parsed as a single column — the reported "alarms-export" bug. Now the delimiter is sniffed from the file head (, ; \t |), quote-aware, with the extension only as a fallback. Header derivation used Object.keys(rows[0]); with relax_column_count a ragged/sparse first data row dropped its trailing columns from schema inference and mapping. The true header row is now captured via the csv-parse columns callback on every path — fixes the "sparse csv didn't work" report. New detectCsvDelimiter (trial-parse each candidate, pick most columns, tie-break on row-width consistency) mirrors PapaParse/csv.Sniffer, and sniffCsvDelimiterFromStream (64KB peek-then-replay) keeps the streaming paths memory-bounded on multi-GB files. Wired into all consumers: create route, append/replace route, background runner, client dialog preview, and parseFileRows (copilot). Type of Change Bug fix Testing 442 table + route tests pass (49 new/updated covering delimiter detection, ragged headers, stream replay, error/destroy/empty edge cases) Verified against the real 61 MB alarms-export file: comma → 1 column, semicolon → 34 columns / 1249 records; sniffer detects ; Typecheck clean, biome clean, check:api-validation passes 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)
Open Graph Description: Summary CSV table import derived the delimiter from the file extension only, so semicolon-delimited exports (European-locale Excel) parsed as a single column — the reported "alarms-export&quo...
X Description: Summary CSV table import derived the delimiter from the file extension only, so semicolon-delimited exports (European-locale Excel) parsed as a single column — the reported "alarms-export...
Opengraph URL: https://github.com/simstudioai/sim/pull/5888
X: @github
Domain: github.com
| route-pattern | /:user_id/:repository/pull/:id/files(.:format) |
| route-controller | pull_requests |
| route-action | files |
| fetch-nonce | v2:6997ff97-b66d-03ca-4cb7-31ea1bfcafc2 |
| current-catalog-service-hash | ae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b |
| request-id | B2D0:16ABB6:1954B1F:24307ED:6A635D62 |
| html-safe-nonce | be9c915056c539eabca2aef8be0ca450a844f56fb0f69d40b134d9460c6036c6 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCMkQwOjE2QUJCNjoxOTU0QjFGOjI0MzA3RUQ6NkE2MzVENjIiLCJ2aXNpdG9yX2lkIjoiMzc5MzE5MTYxMDQxNjczNTcwIiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 628c0a55908fb384601f8f7be5f0f1fc7e33b512a7782fc38c8118032807d6b8 |
| hovercard-subject-tag | pull_request:4117901548 |
| github-keyboard-shortcuts | repository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/simstudioai/sim/pull/5888/files |
| twitter:image | https://avatars.githubusercontent.com/u/40672544?s=400&v=4 |
| twitter:card | summary_large_image |
| og:image | https://avatars.githubusercontent.com/u/40672544?s=400&v=4 |
| og:image:alt | Summary CSV table import derived the delimiter from the file extension only, so semicolon-delimited exports (European-locale Excel) parsed as a single column — the reported "alarms-export&quo... |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | 59e55daad7174ca59d63c6974d58276ccb5477442e550bebb3c035e1bef11c94 |
| turbo-cache-control | no-preview |
| diff-view | unified |
| go-import | github.com/simstudioai/sim git https://github.com/simstudioai/sim.git |
| octolytics-dimension-user_id | 199344406 |
| octolytics-dimension-user_login | simstudioai |
| octolytics-dimension-repository_id | 912559512 |
| octolytics-dimension-repository_nwo | simstudioai/sim |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 912559512 |
| octolytics-dimension-repository_network_root_nwo | simstudioai/sim |
| turbo-body-classes | logged-out env-production page-responsive full-width |
| disable-turbo | true |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 71b1218de2f2ab29c4d5ce72568e68e2c56044c6 |
| ui-target | canary-1 |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width