endimonan opened a new pull request, #44236:
URL: https://github.com/apache/superset/pull/44236

   ### SUMMARY
   
   Fixes #36407.
   
   SQL Lab loads the legacy `brace` SQL mode, which has no folding rules. Use 
the SQL mode from the existing `ace-builds` dependency so users can collapse 
and expand multiline parenthesized queries and block comments. Regression tests 
cover both shared SQL editors, preserve the query through folding/unfolding, 
and verify SQL keyword highlighting.
   
   ### BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
   
   **Before:** Multiline CTEs and block comments have no folding controls.
   
   **After:** Both blocks can be folded and unfolded without changing the SQL.
   
   Screenshots and manual visual verification are pending.
   
   ### TESTING INSTRUCTIONS
   
   1. Open SQL Lab with the built-in Ace editor and paste:
   
      ```sql
      WITH nested_query AS (
        SELECT 1 AS value
      )
      SELECT * FROM nested_query;
      /* multi-line
         comment */
      ```
   
   2. Use the gutter arrows to collapse and expand the CTE and the block 
comment. Verify that the SQL is preserved.
   3. Check SQL highlighting and autocomplete, then run the query and confirm 
that it returns `1`.
   
   Automated validation:
   
   - `AsyncAceEditor.test.tsx`: 26 tests passed. The two folding cases fail 
with the original SQL loader.
   - `pre-commit run` on the four changed files: passed, including formatting, 
lint, custom rules, styles, and TypeScript checks.
   
   Focused test command, from `superset-frontend` with `NODE_ENV=test` and 
`CI=true`:
   
   ```sh
   node --max-old-space-size=8192 node_modules/jest/bin/jest.js 
packages/superset-ui-core/src/components/AsyncAceEditor/AsyncAceEditor.test.tsx 
--runInBand --silent
   ```
   
   ### ADDITIONAL INFORMATION
   
   - [x] Has associated issue: #36407
   - [ ] Required feature flags:
   - [x] Changes UI
   - [ ] Includes DB Migration (follow approval process in 
[SIP-59](https://github.com/apache/superset/issues/13351))
     - [ ] Migration is atomic, supports rollback & is backwards-compatible
     - [ ] Confirm DB migration upgrade and downgrade tested
     - [ ] Runtime estimates and downtime expectations provided
   - [ ] Introduces new feature or API
   - [ ] Removes existing feature or API
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to