Repository navigation
Simplify operator-related UI with element folding on mouseover - #1374
Conversation
|
Update: CI not passed because of failed unit tests. Should also change unit tests for related files. |
Yicong-Huang
left a comment
There was a problem hiding this comment.
The PR looks very structured and clean! We should all learn from you with this standard. I Left some minor comments.
For the PR description, it's better to highlight the color change for the state. Mark it explicitly with some clear format:
workflow state: old color -> new color.
I also wonder if that's a good idea to include a markdown for the color visualization. https://stackoverflow.com/questions/35465557/how-to-apply-color-in-markdown/35485694
| const isSource = this.workflowActionService.getTexeraGraph().getOperator(operatorID).inputPorts.length == 0; | ||
| const isSink = this.workflowActionService.getTexeraGraph().getOperator(operatorID).outputPorts.length == 0; | ||
| this.jointUIService.changeOperatorStatistics(this.getJointPaper(), operatorID, operatorInfo.statistics, isSource, isSink); |
There was a problem hiding this comment.
I think currently this is a simple hack solution to judge an operator based on its ports. The semantic of source/sink might be different than this in the future. we can leave it for now.
I suggest extract this isSource and isSink as two separate predicates, to be reused somewhere else. We can also update this solution in one click in the future.
| .pipe( | ||
| map(value => value[0]) | ||
| ) |
There was a problem hiding this comment.
the format looks off. use yarn format:fix to fix it.
There was a problem hiding this comment.
Done. I only fixed code from my part; there are some codes from other PRs that still need to be formatted.
I modified my original comment and now it should show the color. FYI, Github does NOT support font color for security reasons because font color in Markdown is done through HTML element. But the good thing is Github does allow a color indicator using code-formatted HEX, like |
|
GUI unit test error fixed; CI passed. |
…e#1374) ## Introduction This PR is to make the current UI relate to operators cleaner, namely, "**less green**". Currently, every piece of information is displayed near an operator, but when the workflow gets complicated and large, these (unnecessary) information makes the frontend unbearable to look at. In particularly, these are the main culprits: 1. Operator delete button 2. Operator statistics ("Processed: ...", "Output: ...") that are displayed as green text 3. Operator state which is also displayed as green text 4. The canvas's "black dots" since they overlap with all the texts and make texts hard to read ## Solution To address 1, 2, 3, **UI element folding/unfolding** is introduced, with `mouseover` and `mouseout` as folding/unfolding conditions. Additionally: - For 2, when folded the statistics are abbreviated. - For 2, source/sink operators are treated differently. - For 3, when folded the texts are hidden, but now we use operator boarder (`stroke`) color to indicate different states. - For 3, a new color is introduced to avoid conflict with color used in workflow validation: **paused state: `red`(`#FF0000`, old)->`magenta`(`#FF00FF`, new).** - To prevent flickering when mouse moves between operator sub-elements, a new `rect` `boundary` sub-element is introduced to cover all the sub-elements. To address 4, tentatively text background is introduced. But it should be noted **since all the texts are SVG elements, which DO NOT support text background**, a [simple hack](https://stackoverflow.com/a/41902064) is used. The downside of this hack is that it introduces more new elements and the background is **not rectangular**. ## Demo Below is a demo of the improved UI:  ## Files changed - `joint-ui.service.ts`: The main changes take place here. 1. Added elements and element styles 2. Implemented the style change logic for folding and unfolding 3. Changed some existing elements to support the added elements, in particularly, added names for `rect` svg class to distinguish between operator body and operator's "invisible" boarder; changed the order of `delete-button` in the HTML text or else it would be covered by text backgrounds. - `workflow-editor.component.ts`: Added calling logic for folding and unfolding - `workflow-editor.component.scss`: See `rect` above. Co-authored-by: Yicong Huang <[email protected]>
### What changes were proposed in this PR? Remove code that nothing uses from the dataset service, the dataset file uploader, the Hub component and service, and the canvas glyph service (**+154/−578 lines**). There is no behavior change. - **`DatasetService`:** four dead pieces go. - Six forwarders: `multipartUpload`, `listMultipartUploads`, `findExistingUploadFiles` and `finalizeMultipartUpload` only call `MultipartUploadService`, and `resetDatasetFileDiff` and `getDatasetDiff` only call `StagedFileService`. apache#8078 moved every caller to those services and kept the forwarders "so existing callers are untouched"; only specs still called or stubbed them. - The `GuiConfigService` and `MultipartUploadService` constructor dependencies that the forwarders and nothing else used. - The re-exported `MultipartUploadProgress` type, which nothing imports from here. - URL constants that nothing outside the service imports. The base paths become file-local, and the ones used once are written at their call site. - **Specs:** - The dataset spec's 15 cases that tested the upload and staging services through the forwarders go. `multipart-upload.service.spec.ts` and `staged-file.service.spec.ts` already cover 12 of them. - The other three move to `multipart-upload.service.spec.ts`: progress smoothing, the ETA clamp, and the 0% failure for an empty file. They account for 84 of the added lines. - The clamp case now stalls at 10 of 100 bytes. At 50, the clamped and unclamped ETAs both rounded to 3 s, so it passed with any bound. - The dataset spec's HTTP cases state the URLs they expect, and the dataset-detail spec drops its stubs of the removed forwarders. - **`FilesUploaderComponent`:** the `newUploadFileTreeNodes` field and its import, unused since apache#3296. - **Hub:** `HubComponent`'s `isLogin` input and `GuiConfigService` injection are never read. The dashboard stops passing `isLogin`, and keeps its own login state. `ActionType.Unlike` has no user; `postUnlike` keeps its literal endpoint. - **`JointUIService`:** - Sixteen constants that nothing imports become file-local: eleven glyph constants and five CSS class names. Their values are unchanged. - The `DEFAULT_GROUP_MARGIN` and `DEFAULT_GROUP_MARGIN_BOTTOM` statics go. apache#3033 removed operator groups, their last reader. - The attribute blocks for the abbreviated, processed and output count labels go. apache#3558 removed those labels from the markup. | Event | PR / Commit | | --- | --- | | Introduced by | Forwarders and the re-exported type: apache#8078 (2026-08-31); uploader field: apache#2719 (2024-07-23); `HubComponent.isLogin`: apache#2725 (2024-09-24); `ActionType.Unlike`: apache#3442 (2025-06-28); group margins: apache#754 (2020-12-11); count-label attributes: apache#1374 (2021-11-23) and apache#3477 (2025-07-08) | | Usage removed by | Uploader field: apache#3296 (2025-03-11). Group margins: apache#3033 (2024-11-13). Count-label attributes: apache#3558 (2025-07-11). Everything else: unused since introduction. | As of 2026-11-26: - `HubComponent.isLogin` and the group margins have gone unread for over 2 years. - The uploader field has been unused for over a year and a half, and the count-label attributes for over a year. - `ActionType.Unlike` has been unused for almost a year and a half. - The forwarders have had no caller in the almost 3 months they have existed. ### Any related issues, documentation, discussions? Closes apache#9719. ### How was this PR tested? Ran on this branch and on `main` at `927379aa28` (Windows 11; Node 24 with Yarn 4.14.1): ```bash cd frontend npx ng test --watch=false --include='**/dataset.service.spec.ts' --include='**/dataset-detail.component.spec.ts' --include='**/files-uploader.component.spec.ts' --include='**/hub.component.spec.ts' --include='**/dashboard.component.spec.ts' --include='**/hub.service.spec.ts' --include='**/joint-ui.service.spec.ts' --include='**/multipart-upload.service.spec.ts' npx tsc --noEmit -p src/tsconfig.app.json npx tsc --noEmit -p src/tsconfig.spec.json npx ngc -p src/tsconfig.app.json --noEmit yarn prettier-eslint --list-different $(git diff --name-only --relative origin/main -- src) yarn eslint $(git diff --name-only --relative origin/main -- src | grep -E '\.(ts|html)$') ``` - **Specs:** the eight specs run 357 tests on this branch and 371 on `main`, all passing. - The branch drops the dataset spec's 15 forwarder cases and runs 3 of them in the multipart spec. - It also drops the Hub component's `isLogin` and `GuiConfigService` checks, and renames one Hub case for the dropped input. - Every other test keeps its name and outcome. - **Controls:** widening or narrowing the engine's 30% ETA bound fails the moved clamp case (27 s or 20 s instead of 23 s). At 50 bytes, as on `main`, the widened bound passed. Dropping the empty-file guard fails the 0% case. - **Checks:** both typechecks, the AOT compile (the dashboard template changes), prettier-eslint and ESLint pass. To re-check, this returns no hits on this branch and 19 on `main`: ```bash git grep -nE "public (multipartUpload|listMultipartUploads|findExistingUploadFiles|finalizeMultipartUpload|resetDatasetFileDiff|getDatasetDiff)\(|newUploadFileTreeNodes|Unlike = |texera-operator-(abbreviated|processed|output)-count|private config: GuiConfigService|DEFAULT_GROUP_MARGIN|export const operator(ReuseCacheText|ReuseCacheIcon|ViewResultIcon|Icon|FriendlyName)Class" -- frontend/src/app/dashboard/service/user/dataset frontend/src/app/dashboard/component/user/files-uploader frontend/src/app/hub frontend/src/app/workspace/service/joint-ui ``` ### Was this PR authored or co-authored using generative AI tooling? Generated-by: Claude Code (Claude Opus 5.5)
Introduction
This PR is to make the current UI relate to operators cleaner, namely, "less green". Currently, every piece of information is displayed near an operator, but when the workflow gets complicated and large, these (unnecessary) information makes the frontend unbearable to look at. In particularly, these are the main culprits:
Solution
To address 1, 2, 3, UI element folding/unfolding is introduced, with
mouseoverandmouseoutas folding/unfolding conditions. Additionally:stroke) color to indicate different states.paused state:
red(#FF0000, old)->magenta(#FF00FF, new).rectboundarysub-element is introduced to cover all the sub-elements.To address 4, tentatively text background is introduced. But it should be noted since all the texts are SVG elements, which DO NOT support text background, a simple hack is used. The downside of this hack is that it introduces more new elements and the background is not rectangular.
Demo
Below is a demo of the improved UI:

Files changed
joint-ui.service.ts: The main changes take place here.rectsvg class to distinguish between operator body and operator's "invisible" boarder; changed the order ofdelete-buttonin the HTML text or else it would be covered by text backgrounds.workflow-editor.component.ts: Added calling logic for folding and unfoldingworkflow-editor.component.scss: Seerectabove.