Skip to content

Conversation

@People-11
Copy link
Contributor

@People-11 People-11 commented Oct 28, 2025

Summary by Sourcery

Introduce a new 'Hide Instant Camera' setting and apply it throughout the photo attachment layout to hide the instant camera cell and preview when enabled.

New Features:

  • Add hideInstantCamera configuration option to disable the instant camera cell

Enhancements:

  • Conditionally wrap all instant camera display and preview logic in ChatAttachAlertPhotoLayout with the hideInstantCamera flag
  • Expose a Hide Instant Camera toggle in the chat settings UI with localization support

@sourcery-ai
Copy link

sourcery-ai bot commented Oct 28, 2025

Reviewer's Guide

Introduces a new "Hide Instant Camera" toggle and integrates it into the attachment gallery to suppress the instant camera cell and preview when enabled.

Entity relationship diagram for new HideInstantCamera config item

erDiagram
    NekoConfig ||--o| ConfigItem : has
    ConfigItem {
        string key
        string type
        bool defaultValue
    }
    NekoConfig {
        ConfigItem hideInstantCamera
    }
Loading

Class diagram for updated NekoConfig and settings integration

classDiagram
    class NekoConfig {
        +ConfigItem useCustomEmoji
        +ConfigItem repeatConfirm
        +ConfigItem disableInstantCamera
        +ConfigItem hideInstantCamera
        +ConfigItem showSeconds
        +ConfigItem enablePublicProxy
    }
    class NekoChatSettingsActivity {
        -AbstractConfigCell hideKeyboardOnChatScrollRow
        -AbstractConfigCell rearVideoMessagesRow
        -AbstractConfigCell disableInstantCameraRow
        -AbstractConfigCell hideInstantCameraRow
        -AbstractConfigCell disableVibrationRow
        -AbstractConfigCell disableProximityEventsRow
        -AbstractConfigCell disableTrendingRow
    }
    NekoChatSettingsActivity --> NekoConfig: uses
    NekoConfig <|-- ConfigItem
Loading

File-Level Changes

Change Details Files
Add hideInstantCamera configuration and UI toggle
  • Declared new ConfigItem hideInstantCamera in NekoConfig
  • Exposed hideInstantCamera in chat settings activity
  • Provided localization strings for HideInstantCamera in EN and ZH resource files
TMessagesProj/src/main/java/tw/nekomimi/nekogram/NekoConfig.java
TMessagesProj/src/main/java/tw/nekomimi/nekogram/settings/NekoChatSettingsActivity.java
TMessagesProj/src/main/res/values/strings_nekox.xml
TMessagesProj/src/main/res/values-zh-rCN/strings_nekox.xml
Guard camera cell and preview logic with hideInstantCamera flag
  • Wrapped needCamera checks in updateCheckedPhotos, getSpanSize, updateSelected, getItemCount, getItemViewType, onBindViewHolder and getOutline to skip the camera cell when hidden
  • Extended checkCamera and pauseCamera routines to respect hideInstantCamera before invoking showCamera
  • Adjusted checkCameraViewPosition to omit camera outline updates under hideInstantCamera
TMessagesProj/src/main/java/org/telegram/ui/Components/ChatAttachAlertPhotoLayout.java

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

Copy link

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

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

Hey there - I've reviewed your changes and they look great!

Prompt for AI Agents
Please address the comments from this code review:

## Individual Comments

### Comment 1
<location> `TMessagesProj/src/main/java/org/telegram/ui/Components/ChatAttachAlertPhotoLayout.java:2391` </location>
<code_context>
             adapter.notifyDataSetChanged();
         }
-        if (!parentAlert.destroyed && parentAlert.isShowing() && deviceHasGoodCamera && parentAlert.getBackDrawable().getAlpha() != 0 && !cameraOpened && !NekoConfig.disableInstantCamera.Bool()) {
+        if (!parentAlert.destroyed && parentAlert.isShowing() && deviceHasGoodCamera && parentAlert.getBackDrawable().getAlpha() != 0 && !cameraOpened && !NekoConfig.disableInstantCamera.Bool() && !NekoConfig.hideInstantCamera.Bool()) {
             showCamera();
         }
</code_context>

<issue_to_address>
**question:** Potential for conflicting config flags: disable vs hide instant camera.

Please clarify or document the expected behavior when both flags are set, or enforce mutual exclusivity if that matches the intended logic.
</issue_to_address>

### Comment 2
<location> `TMessagesProj/src/main/java/tw/nekomimi/nekogram/NekoConfig.java:52` </location>
<code_context>
     public static ConfigItem useCustomEmoji = addConfig("useCustomEmoji", configTypeBool, false);
     public static ConfigItem repeatConfirm = addConfig("repeatConfirm", configTypeBool, false);
     public static ConfigItem disableInstantCamera = addConfig("DisableInstantCamera", configTypeBool, false);
+    public static ConfigItem hideInstantCamera = addConfig("HideInstantCamera", configTypeBool, false);
     public static ConfigItem showSeconds = addConfig("showSeconds", configTypeBool, false);

</code_context>

<issue_to_address>
**nitpick:** Config key naming is inconsistent with other keys.

Please update "HideInstantCamera" to match the naming style of other config keys for consistency.
</issue_to_address>

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

@omg-xtao omg-xtao changed the base branch from main to dev October 28, 2025 09:12
Co-authored-by: People-11 <41558215+People-11@users.noreply.github.com>
@omg-xtao omg-xtao merged commit cccfaa8 into NextAlone:dev Oct 28, 2025
2 of 5 checks passed
@omg-xtao omg-xtao added the enhancement New feature or request label Oct 28, 2025
BraveSail added a commit to BraveSail/Nagram that referenced this pull request Oct 31, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants