Skip to content

Fix scope migration: public root properties, private presets, link-shared views - #369

Closed
felixevers wants to merge 1 commit into
mainfrom
claude/cool-heisenberg-e5romq
Closed

felixevers wants to merge 1 commit into
mainfrom
claude/cool-heisenberg-e5romq

Conversation

@felixevers

Copy link
Copy Markdown
Member

Summary

Follow-up to #359. The add_scope_visibility migration now maps existing rows the way the product expects:

  • Property definitions without a scope become public and are stored at the root location (the root with the largest subtree, so multi-root databases pick the main tree deterministically). Definitions that already had a node keep it and become public.
  • Task presets all become private with no location (previously ownerless presets were made public on the root).
  • Saved views that were link_shared keep a new link-only visibility SHARED and keep their node (or get the root if they had none). Everything else becomes private. Previously every view was forced to private and lost its node, which broke link sharing.

To make that possible, ScopeVisibility gains SHARED:

  • Backend: shared rows are readable by id inside the node's scope (can_read_scoped) but never appear in list queries for non-owners; SHARED is only accepted for saved views (presets and property definitions reject it with BAD_REQUEST). Downgrade maps shared/public views back to link_shared.
  • Frontend: the view save/edit dialogs get a private / shared via link / public select; presets and properties keep the public checkbox. ScopeChip renders the shared state; translations added for all six locales; GraphQL types and the translation module regenerated.
  • Docs updated in docs/VIEWS_ARCHITECTURE.md.

Validation

  • Full Alembic chain run on Postgres 16 with seeded legacy rows (legacy/scoped definitions, link_shared views with and without a node, private view, GLOBAL ownerless and PERSONAL presets): upgrade, downgrade and re-upgrade produce the mapping described above.
  • Exported Strawberry schema matches schema.graphql.
  • ruff check backend --exclude database/migrations: clean.
  • pytest tests/unit tests/integration (with Redis): 143 passed. Three new integration tests cover shared views.
  • npm run lint, npm run check-translations, npm run test: clean, 153 tests passed.

🤖 Generated with Claude Code

https://claude.ai/code/session_01UpemKsko6UowS3SmrN4TdQ


Generated by Claude Code

Existing property definitions become public on the root location,
existing task presets become private and formerly link-shared saved
views keep a link-only SHARED visibility instead of turning private.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01UpemKsko6UowS3SmrN4TdQ
@felixevers felixevers closed this Sep 15, 2026
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.

2 participants