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

Handle Zulip internal links #305

Merged
merged 8 commits into from
Oct 13, 2023
Merged

Handle Zulip internal links #305

merged 8 commits into from
Oct 13, 2023

Commits on Oct 12, 2023

  1. Configuration menu
    Copy the full SHA
    2f944a0 View commit details
    Browse the repository at this point in the history
  2. lint: Suppress constant_identifier_names in generated files

    This was preventing us from making private `JsonEnum` classes
    as the generated `EnumMap` does not follow the rule of
    being a lowerCamelCase identifier.
    
    For example, `_Foo` generates `_$_FooEnumMap` and was
    triggering an analyzer complaint.
    sirpengi committed Oct 12, 2023
    Configuration menu
    Copy the full SHA
    1cfa5dc View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    c65bab8 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    664f4a5 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    2cf1b36 View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    9a5ec69 View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    4beb7bb View commit details
    Browse the repository at this point in the history

Commits on Oct 13, 2023

  1. internal_link: Parse internal links into narrows

    The core process on parsing internal links (here in
    `lib/model/internal_link.dart`) relied heavily on the
    existing code in the Zulip mobile app - from
    `src/utils/internalLinks.js`. In fact the `_parseStreamOperand`
    function here is a line for line port in order to capture the
    same semantics when processing streams.
    
    Where the implementation differs is this new process is less
    restrictive on the order of operator/operand pairs:
    supporting `#narrow/topic/_/stream_` where mobile only
    accepted `#narrow/stream/_/topic/_`.
    
    Also, the mobile implementation accepted as valid narrows
    DM operators with an email address as the operand
    (`#narrow/dm/a.40b.2Ecom.2Ec.2Ed.2Ecom`) but created an
    invalid narrow object (with NaNs for targets) whereas this
    implementation rejects them as invalid narrows.
    
    Likewise the test cases are also taken from the mobile code
    (`src/utils/__tests__/internalLinks-test.js`) and replicated
    here, save for the special narrow types (`#narrow/is/starred`)
    which are not yet implemented. Also, the "without realm info"
    cases were removed as they were made moot with every test
    case being passed through `tryResolveOnRealmUrl` (the mobile
    cases were also passed through `new Url()` with a base).
    sirpengi committed Oct 13, 2023
    Configuration menu
    Copy the full SHA
    e3a2dcc View commit details
    Browse the repository at this point in the history