Skip to content

fix: track original message for quick-complete, not bot reply#11

Merged
devonjones merged 1 commit intomainfrom
fix/quick-complete-original-message
Jan 15, 2026
Merged

fix: track original message for quick-complete, not bot reply#11
devonjones merged 1 commit intomainfrom
fix/quick-complete-original-message

Conversation

@devonjones
Copy link
Copy Markdown
Owner

Fixes the UX for quick-complete feature - users now click ✅ on their own message (where the bot already added the reaction) instead of on the bot's reply.

Changes:

  • Track original user message ID instead of bot reply message ID
  • Remove restriction that reactions must only be on bot messages
  • Simplified logic - no need to fetch message references
  • Only allow message author to quick-complete their own captures

UX improvement: More intuitive - click the checkmark that's already on your message.

Users expect to click the ✅ that's already on their original message
(which the bot adds), not on the bot's confirmation reply.

Changes:
- Track original user message ID instead of bot reply message ID
- Remove restriction that reactions must be on bot messages
- Simplified logic - no need to fetch referenced message
- Only allow message author to quick-complete their own captures

UX improvement: More intuitive - click the check on your message.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
@gemini-code-assist
Copy link
Copy Markdown

Summary of Changes

Hello @devonjones, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request refines the user experience for the quick-complete feature by shifting the interaction point from the bot's confirmation message to the user's original message. This change streamlines the process, making it more natural for users to complete their captures by reacting to their own content. It also simplifies the underlying code by removing unnecessary message reference lookups and clarifies permissions by ensuring only the message author can trigger a quick-complete.

Highlights

  • Improved Quick-Complete UX: Users can now quick-complete a capture by reacting with '✅' directly on their original message, rather than on the bot's reply message. This makes the interaction more intuitive.
  • Tracking Original Message ID: The system now tracks the ID of the original user message for quick-complete functionality, instead of the bot's reply message ID.
  • Relaxed Reaction Restrictions: The previous restriction that reactions must only be on bot messages has been removed for quick-complete actions, allowing reactions on user messages.
  • Simplified Logic: The logic for handling quick-complete has been simplified by removing the need to fetch message references, as the reaction is now on the original message itself.
  • Author-Only Quick-Complete: The quick-complete feature is now strictly enforced to only allow the original author of the message to complete their own captures.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@devonjones devonjones merged commit 1076ba9 into main Jan 15, 2026
1 check passed
@devonjones devonjones deleted the fix/quick-complete-original-message branch January 15, 2026 22:28
Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request improves the user experience for the quick-complete feature by tracking the original user message instead of the bot's reply. The changes simplify the logic, remove the need to fetch message references, and enhance code clarity. The implementation is solid and correctly achieves its goal. I have one suggestion to further improve the robustness of the reaction handling logic by making an implicit assumption explicit.

Comment on lines 839 to 861
if entry_id:
# Only handle ✅ for quick-complete on capture messages
if emoji != "✅":
logger.debug(f"Ignoring {emoji} on capture message (only ✅ supported)")
return

# Get the original message to verify the user is the author
try:
# The capture confirmation is a reply, so we can get the referenced message
if not reaction.message.reference or not reaction.message.reference.message_id:
logger.warning(f"Capture message {message_id} has no reference to original")
return

original_message = await reaction.message.channel.fetch_message(
reaction.message.reference.message_id
# Only allow the original message author to quick-complete
if user.id != reaction.message.author.id:
logger.debug(
f"User {user} tried to complete entry {entry_id} but is not original author"
)
return

# Only allow the original author to quick-complete
if user.id != original_message.author.id:
logger.debug(
f"User {user} tried to complete entry {entry_id} but is not original author"
)
return

logger.info(
f"Quick-complete: {user} archiving entry {entry_id} (message {message_id})"
)
logger.info(
f"Quick-complete: {user} archiving entry {entry_id} (message {message_id})"
)

try:
# Archive the entry using shared handler
await self.handle_archive_entry(reaction, user, entry_id, source="capture")

except discord.NotFound:
logger.warning(f"Could not find original message for capture confirmation {message_id}")
except Exception as e:
logger.error(f"Error handling quick-complete: {e}", exc_info=True)
ERRORS.labels(service="reflex", error_type="reaction_handler").inc()
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

For improved robustness, it would be beneficial to add a guard clause here to ensure that messages being processed as 'captures' are not from the bot itself. While other parts of the code currently prevent bot message IDs from being added to capture_message_to_entry, making this assumption explicit within this handler makes the function more self-contained and resilient to future changes. This also makes the separation of concerns between handling digest reactions (on bot messages) and capture reactions (on user messages) clearer.

        if entry_id:
            # This logic is for user messages. A bot message should not be in capture tracking.
            if reaction.message.author == self.user:
                logger.warning(f"Bot message {message_id} incorrectly found in capture tracking.")
                return

            # Only handle ✅ for quick-complete on capture messages
            if emoji != "✅":
                logger.debug(f"Ignoring {emoji} on capture message (only ✅ supported)")
                return

            # Only allow the original message author to quick-complete
            if user.id != reaction.message.author.id:
                logger.debug(
                    f"User {user} tried to complete entry {entry_id} but is not original author"
                )
                return

            logger.info(
                f"Quick-complete: {user} archiving entry {entry_id} (message {message_id})"
            )

            try:
                # Archive the entry using shared handler
                await self.handle_archive_entry(reaction, user, entry_id, source="capture")
            except Exception as e:
                logger.error(f"Error handling quick-complete: {e}", exc_info=True)
                ERRORS.labels(service="reflex", error_type="reaction_handler").inc()

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.

1 participant