Skip to content

Rename oxalis references to WK #8591

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 17 commits into from
May 6, 2025
Merged

Rename oxalis references to WK #8591

merged 17 commits into from
May 6, 2025

Conversation

hotzenklotz
Copy link
Member

@hotzenklotz hotzenklotz commented Apr 30, 2025

A very simple PR. I renamed to references to Oxalis to WebKnossos:

  • OxalisState --> WebknossosState (store.ts)
  • OxalisApplication --> WebKnossosApplication (app.ts)
  • OxalisApi --> WebKnossosApi (apiHelpers.ts)

The import renaming was automatically handled by VSCode/Typescript language server intergration.

Replaced all occurances of useSelector((state: OxalisState) => ...) with useWkSelector(state => ...).

Steps to test:

  • CI linting and typechecking should be enough

Issues:


(Please delete unneeded items, merge only when none are left open)

@hotzenklotz hotzenklotz self-assigned this Apr 30, 2025
Copy link
Contributor

coderabbitai bot commented Apr 30, 2025

Important

Review skipped

More than 25% of the files skipped due to max files limit. The review is being skipped to prevent a low-quality review.

53 files out of 160 files are above the max files limit of 100. Please upgrade to Pro plan to get higher limits.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

✨ Finishing Touches
  • 📝 Generate Docstrings

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@hotzenklotz hotzenklotz changed the title Rename oxalis store Rename oxalis references to WK Apr 30, 2025
@hotzenklotz hotzenklotz mentioned this pull request Apr 30, 2025
8 tasks
@hotzenklotz hotzenklotz requested a review from philippotto April 30, 2025 14:38
@philippotto
Copy link
Member

thank you for the renaming! I think, that the OxalisState --> WebknossosState renaming will potentially cause a lot of merge conflicts. per se this is fine, but if these usages are touched anyway, I'd like to do another change first/too: ensure that useSelector is always typed with WebknossosState. so, code like this:

useSelector((state: OxalisState) => ...)

can be turned into

useSelector(state => ...)

and TS should still know that state is OxalisState/WkState (similar to how the saga function select is typed).

for this typing enhancement, all the useSelector usages have to be touched, too. however, doing this first, means that the usages only have to be changed once. if we do the renaming first and then in another pr the type change, we have touched everything twice (= twice the merge conflicts).

can you improve the typing of useSelector in this PR? (no need to undo the other change, because it's the same pr).
ideally, we would be able to simply override the type of useSelector in react-redux. however, I'm not sure whether this is possible. the alternative would be to create a wrapper à la useWkSelector, but then we have to ensure somehow that new PRs don't accidentally reintroduce the usage of useSelector. I'm not sure how that could be achieved.

@hotzenklotz
Copy link
Member Author

I applied the feedback and added a useWkSelector shorthand. (see store.ts) and replaced all usages of useSelector((state: OxalisState) => ...) with that.

Copy link
Member

@philippotto philippotto left a comment

Choose a reason for hiding this comment

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

great! there are still some useSelectors in the code base (maybe search&replace missed these because of the line break?). could you do another sweep?

@@ -137,7 +137,9 @@ function JobListView() {
const [isLoading, setIsLoading] = useState(true);
const [jobs, setJobs] = useState<APIJob[]>([]);
const [searchQuery, setSearchQuery] = useState("");
const isCurrentUserSuperUser = useSelector((state: OxalisState) => state.activeUser?.isSuperUser);
const isCurrentUserSuperUser = useSelector(
Copy link
Member

Choose a reason for hiding this comment

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

useWkSelector?

Copy link
Member Author

Choose a reason for hiding this comment

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

Good catch. I replace another batch of useSelector calls.

Copy link
Member

Choose a reason for hiding this comment

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

great, however, I think some imports are missing now (see ci output).

Copy link
Member

@philippotto philippotto left a comment

Choose a reason for hiding this comment

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

awesome 👍

@hotzenklotz hotzenklotz merged commit 176387f into master May 6, 2025
5 checks passed
@hotzenklotz hotzenklotz deleted the rename-oxalis-store branch May 6, 2025 08:29
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.

2 participants