Skip to content

feat: open asset from activities and disable focusing activity text field#19976

Closed
Tumist76 wants to merge 7 commits intoimmich-app:mainfrom
Tumist76:feat/open-asset-from-activities
Closed

feat: open asset from activities and disable focusing activity text field#19976
Tumist76 wants to merge 7 commits intoimmich-app:mainfrom
Tumist76:feat/open-asset-from-activities

Conversation

@Tumist76
Copy link

Description

This PR adds the ability to open assets directly from the activity page when they are mentioned in activities (likes or comments). Previously, users could only view activities but couldn't easily navigate to the actual asset being referenced. They could only manually locate the asset in album view.

Additionally, it disables autofocus on textfield and keyboard appearance on entering the activities page. Decision was made because of two things. First, IMO, it hurts UX - leaving a comment is not the most popular action for user then opening activities view and none of the apps do this. Second, it triggers keyboard after updating activities view on entering asset viewer.

How Has This Been Tested?

  • Tapping on activity tiles with associated assets (photos and videos) opens corresponding asset
  • Tapping on activity tiles without associated assets (when comment added for the album itself) doesn't do anything
  • Asset thumbnails display correctly in activity tiles when activity page is accessed from album page
  • Comments and likes are shown only for current asset when activity page is accessed from asset viewer
  • TextField is not in focus and keyboard does not appear when activity page is accessed from album view and asset viewer.

Video summary

screen-20250716-224557.mp4

Checklist:

  • I have performed a self-review of my own code
  • I have made corresponding changes to the documentation if applicable
  • I have no unrelated changes in the PR.
  • I have confirmed that any new dependencies are strictly necessary.
  • I have written tests for new code (if applicable)
  • I have followed naming conventions/patterns in the surrounding code
  • All code in src/services/ uses repositories implementations for database calls, filesystem operations, etc.
  • All code in src/repositories/ is pretty basic/simple and does not have any immich specific logic (that belongs in src/services/)

@shenlong-tanwen shenlong-tanwen changed the title Feat: open asset from activities and disable comment field autofocus feat: open asset from activities and disable comment field autofocus Jul 18, 2025
@shenlong-tanwen
Copy link
Member

@Tumist76 Apologies for not getting back earlier. I was away on a vacation last week and came back yesterday. Between the last update here and now, the app has been migrated to a new timeline which is supposed to be the one where we will be focusing our efforts on. We are reworking all the other pages to work with the new timeline backed by the SQLite database. The text field has been migrated to a new widget named DriftActivityTextField. Can you please help us make the change there as well?

We are also migrating away from using Hooks to Stateful widgets instead. If you could update the ActivityTile, It'd be much appreciated as well.

@jrasm91
Copy link
Member

jrasm91 commented Oct 8, 2025

Any update on this?

@bwees bwees changed the title feat: open asset from activities and disable comment field autofocus feat: open asset from activities Oct 12, 2025
@bwees bwees force-pushed the feat/open-asset-from-activities branch from af326e9 to b58460e Compare October 12, 2025 03:57
@bwees
Copy link
Member

bwees commented Oct 12, 2025

open assets directly from the activity page when they are mentioned in activities

I have migrated to the new timeline.

The new timeline already does not show the keyboard when opening the activity page so that has been removed.

@bwees bwees requested a review from shenlong-tanwen October 12, 2025 04:01
@bwees
Copy link
Member

bwees commented Oct 13, 2025

Before merging, this could have conflicts with #22894 if it is merged before this PR. that PR changes the signature of AssetViewer.setAsset to include a TimelineType.

@shenlong-tanwen
Copy link
Member

@bwees Can we also add back the change to disable the keyboard from automatically opening up when entering the Activities page? The PR from the author had this before the new timeline port

@bwees bwees changed the title feat: open asset from activities feat: open asset from activities and disable focusing activity text field Oct 13, 2025
@bwees
Copy link
Member

bwees commented Oct 13, 2025

@bwees Can we also add back the change to disable the keyboard from automatically opening up when entering the Activities page? The PR from the author had this before the new timeline port

Done!

@bwees bwees force-pushed the feat/open-asset-from-activities branch from fb780b8 to d766878 Compare October 14, 2025 18:26
@bwees bwees requested a review from shenlong-tanwen October 14, 2025 22:54
@shenlong-tanwen
Copy link
Member

@bwees Can you help me with the failing actions? Also, we recently merged #23075 in, this should make the pending issues from this PR easier to fix. We don't need to await and clear the current asset notifier anymore since the widgets used from the album and the asset viewer are now different.

@bwees bwees force-pushed the feat/open-asset-from-activities branch from d766878 to 5c59b5a Compare October 22, 2025 15:56
@shenlong-tanwen
Copy link
Member

The chat-styled activity refactor from #23185 handled this as as part of the other changes in it. Thanks a lot for the PR, and sorry that we had to close it. Please feel free to work on any other issues or enhancements in the app.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants