Closed finallyblueskies closed 2 months ago
The latest updates on your projects. Learn more about Vercel for Git ↗︎
Name | Status | Preview | Comments | Updated (UTC) |
---|---|---|---|---|
free-chat | ✅ Ready (Inspect) | Visit Preview | 💬 Add feedback | Apr 18, 2024 3:16am |
All makes sense, thanks for all the research here. I agree with the conclusion that it's not worth it to render the whole scrollview with webviews even though that would offer the best text selection. It's weird that browser style text selection is so hard to achieve with SwiftUI but that seems to be the case.
I like this solution from the video but I wonder if it should go in the "..." menu. I'll play with it more tomorrow and have a think.
Another quick thought. I wonder if there's a hybrid solution where each message renders its own wkwebview for the content (but not the buttons etc). You wouldn't be able to select across messages, but you wouldn't have to toggle on/off to achieve message within the selection and you'd get the richer markdown features you mention.
Another quick thought. I wonder if there's a hybrid solution where each message renders its own wkwebview for the content (but not the buttons etc). You wouldn't be able to select across messages, but you wouldn't have to toggle on/off to achieve message within the selection and you'd get the richer markdown features you mention.
I tried this and faced hurdles:
0x1280b3960 - ProcessAssertion::acquireSync Failed to acquire RBS assertion 'WebProcess NearSuspended Assertion' for process with PID=76447, error: Error Domain=RBSAssertionErrorDomain Code=2 "Specified target process does not exist" UserInfo={NSLocalizedFailureReason=Specified target process does not exist}
Error acquiring assertion: <Error Domain=RBSAssertionErrorDomain Code=2 "Specified target process does not exist" UserInfo={NSLocalizedFailureReason=Specified target process does not exist}>
0x1280b39c0 - ProcessAssertion::acquireSync Failed to acquire RBS assertion 'XPCConnectionTerminationWatchdog' for process with PID=76446, error: Error Domain=RBSAssertionErrorDomain Code=2 "Specified target process does not exist" UserInfo={NSLocalizedFailureReason=Specified target process does not exist}
....
These errors suggest that the processes for the WKWebViews were terminated or went missing because the system couldn't allocate the needed resources. No idea if this is workable, from what I've read WKWebViews are pretty resource intensive.
You can try a functional version of the hybrid approach you mention on [this commit](https://github.com/psugihara/FreeChat/pull/64/commits/d8202af930bb2f8c430e7d95d6b62ee2f22c6768).
This pull request fixes text selection #22 by adding a button in the chat interface. You can see it here:
https://github.com/psugihara/FreeChat/assets/14274086/8b9d4727-62ab-4f55-9bb7-0de7700c360e
This allows users to select text more easily by removing Markdown rendering.
It makes sense to upgrade this feature to an "Edit message" capability.
Reasoning
Despite my efforts, I couldn't implement full text selection without disabling markdown. This pull request details my struggles, primarily focused on using WKWebView to display messages. Long story short: