Skip to content

Improve Views UX part 2: time_diff, fields, and storage optimization#24

Merged
jjroelofs merged 3 commits into1.xfrom
feature/views-ux-part2
Jan 28, 2026
Merged

Improve Views UX part 2: time_diff, fields, and storage optimization#24
jjroelofs merged 3 commits into1.xfrom
feature/views-ux-part2

Conversation

@jjroelofs
Copy link
Copy Markdown
Contributor

Summary

Follow-up to #23 (Improve Views UX). This PR adds additional view enhancements and storage optimization:

View improvements:

  • Add hook_update_8003 for view enhancements
  • Add analyzed_timestamp field with "time ago" format
  • Add created field with time_diff enabled
  • Enable time_diff on changed field (shows relative time like "2 days ago")
  • Add content type exposed filter
  • Change default sort from created to changed
  • Standardize field ordering: title → sentiments_id → score → analyzed_timestamp → type → changed → created → uid
  • Add user module dependency and user.permissions cache context
  • Clean up filters and remember_roles

Storage optimization:

  • Refactor SentimentsStorageService::saveScores() to use merge/upsert pattern
  • Prevents duplicate records and race conditions
  • More efficient than delete+insert approach

Test plan

  • Run drush updb to apply update hook 8003
  • Run drush cr to rebuild caches
  • Verify "Last analyzed" shows relative time (e.g., "2 weeks ago")
  • Verify "Last edited" and "Created" show relative time with tooltip
  • Verify content type filter appears
  • Verify field order matches expected
  • Test analyzing same content twice - should update existing record, not create duplicate

Jurriaan Roelofs added 3 commits January 28, 2026 12:34
- Add hook_update_8003 for view enhancements
- Add analyzed_timestamp field with time ago format
- Add created field with time_diff enabled
- Enable time_diff on changed field (shows relative time)
- Add content type filter
- Change default sort from created to changed
- Standardize field ordering across views
- Refactor SentimentsStorageService to use merge/upsert pattern
- Add user module dependency and user.permissions cache context
- Clean up filters and remember_roles

Follow-up to #23 (Improve Views UX)
@jjroelofs jjroelofs merged commit 7b73721 into 1.x Jan 28, 2026
2 checks passed
@jjroelofs jjroelofs deleted the feature/views-ux-part2 branch January 28, 2026 12:58
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.

1 participant