Skip to content

Diff view: flag rows past the layout limit and align the patch cap across platforms #1071

Open

Description

@ivanfenenko

Follow-up to #1061 (part of #1057), from the automated review of that pull request. Both points are low severity; neither is a regression from main.

  • Android: say when a diff is too tall to show in full. OpenCodeUnifiedDiff keeps only as many rows as fit in the largest layout height (MAX_DIFF_LAYOUT_HEIGHT / rowHeight, about 400,000 rows). Rows past that are not shown and nothing tells the user. Changes caps a patch at 1 MB, so in practice only uncapped edit details in the tool result sheet can get there. On main a diff that tall threw in layout instead. Show a truncation notice (like the 1 MB banner) or cap edit details the same way.
  • Make the 1 MB patch cap the same on both platforms. Android's UnifiedPatch counts UTF-16 characters and iOS counts UTF-8 bytes, so for non-ASCII patches the cut, and whether the "Showing the first 1 MB" banner appears, differ between the apps. Count UTF-8 bytes on Android too, without encoding the whole patch.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions