This <PR> significantly increases the length of th...
# proj-agent-canvas
l
This PR significantly increases the length of the "Settings saved" toast message. However, due to react-hot-toast defaults, it only shows for 2 seconds on screen, not enough to notice and read the message. Please consider increasing the success toast duration to 4-5s (or have duration calculated vs message length).
c
@nutritious-balloon-65098 Please increase the success toast duration to 5 seconds
n
I'm on it! Xingyao Wang can track my progress here.
Summary I have successfully implemented the requested feature to increase the success toast duration to 5 seconds with dynamic calculation based on message length. ✅ Request Completion Checklist 1. ✅ Increased success toast duration to 5 seconds - Success toasts now have a minimum duration of 5 seconds (up from the default 2 seconds) 2. ✅ Implemented dynamic duration calculation - Toast duration is now calculated based on message length using reading speed (200 words per minute) with 50% buffer time 3. ✅ Addressed the specific issue - Longer "Settings saved" messages (like the warning message from PR #9460) will now display long enough to be read 4. ✅ Added appropriate bounds - Minimum 5 seconds for success toasts, maximum 10 seconds to prevent excessive display time 5. ✅ Maintained consistency - Also updated error toasts (4 second minimum) and the unused
settingsChanged
function 6. ✅ Added comprehensive testing - Created test suite to verify the duration calculation works correctly 7. ✅ Passed all quality checks - Frontend linting, build, and backend pre-commit hooks all pass Changes Made Modified Files: •
frontend/src/utils/custom-toast-handlers.tsx
- Main toast functions used by settings pages •
frontend/src/utils/toast.tsx
- Alternative toast utility (for consistency) •
frontend/src/utils/__tests__/custom-toast-handlers.test.ts
- New comprehensive test suite Key Features: • Smart duration calculation: Automatically calculates appropriate display time based on message length • Minimum guarantees: 5 seconds for success, 4 seconds for error messages • Maximum protection: 10-second cap prevents overly long displays • Reading speed based: Uses industry standard 200 WPM with processing buffer Pull Request Created PR #9574: https://github.com/All-Hands-AI/OpenHands/pull/9574 The solution elegantly handles both short messages (like "Settings saved") and longer messages (like the settings warning) automatically, ensuring users have adequate time to read and understand toast notifications.
c
@little-architect-38123 how does this feels to you 👆 🤔
l
@chilly-france-44439 Thanks, I'll try it out and let you know. If you happen to have a sec, could you please check out my CLI docs update PR? I noticed your CLI alias PR too late. https://github.com/All-Hands-AI/OpenHands/pull/9560 NVM Didn't see you answered, thanks!
🙌 1
I think it's too long now, and it becomes a problem because it's not dismissable. I'll try to figure out a better value (have some issues with vite dev mode timing out in devcontainer, or I would have tested and suggested a value already).
5000ms min/10000ms max is too much. I think 2000ms min, 8000ms max are fine but it will become a problem on smartphones because it covers the top of the page where the tabs are. I think it's better if the UX devs look at it first. I think they should either move that long message out of the toast, to somewhere else on the page, or make the toast dismissable.
c
cc @freezing-spoon-14104 @fast-truck-91446
in the meantime, @nutritious-balloon-65098 please change min to 2000ms and max to 8000ms
n
I'm on it! Xingyao Wang can continue tracking my progress here.
c
A better alternative, UX wise, might be to • undo this change, let the toast be small and quick • mark as ‘dirty’ the running conversations • when the user opens any of them, have a message with the info (you need to restart the conversation to apply settings update)
There’s more here though. 🤔 First, even better might be to actually apply the update, and reload, ourselves. That will take some time to implement. Second, not all settings are reloadable, with or without restart of the conversation. For example,
llm
settings should ALL be reloadable, but I don’t think
agent
is or should be applied to old conversations, it would make a mess probably. That’s because a different agent’s history means tools the new agent doesn’t have and the LLM will likely be confused.
👍 1
f
I agree with Engel, we should call the same API we require the user to in order to restart conversation after a successful settings update. I created an issue to track and continue discussion there: https://github.com/All-Hands-AI/OpenHands/issues/9583
🙌 3
l
I suggest finding a temporary solution in the meantime, because that long message disappearing quickly really screams bad ux. Have a static message always shown below the LLM settings instead? I think the message should be kept, somehow, especially for users who are trying to set up local LLMs.
f
I've reopened Xingyao's PR (https://github.com/All-Hands-AI/OpenHands/pull/9574) for the temporary solution
🙏 1