Skip to content

Conversation

@git-nandor
Copy link
Contributor

@git-nandor git-nandor commented Jan 9, 2026

INSTUI-4818

Summary

Migrated TreeBrowser component from the old theming system.

Test plan

On the documentation page, verify that everything displays and works correctly.

Co-Authored-By: 🤖 Claude

@git-nandor git-nandor self-assigned this Jan 9, 2026

function bootstrap() {
execSync(path.resolve('scripts/clean.js'), opts)

Check warning

Code scanning / CodeQL

Shell command built from environment values

This shell command depends on an uncontrolled [absolute path](1).

Copilot Autofix

AI 12 days ago

In general, to fix this class of problem you should avoid passing a single command string to child_process.execSync when any part of that string is dynamic. Instead, either (1) use execFileSync with the executable and its arguments passed as separate parameters, or (2) if you need to run a Node script, invoke process.execPath (the Node binary) with the script path as an argument, again using an argument array. This way, the shell is not involved and dynamic values are not interpreted as shell syntax.

For this file, the best fix is to change the bootstrap function so it no longer passes the resolved script path as a shell command string. A simple, behavior-preserving change is:

  • Call execFileSync instead of execSync.
  • Use process.execPath as the command (the current Node executable).
  • Pass [path.resolve('scripts/clean.js')] as the argument array.
  • Keep opts unchanged so stdio: 'inherit' behavior is preserved.

We also need to import execFileSync from child_process alongside the existing execSync and fork imports. All changes are confined to scripts/bootstrap.js:

  • At the top, extend the destructuring require to include execFileSync.
  • In bootstrap(), replace execSync(path.resolve('scripts/clean.js'), opts) with execFileSync(process.execPath, [path.resolve('scripts/clean.js')], opts).
Suggested changeset 1
scripts/bootstrap.js

Autofix patch

Autofix patch
Run the following command in your local git repository to apply this patch
cat << 'EOF' | git apply
diff --git a/scripts/bootstrap.js b/scripts/bootstrap.js
--- a/scripts/bootstrap.js
+++ b/scripts/bootstrap.js
@@ -24,7 +24,7 @@
  * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
  * SOFTWARE.
  */
-const { execSync, fork } = require('child_process')
+const { execSync, execFileSync, fork } = require('child_process')
 const path = require('path')
 
 const opts = { stdio: 'inherit' }
@@ -65,7 +65,7 @@
 }
 
 function bootstrap() {
-  execSync(path.resolve('scripts/clean.js'), opts)
+  execFileSync(process.execPath, [path.resolve('scripts/clean.js')], opts)
   buildProject()
 }
 
EOF
@@ -24,7 +24,7 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
const { execSync, fork } = require('child_process')
const { execSync, execFileSync, fork } = require('child_process')
const path = require('path')

const opts = { stdio: 'inherit' }
@@ -65,7 +65,7 @@
}

function bootstrap() {
execSync(path.resolve('scripts/clean.js'), opts)
execFileSync(process.execPath, [path.resolve('scripts/clean.js')], opts)
buildProject()
}

Copilot is powered by AI and may make mistakes. Always verify output.
@git-nandor git-nandor changed the base branch from master to v12 January 9, 2026 09:12
@git-nandor git-nandor force-pushed the INSTUI-4818_treebrowser_rework_1 branch 3 times, most recently from 6abd48e to ee0bed7 Compare January 9, 2026 15:25
@github-actions
Copy link

github-actions bot commented Jan 9, 2026

PR Preview Action v1.8.1

QR code for preview link

🚀 View preview at
https://instructure.design/pr-preview/pr-2342/

Built to branch gh-pages at 2026-01-20 18:34 UTC.
Preview will be ready when the GitHub Pages deployment is complete.

@git-nandor git-nandor marked this pull request as ready for review January 10, 2026 11:03
@git-nandor git-nandor force-pushed the INSTUI-4818_treebrowser_rework_1 branch from ee0bed7 to 8f81f6f Compare January 10, 2026 12:03
@git-nandor git-nandor changed the title Inst UI 4818 treebrowser rework 1 [v12] feat(ui-tree-browser): TreeBrowser rework Jan 10, 2026
Copy link
Collaborator

@matyasf matyasf left a comment

Choose a reason for hiding this comment

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

Can you also update the example in the regression test to use the new icons?

Comment on lines 131 to 133
const iconElement = isValidElement(icon)
? safeCloneElement(icon, { size, color: iconColor })
: callRenderProp(icon, { size, color: iconColor })
Copy link
Collaborator

Choose a reason for hiding this comment

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

We should come up with a pattern for this... @joyenjoyer FYI

@git-nandor git-nandor force-pushed the INSTUI-4818_treebrowser_rework_1 branch 7 times, most recently from b8e26a4 to ae7c1ea Compare January 16, 2026 10:21
@git-nandor git-nandor requested a review from matyasf January 16, 2026 11:13
@matyasf matyasf requested a review from hajnaldo January 19, 2026 15:38
@git-nandor git-nandor force-pushed the INSTUI-4818_treebrowser_rework_1 branch from ae7c1ea to e394b93 Compare January 19, 2026 19:28
Copy link
Collaborator

@matyasf matyasf left a comment

Choose a reason for hiding this comment

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

looks good!

@ToMESSKa
Copy link
Contributor

ToMESSKa commented Jan 20, 2026

image

here the text-background contrast ratio seem a bit off

@ToMESSKa
Copy link
Contributor

In v11, the TextInput's focus ring is visible when I click into the input field:

image But here it is not: image

@ToMESSKa
Copy link
Contributor

image I dark mode and with hover, the text is not really visible

Copy link
Contributor

@ToMESSKa ToMESSKa left a comment

Choose a reason for hiding this comment

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

see my comments

Comment on lines +347 to +349
- `iconsMarginRightSmall` (new)
- `iconsMarginRightMedium` (new)
- `iconsMarginRightLarge` (new)
Copy link
Contributor

Choose a reason for hiding this comment

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

Are we supposed to put the new tokens into the upgrade guide? I think only the renamed or removed ones are relevant?

@git-nandor
Copy link
Contributor Author

image here the text-background contrast ratio seem a bit off

This is just an example of the custom content, but I updated the color to make it more visible in all cases.

@git-nandor
Copy link
Contributor Author

image I dark mode and with hover, the text is not really visible

Thanks! I talked to Ádám, and he’s going to change the tokens.

@git-nandor git-nandor force-pushed the INSTUI-4818_treebrowser_rework_1 branch from e394b93 to ef34995 Compare January 20, 2026 18:29
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.

4 participants