Skip to content
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

Make clicks in assembly view open the memory editor #1862

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

mziab
Copy link
Contributor

@mziab mziab commented Feb 18, 2025

This changes the behavior when clicking highlighted offsets in the assembly view. We open a memory editor if there was none to avoid some possible user confusion as to why the buttons do nothing. The new behavior is also consistent with how the context menu "Go to in memory editor" actions work.

Copy link
Contributor

coderabbitai bot commented Feb 18, 2025

Walkthrough

The changes update the jumpToMemory method in the PCSX::Widgets::Assembly class to always display the memory editor. The default value of the forceShowEditor parameter has been switched from false to true in both the header and source files. Additionally, the OfB and Offset methods in the source file now explicitly pass true to ensure the memory editor is shown when these methods are invoked.

Changes

Files Change Summary
src/gui/widgets/assembly.cc and src/gui/widgets/assembly.h Changed default parameter of jumpToMemory from false to true; updated calls in OfB and Offset to pass true.

Sequence Diagram(s)

sequenceDiagram
    participant W as Assembly Widget
    participant J as jumpToMemory
    participant E as Memory Editor
    W->>J: jumpToMemory(addr, size, editorIndex, forceShowEditor=true)
    J->>E: Open Memory Editor
Loading

Poem

I’m a hopping rabbit in the code garden,
Skipping through functions without pardon.
The memory editor now shines bright and true,
Each jump unveils its sparkling view!
Happy bytes and bunny leaps for you!


📜 Recent review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between f04e32c and 2473d7e.

📒 Files selected for processing (2)
  • src/gui/widgets/assembly.cc (3 hunks)
  • src/gui/widgets/assembly.h (1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (1)
  • GitHub Check: Codacy Static Code Analysis
🔇 Additional comments (4)
src/gui/widgets/assembly.h (1)

72-72: LGTM! Parameter default value change aligns with PR objectives.

The change to make forceShowEditor default to true ensures consistent behavior when clicking highlighted offsets in the assembly view.

src/gui/widgets/assembly.cc (3)

329-331: LGTM! Implementation matches header declaration.

The default value change in the implementation matches the header file declaration, maintaining consistency.


378-378: LGTM! Consistent behavior in OfB method.

Explicitly passing true to jumpToMemory ensures consistent behavior when clicking offset buttons.


439-439: LGTM! Consistent behavior in Offset method.

Explicitly passing true to jumpToMemory ensures consistent behavior when clicking offset buttons.

✨ Finishing Touches
  • 📝 Generate Docstrings (Beta)

Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

❤️ 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.

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. (Beta)
  • @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.

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.

@nicolasnoble
Copy link
Member

I need to think about this one a bit more.

@mziab
Copy link
Contributor Author

mziab commented Feb 19, 2025

Is there a scenario in which we don't want a memory editor to open (if it wasn't already) when clicking an offset? Maybe the whole forceShowEditor argument isn't actually needed?

I assume this was done on purpose, but it feels weird that the context menu actions open a memory editor while clicking the offsets doesn't.

Alternatively, since I changed the default value for forceShowEditor, I could just omit the third argument in jumpToMemory calls.

@nicolasnoble
Copy link
Member

Right, I think we should just omit the whole thing really, and just systematically open. We can always re-introduce it later if we realize some UX would benefit from not always opening, but it's fine to clean up now.

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