Skip to content

feat: enhance browser examples, added tab menu and auto consume and improvise ui#1387

Merged
danielpeintner merged 7 commits into
eclipse-thingweb:masterfrom
manudev0004:fix/node-wot-examples
Jun 6, 2025
Merged

feat: enhance browser examples, added tab menu and auto consume and improvise ui#1387
danielpeintner merged 7 commits into
eclipse-thingweb:masterfrom
manudev0004:fix/node-wot-examples

Conversation

@manudev0004
Copy link
Copy Markdown
Contributor

Fixed the redirect issue, Added tab menu for example TD, dropdown to choose from examples. Auto consume feature and Enhanced UI slightly

Copy link
Copy Markdown
Member

@danielpeintner danielpeintner left a comment

Choose a reason for hiding this comment

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

The changes look good to me. I noticed one regression that I use to test locally quite often, which is the following. I added the url directly in the URL. For example

index.html?url=http://localhost:8080/counter

which loaded/pre-filled the input field. Maybe we can change this back.

Sidenotes to others. Shall we remove the dedicated files counter.html/js in the future? The differences are minimal... e.g.. counter.html Shows directly the property values, but that's mostly it...

Copy link
Copy Markdown
Member

@relu91 relu91 left a comment

Choose a reason for hiding this comment

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

I would change a bunch of stuff (sorry, it might be a little bit overwhelming).

image

The dropdown menù is redundant we have already tabs for that I'd just use a simple input text box. Second I'd start with the TestThing as first tab selected and custom as last. We don't have to forget that this is an example and we want to show something as soon as possible reducing initial friction to zero.

image

This layout is very unintuitive... it even feels broken. We should find something better without complicating too much. In particular, I'm expecting the input of action close to the action that I've selected.

I don't remember but I belive in the past it was possible to write to properties too.. now we don't.

In general, we need either some explainer text about how to use the example or a more intuitive UI.

@danielpeintner
Copy link
Copy Markdown
Member

This layout is very unintuitive... it even feels broken. We should find something better without complicating too much. In particular, I'm expecting the input of action close to the action that I've selected.

I don't remember but I belive in the past it was possible to write to properties too.. now we don't.

In general, we need either some explainer text about how to use the example or a more intuitive UI.

@relu91 I agree with your statements, but it feels like these changes could be done in a follow-up PR/issue?

@relu91
Copy link
Copy Markdown
Member

relu91 commented May 26, 2025

I would at least fix the layout, then yes, we can improve it in a follow-up PR.

@manudev0004
Copy link
Copy Markdown
Contributor Author

Thanks for the detailed feedback @danielpeintner @relu91 !

I will restore the ?url= query param support to pre-fill the input field.
I will remove the dropdown (it seemed redundant to me too, but it was in the task, so I added it). Further, we will move Custom URL to last and Testing to first.
I will improve the action layout so that input and buttons are placed side by side. And try to fix ui better without complicating it.
Then I will add a short explainer for better usability.

I'll push an updated version with these changes soon.

One more thing what is online link of the counter ? as this is not working - 'http://plugfest.thingweb.io:8083/counter'

@danielpeintner
Copy link
Copy Markdown
Member

One more thing what is online link of the counter ? as this is not working - 'http://plugfest.thingweb.io:8083/counter'

We recently moved the server with the online things, and the counter example is not yet back.

@egekorkan
Copy link
Copy Markdown
Member

We talked in the committer meeting. @manudev0004 it would be good to fix the tabs:

  • Removing duplication (no drop-down needed)
  • Custom should be the last tab
  • The description below each tab can be simply Consumed TD at {URL}, and then we can use the description field of the TD to fill the field. If there is an error with fetching, the error should be displayed here (like in Counter).

The rest of the layout issues can be fixed in another PR :)

@danielpeintner
Copy link
Copy Markdown
Member

I checked the update and I think we are close.

I noticed some more things.

1.) Error clearAllInteractions

In the case of the counter, which fails at the moment, I also get some errors that we shouldn't see like

clearAllInteractions is not defined

The same happen if I try to load an invalid URL in custom tab.

grafik

2.) Hitting "Enter" on custom tab textfield after inserting URL could call "Consume"

Apart from the above, I think we are fine now and can tackle the other issues. I created #1389 for that purpose.

Copy link
Copy Markdown
Member

@relu91 relu91 left a comment

Choose a reason for hiding this comment

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

We are almost there. Currently, when the fetch fails, the error message is displayed in the TD description. I think this is counterintuitive. Please reintroduce the error banner and hide the TD Description field if the fetch fails.

Comment thread examples/browser/index.js Outdated

// Clear all interactions and editor
function clearAllInteractions() {
console.log("clearAllInteractions function called");
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Remove this leftover.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

FYI: @relu91 refers to the console log only...

Copy link
Copy Markdown
Member

@danielpeintner danielpeintner left a comment

Choose a reason for hiding this comment

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

Besides the comments from @relu91 it looks good to me.

@manudev0004
Copy link
Copy Markdown
Contributor Author

error is now shown in the banner and when there is an error, TD Description will hide. Made code cleaner by removing some unnecessary lines.

@manudev0004 manudev0004 requested a review from relu91 June 5, 2025 12:55
Copy link
Copy Markdown
Member

@relu91 relu91 left a comment

Choose a reason for hiding this comment

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

good to go!

@relu91
Copy link
Copy Markdown
Member

relu91 commented Jun 5, 2025

@danielpeintner, please explicitly approve.

@codecov
Copy link
Copy Markdown

codecov Bot commented Jun 5, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 76.15%. Comparing base (b948e53) to head (51d5c1c).
Report is 6 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1387      +/-   ##
==========================================
- Coverage   77.06%   76.15%   -0.91%     
==========================================
  Files          79       79              
  Lines       15290    15290              
  Branches     1442     1421      -21     
==========================================
- Hits        11783    11644     -139     
- Misses       3483     3624     +141     
+ Partials       24       22       -2     

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link
Copy Markdown
Member

@danielpeintner danielpeintner left a comment

Choose a reason for hiding this comment

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

LGTM 👍

@danielpeintner danielpeintner merged commit 04a37f5 into eclipse-thingweb:master Jun 6, 2025
13 checks passed
@danielpeintner
Copy link
Copy Markdown
Member

A nice follow-up work that come out of this PR is #1389
@manudev0004

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