Skip to content

Add interaction buttons for public datasets - #3269

Merged
GspikeHalo merged 6 commits into
masterfrom
team-b-add-dataset-interaction-button
Feb 20, 2025
Merged

GspikeHalo merged 6 commits into
masterfrom
team-b-add-dataset-interaction-button

Conversation

@GspikeHalo

Copy link
Copy Markdown
Contributor

Purpose:

Add like and view interactions to the public dataset interface to enhance the user experience

Changes:

  1. Update the database by adding two tables, dataset_user_likes and dataset_view_count, to record user activities. Use 22.sql to update the database.
  2. Update the backend EntityTables.scala by adding a case object related to datasets.
  3. Add view count and like buttons in the dataset-detail component.
  4. Update the list item to support the like button and view count for the dataset type.

Demos:

Before:
Hub dataset list item before login:
image

Hub dataset detail before login:
image

Hub dataset list item after login:
image

Hub dataset detail after login:
image

User dataset list item:
image

User dataset detail:
image

After:
Hub dataset list item before login:
image

Hub dataset detail before login:
image

Hub dataset list item after login:
image

Hub dataset detail after login:
image

User dataset list item:
image

User dataset detail:
image

@GspikeHalo GspikeHalo added gui frontend Changes related to the frontend GUI labels Feb 19, 2025

@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!

@GspikeHalo
GspikeHalo merged commit 2b32483 into master Feb 20, 2025
@GspikeHalo
GspikeHalo deleted the team-b-add-dataset-interaction-button branch February 20, 2025 01:49
Ma77Ball pushed a commit that referenced this pull request Apr 2, 2025
### Purpose:
Add like and view interactions to the public dataset interface to
enhance the user experience

### Changes:
1. **Update the database** by adding two tables, `dataset_user_likes`
and `dataset_view_count`, to record user activities. Use `22.sql` to
update the database.
2. **Update the backend `EntityTables.scala`** by adding a `case object`
related to datasets.
3. **Add view count and like buttons** in the `dataset-detail`
component.
4. **Update the list item** to support the like button and view count
for the dataset type.

### Demos:
Before:
Hub dataset list item before login:

![image](https://github.com/user-attachments/assets/76623c6d-2ef1-4b2f-a7aa-3d7df2a6f41b)

Hub dataset detail before login:

![image](https://github.com/user-attachments/assets/a4eda582-1734-480f-9ce8-750465070119)

Hub dataset list item after login:

![image](https://github.com/user-attachments/assets/f5ae8c14-784b-4cad-875b-89feb62e9764)

Hub dataset detail after login:

![image](https://github.com/user-attachments/assets/de37c7de-10eb-4050-8aa4-dc21ec2c0022)

User dataset list item:

![image](https://github.com/user-attachments/assets/a8450b7e-683a-4812-b3be-a0efc8c5e492)

User dataset detail:

![image](https://github.com/user-attachments/assets/ba7a6a07-b8e5-4066-9f8b-81add28c3434)

After:
Hub dataset list item before login:

![image](https://github.com/user-attachments/assets/284e4e65-f639-421e-b118-d82b96e0abce)

Hub dataset detail before login:

![image](https://github.com/user-attachments/assets/64d745ce-b431-4c8c-97a0-ccbb65100905)

Hub dataset list item after login:

![image](https://github.com/user-attachments/assets/1e05b43f-c76a-4894-a00b-fb50d268a8af)

Hub dataset detail after login:

![image](https://github.com/user-attachments/assets/bc129097-2417-4b21-ab85-a4de92e3438c)

User dataset list item:

![image](https://github.com/user-attachments/assets/1839dcdf-669d-4821-9a02-c690aad930fd)

User dataset detail:

![image](https://github.com/user-attachments/assets/f5caa6ae-cc5b-48eb-98ef-54df56ca79d8)

---------

Co-authored-by: Xinyuan Lin <[email protected]>
@Yicong-Huang Yicong-Huang removed the gui label Jul 6, 2025
SarahAsad23 pushed a commit to madisonmlin/texera that referenced this pull request May 20, 2026
### Purpose:
Add like and view interactions to the public dataset interface to
enhance the user experience

### Changes:
1. **Update the database** by adding two tables, `dataset_user_likes`
and `dataset_view_count`, to record user activities. Use `22.sql` to
update the database.
2. **Update the backend `EntityTables.scala`** by adding a `case object`
related to datasets.
3. **Add view count and like buttons** in the `dataset-detail`
component.
4. **Update the list item** to support the like button and view count
for the dataset type.

### Demos:
Before:
Hub dataset list item before login:

![image](https://github.com/user-attachments/assets/76623c6d-2ef1-4b2f-a7aa-3d7df2a6f41b)

Hub dataset detail before login:

![image](https://github.com/user-attachments/assets/a4eda582-1734-480f-9ce8-750465070119)

Hub dataset list item after login:

![image](https://github.com/user-attachments/assets/f5ae8c14-784b-4cad-875b-89feb62e9764)

Hub dataset detail after login:

![image](https://github.com/user-attachments/assets/de37c7de-10eb-4050-8aa4-dc21ec2c0022)

User dataset list item:

![image](https://github.com/user-attachments/assets/a8450b7e-683a-4812-b3be-a0efc8c5e492)

User dataset detail:

![image](https://github.com/user-attachments/assets/ba7a6a07-b8e5-4066-9f8b-81add28c3434)

After:
Hub dataset list item before login:

![image](https://github.com/user-attachments/assets/284e4e65-f639-421e-b118-d82b96e0abce)

Hub dataset detail before login:

![image](https://github.com/user-attachments/assets/64d745ce-b431-4c8c-97a0-ccbb65100905)

Hub dataset list item after login:

![image](https://github.com/user-attachments/assets/1e05b43f-c76a-4894-a00b-fb50d268a8af)

Hub dataset detail after login:

![image](https://github.com/user-attachments/assets/bc129097-2417-4b21-ab85-a4de92e3438c)

User dataset list item:

![image](https://github.com/user-attachments/assets/1839dcdf-669d-4821-9a02-c690aad930fd)

User dataset detail:

![image](https://github.com/user-attachments/assets/f5caa6ae-cc5b-48eb-98ef-54df56ca79d8)

---------

Co-authored-by: Xinyuan Lin <[email protected]>
yangzhang75 pushed a commit to yangzhang75/texera that referenced this pull request Jun 22, 2026
### Purpose:
Add like and view interactions to the public dataset interface to
enhance the user experience

### Changes:
1. **Update the database** by adding two tables, `dataset_user_likes`
and `dataset_view_count`, to record user activities. Use `22.sql` to
update the database.
2. **Update the backend `EntityTables.scala`** by adding a `case object`
related to datasets.
3. **Add view count and like buttons** in the `dataset-detail`
component.
4. **Update the list item** to support the like button and view count
for the dataset type.

### Demos:
Before:
Hub dataset list item before login:

![image](https://github.com/user-attachments/assets/76623c6d-2ef1-4b2f-a7aa-3d7df2a6f41b)

Hub dataset detail before login:

![image](https://github.com/user-attachments/assets/a4eda582-1734-480f-9ce8-750465070119)

Hub dataset list item after login:

![image](https://github.com/user-attachments/assets/f5ae8c14-784b-4cad-875b-89feb62e9764)

Hub dataset detail after login:

![image](https://github.com/user-attachments/assets/de37c7de-10eb-4050-8aa4-dc21ec2c0022)

User dataset list item:

![image](https://github.com/user-attachments/assets/a8450b7e-683a-4812-b3be-a0efc8c5e492)

User dataset detail:

![image](https://github.com/user-attachments/assets/ba7a6a07-b8e5-4066-9f8b-81add28c3434)

After:
Hub dataset list item before login:

![image](https://github.com/user-attachments/assets/284e4e65-f639-421e-b118-d82b96e0abce)

Hub dataset detail before login:

![image](https://github.com/user-attachments/assets/64d745ce-b431-4c8c-97a0-ccbb65100905)

Hub dataset list item after login:

![image](https://github.com/user-attachments/assets/1e05b43f-c76a-4894-a00b-fb50d268a8af)

Hub dataset detail after login:

![image](https://github.com/user-attachments/assets/bc129097-2417-4b21-ab85-a4de92e3438c)

User dataset list item:

![image](https://github.com/user-attachments/assets/1839dcdf-669d-4821-9a02-c690aad930fd)

User dataset detail:

![image](https://github.com/user-attachments/assets/f5caa6ae-cc5b-48eb-98ef-54df56ca79d8)

---------

Co-authored-by: Xinyuan Lin <[email protected]>
renovate-bot pushed a commit to renovate-bot/apache-_-texera that referenced this pull request Oct 5, 2026
)

### What changes were proposed in this PR?

Removes dead code from `DatasetDetailComponent` that its template
stopped using during the dataset page's redesigns. **+2/−46 lines.**
There is no behaviour change.

- **Members:** `versionCreatorBaseVersion`, `displayPreciseViewCount` +
`changeViewDisplayStyle()`, and the `formatTime` / `formatSpeed`
aliases. The `format.util` import narrows to `formatCount`.
- **Styles:** `.tag-settings-btn`, `.tag-settings-title`,
`.tag-settings-row` (with its `span` and `::ng-deep .ant-switch` rules),
and `.description-section`.
- **Spec:** the "view flags" case keeps its maximize / right-bar
assertions and drops the three for the removed toggle. It is renamed to
match.

### History

| | |
| --- | --- |
| **Introduced by** | apache#2413 (2024-02-26), "Introduce Dataset GUI":
`versionCreatorBaseVersion`. apache#3269 (2025-02-19): the precise-view-count
toggle. apache#3662 (2025-08-19): the speed/time aliases. apache#4337 (2026-03-29),
"improve dataset detail page layout": the `.tag-settings-*` and
`.description-section` styles |
| **Usage removed by** | apache#3296 (2025-03-10):
`versionCreatorBaseVersion`. apache#4337 (2026-03-29): the view-count toggle.
apache#6493 (2026-07-27): tag settings moved to a Settings tab. apache#7043
(2026-07-30): the description moved to the Data Card tab. apache#8078
(2026-08-31): the speed/time aliases |

Each piece was left behind by a redesign that moved its markup
elsewhere. The oldest has been dead for eighteen months.

### Any related issues, documentation, discussions?

Closes apache#8745

### How was this PR tested?

No new tests. The kept spec cases cover the remaining members.

From `frontend/`:

- `npx ng test --watch=false
--include='**/dataset-detail.component.spec.ts'`: 150 tests, all pass.
- `yarn format:ci`: clean.
- `npx ng build`: success.

To re-check:

```
git grep -n -E "versionCreatorBaseVersion|tag-settings|description-section" -- frontend   # no hits
```

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

Generated-by: Claude Code (Claude Opus 5.5)

🤖 Generated with [Claude Code](https://claude.com/claude-code)
renovate-bot pushed a commit to renovate-bot/apache-_-texera that referenced this pull request Oct 5, 2026
### What changes were proposed in this PR?

Clicking the eye ("View") button on the hub workflow detail page
switches the view count between the compact form (`1.2k`) and the exact
count (`1,234`) again. The button has done nothing since apache#3028.

**Root cause.** Only one method read `displayPreciseViewCount`:
`formatViewCount`. apache#3028 deleted it as a duplicate of the like-count
formatter, but the two were not the same. `formatViewCount` skipped the
`k` abbreviation while the flag was set. The button, its `(click)`
handler and the flag were all kept, so each click flipped a flag that
nothing read.

```
Before:  click eye -> "1.2k";  click again -> "1.2k"
After:   click eye -> "1,234"; click again -> "1.2k"
```

`formatViewCount` comes back as a thin wrapper over the shared
`formatCount`, and the view button's label uses it again. The exact
count is grouped by thousands with the app's `LOCALE_ID`, the same
formatting as the `number` pipe used elsewhere in the UI. The app sets
no `LOCALE_ID`, so it shows `1,234`. The like and clone counts still go
through `formatCount` and stay compact.

| | Default | After one click |
| --- | --- | --- |
| **Before** | ![before,
default](https://raw.githubusercontent.com/aglinxinyuan/texera/630604d0570603be76e7caac68436e82575d6d1c/before-default.png)
| ![before,
clicked](https://raw.githubusercontent.com/aglinxinyuan/texera/630604d0570603be76e7caac68436e82575d6d1c/before-clicked.png)
|
| **After** | ![after,
default](https://raw.githubusercontent.com/aglinxinyuan/texera/630604d0570603be76e7caac68436e82575d6d1c/after-default.png)
| ![after,
clicked](https://raw.githubusercontent.com/aglinxinyuan/texera/630604d0570603be76e7caac68436e82575d6d1c/after-clicked.png)
|

### History

| | |
| --- | --- |
| **Introduced by** | apache#2930 (2024-10-28), "Add view count to workflow":
the eye button, `changeViewDisplayStyle()`, `displayPreciseViewCount`,
and `formatViewCount`, which read the flag. The PR's demo shows the
exact count after a click |
| **Usage removed by** | apache#3028 (2024-11-11), "Remove duplicate and
unnecessary code": deleted `formatViewCount` and switched the label to
`formatCount` |

The toggle worked for two weeks and has done nothing for almost two
years since. The dataset detail page's copy of the button is a different
case: apache#3269 added it after apache#3028, so it never worked there, and apache#8746
removes it.

### Any related issues, documentation, discussions?

Closes apache#8751

### How was this PR tested?

The old spec case only checked that the flag flipped, and it passed
while the button did nothing. It is replaced by:

| Surface | Pinned |
| --- | --- |
| `formatViewCount` | Compact by default. Exact (`1,234`) after one
toggle, compact again after a second. `1000` shows as `1.0k` / `1,000`.
`0`, `1` and `999` look the same in both styles. The compact style of
`1234567` equals `formatCount`, and the exact style is `1,234,567`. With
`LOCALE_ID` set to `de`, the exact style is `1.234` |
| Rendered view button (real template) | Shows `1.2k` for 1234 views. A
click shows `1,234`, a second click `1.2k`. Same when the page opens as
a modal. The like count stays `2.5k` after the view button is clicked |

The rendered-button cases were run against `main`'s component first and
fail there with `expected '1.2k' to be '1,234'`.

From `frontend/`:

- `npx ng test --watch=false
--include='**/hub-workflow-detail.component.spec.ts'`: 52 tests, all
pass.
- `yarn format:ci`: clean.
- `npx ng build`: success.

Screenshots: `ng serve` against a stub API that reports 1234 views, 56
likes and 12 clones. Headless Chromium at 1280×720 via Playwright, with
the button row captured before and after one click on the eye.
**Before** is the same page running `main`'s component.

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

Generated-by: Claude Code (Claude Opus 5.5)

🤖 Generated with [Claude Code](https://claude.com/claude-code)
renovate-bot pushed a commit to renovate-bot/apache-_-texera that referenced this pull request Nov 26, 2026
### What changes were proposed in this PR?

Remove redundant code from the frontend, the licensing scripts, two
Scala sources and the agent service (**+26/−41 lines**). There is no
behavior change.

- **Dataset and model detail pages:** each `route.params` emission was
switched to `this.route.data`, and the empty `.subscribe()` threw away
what that emitted. The pages now `tap` the params, so the same fetches
run in the same order without the extra subscription. The dataset page's
`THROTTLE_TIME_MS` also becomes file-local: `workspace.component.ts` and
the hub spec import the copy in `hub-workflow-detail.component.ts`,
never this one.
- **Version uploader:** the abort handler's 404 branch called `done()`
and returned, which is what the handler already does for every error it
does not retry. Its three constants become file-local: nothing imported
`FINISHED_TASK_HIDE_DELAY_MS`, and only the spec imported the other two.
The spec now states the retry policy it expects.
- **Computing-unit actions:** `confirmAndTerminate` reads
`unit.computingUnit.uri` and `unit.computingUnit.name` before
`unit?.computingUnit.type`, so the `?.` goes.
- **Loop blocks:** `LOOP_END_OP_TYPE` becomes file-local. Only its spec
imported it, and the spec now checks the backend's `"LoopEnd"` name
directly.
- **Agent interaction:** two imports from `agent.service` become one.
- **Licensing scripts:** `audit_jar_licenses.py` stored each group's
notice hash in a field that nothing reads, and the NOTICE test helper
`make_jar` had an `extra` parameter that no caller passes.
- **`PveResource`:** drops `import javax.ws.rs.DELETE` and `import
javax.ws.rs.PathParam`, which `import javax.ws.rs._` already covers.
- **`SQLSourceOpExec` and `AsterixDBSourceOpExec`:** five fallback arms
list `BOOLEAN`, `STRING` and `ANY` before a trailing `_`, as in `case
AttributeType.BOOLEAN | AttributeType.STRING | AttributeType.ANY | _`.
The `_` matches those types as well, so each becomes `case _`.
- **`agent-service/.dockerignore`:** Docker reads the ignore file at the
root of the build context. CI's image matrix
(`build-and-push-images.yml`) and `bin/build-images.sh` both use the
repository root as the context, and the agent Dockerfile copies
`agent-service/...` paths from there, so the root `.dockerignore`
applies and this file is never read.

| Event | PR / Commit |
| --- | --- |
| Introduced by | Dataset and model detail: apache#2413 (2024-02-26), apache#3269
(2025-02-19), apache#8072 (2026-08-28); version uploader: apache#4136 (2026-01-05),
moved by apache#8078 (2026-08-31); computing-unit actions: apache#4331 (2026-04-09);
loop blocks: apache#8640 (2026-10-24); agent interaction: apache#6009 (2026-11-13);
licensing scripts: apache#4387 (2026-04-29), apache#5417 (2026-06-10);
`PveResource`: apache#5035 (2026-05-13); `SQLSourceOpExec`: apache#1013
(2021-02-11); `AsterixDBSourceOpExec`: apache#1044 (2021-02-25);
`agent-service/.dockerignore`: apache#4495 (2026-04-28) |
| Usage removed by | `agent-service/.dockerignore`: apache#4544 (2026-05-01)
added the agent image's Dockerfile with paths from the repository root,
so no build has read the file. Everything else: unused or redundant
since introduction. |

As of 2026-11-25:
- The SQL sources' fallback arms have listed redundant types for over 5
years.
- The dataset page's discarded subscription is almost 3 years old.
- The version uploader's 404 branch has been redundant for over 10
months.
- `agent-service/.dockerignore` has gone unread for almost 7 months.
- The duplicate agent import is 12 days old.

### Any related issues, documentation, discussions?

Closes apache#9691.

### How was this PR tested?

Ran on this branch and on `main` at `afc2b3db7a` (Windows 11; Node 24
with Yarn 4.14.1; Python 3.12 with pytest 9.0.3 and CI's pinned `ruff`
0.14.7; JDK 17):

```bash
cd frontend
npx ng test --watch=false --include='**/dataset-detail.component.spec.ts' --include='**/model-detail.component.spec.ts' --include='**/version-uploader.component.spec.ts' --include='**/computing-unit-actions.service.spec.ts' --include='**/loop-block.util.spec.ts' --include='**/agent-interaction.component.spec.ts'
npx tsc --noEmit -p src/tsconfig.app.json
npx tsc --noEmit -p src/tsconfig.spec.json
yarn prettier-eslint --list-different $(git diff --name-only --relative origin/main -- src)
yarn eslint $(git diff --name-only --relative origin/main -- src)
cd ..
pytest bin/licensing
ruff check bin/licensing/audit_jar_licenses.py bin/licensing/test_generate_notice_binary.py
python bin/licensing/audit_jar_licenses.py <directory of 60 jars>
sbt "WorkflowOperator/testOnly org.apache.texera.amber.operator.source.sql.*" "WorkflowExecutionService/testOnly org.apache.texera.web.resource.pythonvirtualenvironment.*" WorkflowOperator/scalafmtCheckAll WorkflowExecutionService/scalafmtCheckAll "WorkflowOperator/scalafixAll --check" "WorkflowExecutionService/scalafixAll --check"
```

- **Frontend:** the six specs run 379 tests, all passing on both sides.
Both typechecks, prettier-eslint and ESLint pass.
- **Python:** the licensing tests run 53 tests and 5 subtests, all
passing on both sides, and Ruff passes. `audit_jar_licenses.py` prints
the same report on both sides for 60 jars from the local Coursier cache.
- **Scala:**
  - The 11 `source.sql` suites run 204 tests, all passing on both sides.
- The two PVE resource suites run 75 tests on both sides: 74 pass and 1
is canceled. The canceled test needs a file that is not executable,
which this Windows filesystem cannot represent.
  - scalafmt and scalafix pass on both modules.
- **`agent-service/.dockerignore`:** no image was built. The build
context comes from `context="."` for every
`bin/dockerfiles/*.dockerfile` in `build-and-push-images.yml`, and from
the `..` that `bin/build-images.sh` passes from `bin/`.

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

Generated-by: Claude Code (Claude Opus 5.5)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

frontend Changes related to the frontend GUI

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants