Sync section collapse state across devices#27
Open
super3 wants to merge 2 commits into
Open
Conversation
The per-section collapsed/expanded map was only written to localStorage, so a different device or private tab never saw it. Persist it on the server alongside todo_markdown and adopt it during cross-device sync.
|
🚅 Deployed to the padtask-pr-27 environment in padtask
|
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.
Summary
localStorage, so a different device or private tab never saw it on refresh.collapsedSectionson the server (newcollapsed_sectionsJSONB column) alongsidetodo_markdown, push on toggle, and adopt it during cross-device sync.Changes
005_add-collapsed-sections-to-conversations.cjsadds the JSONB column with'{}'::jsonbdefault.db.js: includecollapsed_sectionsingetConversationandlistConversationsByUser; addupdateCollapsedSections(sessionId, userId, sections)with the same ownership rule asupdateTodoMarkdown.server.js: newPOST /api/collapsed-sectionsendpoint; enforces ownership viacanAccess, rejects non-object bodies.index.html: on heading click, push the updated map to the server alongside the existingsaveChats();mergeServerConversationsadopts server-sidecollapsedSectionsfor both existing and newly-discovered chats.Test plan
{}).jest(couldn't run locally due to restricted registry — please verify in CI).Generated by Claude Code