Repository navigation
Conversation
The timelines tag dropdown listed a tag once per timeline using it, and its form submits slug[] while the controller only read tag=, so applying a filter just reloaded the unfiltered page. List each tag once and read slug[] (still accepting tag=). ContentController de-duplicated matching tags before collecting page ids, so filtering by a tag shared by several pages only kept the first page. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01RVaA9WvxUAj4b89GA9DRb4
Content pages, timelines, documents and folders each had their own copy of the tag filter, and the copies had drifted: different param names, different de-duplication, and per-document queries on documents and folders. They now all use PageTagFilter through FiltersByPageTags, and the tags menu and "Filtered by" chips are shared partials. - One param, ?tag[]=…; single ?tag= and older ?slug[]= links still work. Sorting, paging and "see all" links keep the selection. - Filtering a relation stays in SQL, so documents can be filtered by tag and status together (that combination used to raise). - Saving tags is HasPageTags#update_tags instead of three controller copies. Creating a page no longer needs an empty field[value], and saving a timeline without tags no longer clears them. - The timelines sort menu now sorts. - Removed three partials nothing rendered. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01RVaA9WvxUAj4b89GA9DRb4
|
🚅 Deployed to the notebook-pr-1520 environment in Notebook.ai Feature Review
|
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
User-facing changes
Implementation notes
slug[]while its controller readtag), de-duplicated differently, and documents/folders calledpluckinside the per-document loop, so one query per document.PageTagFilter(app/services/page_tag_filter.rb) holds the filtering logic. It lists each tag once by slug and keeps pages with any chosen tag (the existing behaviour). A relation stays a relation and is filtered with a SQL subquery; an array is filtered in Ruby. Keeping documents as a relation is what fixes the tag + status error, which came from calling.whereon an Array.FiltersByPageTags(controller concern) gives each controller a one-linefilter_by_page_tags(pages, page_type:)and sets@page_tags/@filtered_page_tagsfor the views.PageTagsHelper#selected_tag_slugs/#tag_filter_paramsare view helpers, so partials rendered by controllers without the concern (e.g.books/indexrenders the universe reminder) still work. The canonical param is?tag[]=…. A single?tag=…and the older?slug[]=…are still accepted.HasPageTags#update_tagsreplaces three copies ofupdate_page_tags(content, timelines, documents), which resolves the old TODO. It takes an array or the delimited string tag fields submit, and removes with onedestroy_all.where(user:).or(where(universe_id: contributable))) instead of adding two arrays together. It filters, then sorts insort_timelines. The unused pagination ivars are gone.@linkables_rawarray withselect!when filtering by tag or favourites.page_tags/_filter_menuandpage_tags/_selected_filters. The chip's remove control was a<button>inside an<a>, which isn't valid HTML; it's now just the link.content/components/_list_filter_bar,content/list/_dense_cardsandcontent/list/_document_table. Their paths,update_page_tagsandpage_tag_paramsare added toRetiredCodeTest::RETIRED.Testing
test/services/page_tag_filter_test.rb: de-duplication, matching any tag, relation vs array input, ordered relations.test/models/has_page_tags_test.rb: adding, removing, the delimited-string input, blanks and repeats.test/controllers/timeline_index_tag_filter_test.rb: tags listed once, filtering, chip links, old URL forms, sorting, and saving a timeline without tags.test/controllers/index_tag_filter_test.rb: characters (filtering and pagination links), documents (tag + status, tag menu), folders, and creating a page with no tag field.ParameterMissing.CI=true bin/rails testgave 898 tests, 0 failures, 1 skip. That includestest/smoke; the smoke, lint and tag tests were re-run after the last view tweak.bundle exec rspec spec: 14 examples, 0 failures.Generated by Claude Code