Skip to content

feat: renaming refactor, make optimistic, fixes and improvements#1311

Merged
gbirman merged 13 commits intomainfrom
gab/chore/clean-up-channel-rename-optimistic
Feb 4, 2026
Merged

feat: renaming refactor, make optimistic, fixes and improvements#1311
gbirman merged 13 commits intomainfrom
gab/chore/clean-up-channel-rename-optimistic

Conversation

@gbirman
Copy link
Copy Markdown
Contributor

@gbirman gbirman commented Feb 4, 2026

  • consolidates renaming around a SSOT rename file
  • fixes optimistic channel update operation which wasn't working
  • adds optimistic renaming across multiple queries (dss, history, preview, channels) with rollback for failed items only so that everything works in sync WITHOUT needing to do an expensive refetchResources call which triggers multiple unnecessary backend api calls if we know the PATCH operation succeeded
  • Don't show rename modal for dm since this is an invalid operation
  • fixes fall through case in itemTypeToEntityType
  • DRYs up single + bulk rename operations so that the single rename is effectively a wrapper around bulk rename

TODOs:

  • if you rename a dss item and refresh the page it'll be at the top of the list due to the updated at. this optimistic rename doesn't do that yet so it'll stay in the same position, but also it's not that a big deal and might be considered desired behavior anyways? we can consider updating this optimistically or doing some prefetch if we actually want this
  • for large bulk renames potentially we can consider adding a bulk rename endpoint on backend + batching but this isn't really a bread+butter workflow anyways
  • a bunch of other operations we have can start using these patterns

this is just a video that shows optimistic update for channel/dss item rename from both menu and top bar
https://github.com/user-attachments/assets/6da56c85-3e76-47ee-8822-34354e4072f1

not shown:

  • bulk rename, confirmed this works
  • confirmed that errors rollback correctly, even when i have some failures and some successes in a bulk rename operation

@gbirman gbirman requested a review from a team as a code owner February 4, 2026 01:35
@gbirman gbirman requested a review from synoet February 4, 2026 01:35
@github-actions
Copy link
Copy Markdown

github-actions bot commented Feb 4, 2026

@claude
Copy link
Copy Markdown
Contributor

claude bot commented Feb 4, 2026


Code review

No issues found. Checked for bugs and CLAUDE.md compliance.


case 'project':
return 'project';
default:
return 'document'; // fallback
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this was a dangerous fallback and atm item type matches entity data.type 1:1 anyways so this is a safer option + will catch type failrues in the future

@gbirman gbirman requested a review from dev-rb February 4, 2026 19:54
@gbirman gbirman changed the title fix: optimistic channel rename update feat: renaming refactor, make optimistic, fixes and improvements Feb 4, 2026
const pages = prev.pages.map((page) => ({
...page,
items: page.items.map((item) => {
// NOTE: reactivity does not seem to be a problem here so no spread is needed?
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

probably because we're calling page.items.map anyways so the items array ref changes is my guess

@gbirman gbirman merged commit faba313 into main Feb 4, 2026
21 checks passed
@gbirman gbirman deleted the gab/chore/clean-up-channel-rename-optimistic branch February 4, 2026 20:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant