Add TEXTJOIN function - #1625
Closed
marcin-kordas-hoc wants to merge 5 commits into
Closed
marcin-kordas-hoc wants to merge 5 commits into
marcin-kordas-hoc wants to merge 5 commits into
Conversation
* Fix package-lock file * Docs: remove CodeSandbox embedded demos and add links to working exa,ples in Stackblitz (handsontable#1621)
- Remove dead code: redundant CellError check after coerceScalarToString in flattenArgToStrings - Remove empty no-op afterEach callback from textjoin test suite
Per code review: smoke.spec.ts should stay minimal. All TEXTJOIN tests are now consolidated in textjoin.spec.ts, covering individual cell references, single-ref args, and explicit empty-string vs null cell behaviour for ignore_empty=TRUE/FALSE.
sequba
requested changes
Mar 13, 2026
| @@ -0,0 +1,309 @@ | |||
| import {HyperFormula} from '../src' | |||
Contributor
There was a problem hiding this comment.
@marcin-kordas-hoc Please, move tests to hyperformula-test repository
cursor Bot
pushed a commit
that referenced
this pull request
Mar 16, 2026
Address sequba's review feedback on PR #1625: - Remove test/textjoin.spec.ts (tests belong in hyperformula-test repo) - Remove TEXTJOIN tests from test/smoke.spec.ts (keep smoke tests basic) - Fix alphabetical ordering of TEXTJOIN in built-in-functions.md (moved from between SUBSTITUTE/T to between TEXT/TRIM) Co-authored-by: marcin-kordas-hoc <marcin-kordas-hoc@users.noreply.github.com>
This was referenced Mar 16, 2026
Collaborator
Author
|
Closing in favor of a new PR from upstream branch (handsontable/hyperformula:feature/TEXTJOIN_w_docs). Review feedback addressed: tests moved to private repo, docs ordering fixed, unsafe cast fixed. |
sequba
added a commit
that referenced
this pull request
Mar 26, 2026
## Summary Adds the `TEXTJOIN` function — joins text from multiple strings and/or ranges with a configurable delimiter. Replaces #1625 (was opened from fork, now from upstream branch directly). ### Features - Scalar and array/range delimiter support with cycling behavior - `ignore_empty` parameter to skip empty strings - Type coercion (numbers, booleans → strings) - Error propagation from both delimiter and text arguments - 32,767 character limit (Excel compatibility) - i18n translations for all 17 supported languages - Documentation in `built-in-functions.md` ### Implementation - New `textjoin` method + `flattenArgToStrings` helper in `TextPlugin` - `repeatLastArgs: 1` metadata pattern (same as SUMPRODUCT, etc.) - Defensive `CellError` check on `coerceScalarToString` return value ### Changed files | File | Change | |------|--------| | `src/interpreter/plugin/TextPlugin.ts` | `textjoin()` + `flattenArgToStrings()` | | `src/error-message.ts` | `TextJoinResultTooLong` message | | `src/i18n/languages/*.ts` (17 files) | TEXTJOIN translations | | `docs/guide/built-in-functions.md` | TEXTJOIN row (alphabetically between TEXT and TRIM) | ### Review feedback addressed (from #1625) - Tests moved to private `hyperformula-tests` repo (companion PR pending) - Fixed docs alphabetical ordering - Fixed unsafe `as string` cast in `flattenArgToStrings` ## Test plan - [x] 35 tests in `hyperformula-tests/unit/interpreter/function-textjoin.spec.ts` - [x] Full suite: 480 suites / 5396 tests passed <!-- CURSOR_SUMMARY --> --- > [!NOTE] > **Medium Risk** > Adds a new interpreter function (`TEXTJOIN`) with range flattening and type coercion, which touches formula evaluation paths and may introduce edge-case regressions around error propagation and large-string handling. > > **Overview** > Adds the new `TEXTJOIN` spreadsheet function, including interpreter support for joining scalars and ranges with a delimiter (including delimiter cycling), optional skipping of empty strings, and consistent error propagation. > > Introduces a new `ErrorMessage.ResultTooLong` and enforces Excel’s 32,767-character output limit (returning `#VALUE!` when exceeded). > > Updates function documentation, the unreleased changelog, and adds `TEXTJOIN` translations across all supported language packs. > > <sup>Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit 81426d7. This will update automatically on new commits. Configure [here](https://cursor.com/dashboard?tab=bugbot).</sup> <!-- /CURSOR_SUMMARY --> --------- Co-authored-by: Kuba Sekowski <jakub.sekowski@handsontable.com> Co-authored-by: Claude <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
TEXTJOIN(delimiter, ignore_empty, text1, [text2, …])inTextPluginignore_emptyisTRUE; includes them whenFALSE#VALUE!when the result exceeds 32,767 characters (Excel cell limit)ErrorMessage.TextJoinResultTooLongfor the length-exceeded errordocs/guide/built-in-functions.mdTest plan
test/textjoin.spec.tscovering basic usage,ignore_emptybehaviour, array/range delimiters with cycling, type coercion, error propagation, and edge casestest/smoke.spec.tsinclude TEXTJOIN scenariosnpm run test:jest)npm run compile)npm run lint)Note
Medium Risk
Adds a new core formula function in the interpreter (
TEXTJOIN) with range handling, delimiter cycling, and a new #VALUE! error path, which could affect calculation behavior in edge cases. Changes are additive and well-covered by new unit/smoke tests.Overview
Adds support for the
TEXTJOIN(delimiter, ignore_empty, text1, [text2, …])formula, including scalar or range/array delimiters (cycled between joined parts), optional skipping of empty strings, and propagation of cell errors from delimiter/text inputs.Introduces a new
ErrorMessage.TextJoinResultTooLongand returns#VALUE!when the joined result exceeds 32,767 characters. Updates built-in function documentation, addsTEXTJOINtranslations across supported languages, and adds dedicatedTEXTJOINunit tests plus smoke coverage.Written by Cursor Bugbot for commit cfa61b5. This will update automatically on new commits. Configure here.