Skip to content

feat(frontend): advanced settings for computing-unit creation - #6104

Merged
kunwp1 merged 6 commits into
apache:mainfrom
kunwp1:feat/cu-advanced-settings
Jul 9, 2026
Merged

kunwp1 merged 6 commits into
apache:mainfrom
kunwp1:feat/cu-advanced-settings

Conversation

@kunwp1

@kunwp1 kunwp1 commented Jul 4, 2026 •

Copy link
Copy Markdown
Contributor

What changes were proposed in this PR?

This PR improves the UI of creating a computing unit (CU) with an "Advanced Settings" section to get a simplified default view.

The shared memory size and JVM memory size are too technical for most users, so the create-CU modal now shows only the common fields (name / RAM / CPU) by default and tucks those two options behind a collapsed "Advanced Settings" panel:

  • Collapsed by default, and collapses again every time the modal opens.
  • If shared memory is set larger than total memory while the panel is collapsed, a warning appears on the panel header so the invalid value is not hidden.
  • Implemented once in the shared ComputingUnitCreateModalComponent (refactor(frontend): extract shared computing-unit create modal component #6082), so both entry points (the dashboard Computing Units page and the workspace power button) get the same behavior.

The feature was originally implemented on the downstream dknet-ai.org deployment (Texera/dknet-ai-public@30318e2d).

Any related issues, documentation, discussions?

Closes #6102

How was this PR tested?

Screen.Recording.2026-07-04.at.1.45.33.PM.mov

Was this PR authored or co-authored using generative AI tooling?

Generated-by: Claude Code

The computing-unit creation modal listed every knob inline. Shared-memory and
JVM-heap size are advanced options most users never touch, so they crowded the
common path (name / RAM / CPU).

Tuck them behind a collapsed "Advanced Settings" disclosure in the shared
ComputingUnitCreateModalComponent, which serves both creation entry points
(the dashboard Computing Units page and the workspace power-button):

- Progressive disclosure: rotating chevron + smooth height animation;
  collapsed by default and re-collapsed every time the modal opens
  (ngOnChanges on `visible`).
- Validation stays visible: when collapsed, an amber header hint surfaces the
  "shared memory exceeds total" warning so it can't be submitted unseen.
- Accessibility: native button + aria-expanded, and `inert` on the collapsed
  panel so its controls stay out of the tab order.
@github-actions github-actions Bot added feature frontend Changes related to the frontend GUI labels Jul 4, 2026
@github-actions

github-actions Bot commented Jul 4, 2026

Copy link
Copy Markdown
Contributor

Automated Reviewer Suggestions

Based on the git blame history of the changed files, we recommend the following reviewers:

  • No candidates found from git blame history.

@codecov-commenter

codecov-commenter commented Jul 4, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 60.67%. Comparing base (18ccda9) to head (db3cbb4).

Additional details and impacted files
@@             Coverage Diff              @@
##               main    #6104      +/-   ##
============================================
- Coverage     60.67%   60.67%   -0.01%     
  Complexity     3368     3368              
============================================
  Files          1133     1133              
  Lines         44141    44172      +31     
  Branches       4825     4829       +4     
============================================
+ Hits          26782    26800      +18     
- Misses        15901    15915      +14     
+ Partials       1458     1457       -1     
Flag Coverage Δ *Carryforward flag
access-control-service 70.00% <ø> (ø) Carriedforward from 18ccda9
agent-service 44.59% <ø> (ø) Carriedforward from 18ccda9
amber 66.14% <ø> (ø) Carriedforward from 18ccda9
computing-unit-managing-service 0.00% <ø> (ø) Carriedforward from 18ccda9
config-service 52.30% <ø> (ø) Carriedforward from 18ccda9
file-service 63.97% <ø> (ø) Carriedforward from 18ccda9
frontend 52.46% <100.00%> (+0.02%) ⬆️
notebook-migration-service 78.57% <ø> (ø) Carriedforward from 18ccda9
pyamber 91.18% <ø> (ø) Carriedforward from 18ccda9
workflow-compiling-service 55.14% <ø> (ø) Carriedforward from 18ccda9

*This pull request uses carry forward flags. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

kunwp1 added 2 commits July 4, 2026 13:55
Codecov flagged the template's (click) listener as the one uncovered patch
line: the existing tests called toggleAdvancedSettings() directly, so the
rendered button was never exercised. Drive the toggle via the DOM instead,
asserting aria-expanded and the panel's expanded class through a full
expand/collapse round trip.
The slider's breathing-room rationale appeared verbatim at both the
$advanced-panel-padding definition and the .jvm-memory-slider block; keep
the full explanation only at the slider rule it describes.
@kunwp1
kunwp1 requested a review from aicam July 4, 2026 18:34
@kunwp1

kunwp1 commented Jul 4, 2026

Copy link
Copy Markdown
Contributor Author

/request-review @aicam

@chenlica

chenlica commented Jul 5, 2026

Copy link
Copy Markdown
Contributor

/request-review @bobbai00 as well.

@chenlica
chenlica requested a review from bobbai00 July 5, 2026 07:06

@aglinxinyuan aglinxinyuan 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.

LGTM!

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.

Pull request overview

This PR updates the shared frontend computing-unit creation modal to simplify the default UI by hiding technical options (shared memory size and JVM heap size) behind a collapsed “Advanced Settings” disclosure, while still surfacing a warning when shared memory exceeds total memory.

Changes:

  • Added an “Advanced Settings” progressive-disclosure panel to hide shared-memory and JVM-heap controls by default and reset it closed on each open.
  • Surfaced a collapsed-state warning on the panel header when shared memory exceeds total memory.
  • Added unit/integration-style tests for the disclosure behavior and updated styling for the new panel.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.

File Description
frontend/src/app/common/component/computing-unit-create-modal/computing-unit-create-modal.component.ts Adds advanced-settings state, toggle behavior, and re-collapse-on-open logic.
frontend/src/app/common/component/computing-unit-create-modal/computing-unit-create-modal.component.html Moves shared-memory + JVM slider UI into a collapsible Advanced Settings section with header warning.
frontend/src/app/common/component/computing-unit-create-modal/computing-unit-create-modal.component.scss Adds styling/animation for the advanced-settings disclosure panel and nests slider styling.
frontend/src/app/common/component/computing-unit-create-modal/computing-unit-create-modal.component.spec.ts Adds tests for advanced panel toggling, re-collapse behavior, and collapsed warning logic.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

kunwp1 and others added 3 commits July 8, 2026 19:54
Co-authored-by: Copilot Autofix powered by AI <[email protected]>
Signed-off-by: Kunwoo (Chris) <[email protected]>
Review follow-ups for the advanced-settings panel:

- Reset the shm size and JVM slider to their defaults every time the
  create modal opens, so a value from a previous open can't be submitted
  while hidden behind the re-collapsed panel.
- Surface the max-JVM advisory on the collapsed header too, with the
  shm-too-large error outranking it when both apply.
- Expand the panel in the two DOM specs that previously asserted on or
  drove controls inside the collapsed inert body.
- Drop the no-op width on the JVM slider left behind after this PR
  removed the global rule it used to override.
@kunwp1
kunwp1 added this pull request to the merge queue Jul 9, 2026
Merged via the queue into apache:main with commit 6fc1fb7 Jul 9, 2026
20 checks passed
@kunwp1
kunwp1 deleted the feat/cu-advanced-settings branch July 9, 2026 00:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature frontend Changes related to the frontend GUI

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Simplify the computing unit creation UI by moving technical options behind "Advanced Settings"

5 participants