Page MenuHomePhabricator

Fix Form (EditEngine) Typeahead
AbandonedPublic

Authored by chad on Dec 17 2016, 5:35 AM.
Tags
None
Referenced Files
F13128956: D17093.diff
Wed, May 1, 12:27 AM
Unknown Object (File)
Wed, Apr 24, 10:50 AM
Unknown Object (File)
Wed, Apr 3, 11:41 PM
Unknown Object (File)
Mar 26 2024, 2:34 PM
Unknown Object (File)
Mar 11 2024, 10:28 PM
Unknown Object (File)
Feb 20 2024, 1:51 PM
Unknown Object (File)
Feb 20 2024, 6:53 AM
Unknown Object (File)
Feb 11 2024, 2:05 PM
Subscribers
Tokens
"Orange Medal" token, awarded by epriestley.

Details

Reviewers
epriestley
Summary

Not sure this is the best fix, but seems to work? Uses PHID if present, engine/key if not.

Test Plan

Use browse on typeahead, select various forms.

Diff Detail

Repository
rP Phabricator
Branch
form-typeahead (branched from master)
Lint
Lint Passed
Unit
Tests Passed
Build Status
Buildable 15003
Build 19675: Run Core Tests
Build 19674: arc lint + arc unit

Event Timeline

epriestley edited edge metadata.

I think this is the best approach, yeah -- some tweaks inline.

src/applications/transactions/typeahead/PhabricatorEditEngineDatasource.php
28

On the other side, I think you'll need to split this apart into the engine key and form key again.

If you separate them with a ., this will be ambiguous: you can not tell which engine a.b.c is:

  • Engine a.b, form c
  • Engine a, form b.c.

Since engine keys and form keys can both contain periods, it could go either way.

Instead, you could use some character which does not appear in any keys yet (maybe /) and then update PhabricatorEditEngine and PhabricatorEditEngineConfiguration to forbid this character in keys.

Specifically, in PhabricatorEditEngine->getEngineKey(), throw if the key contains a / before returning it.

Then probably implement PhabricatorEditEngineConfiguration->setBuiltinKey() and have it throw if the argument contains /, then call parent::setBuiltinKey(...) if things look good.

This revision is now accepted and ready to land.Dec 19 2016, 7:05 PM

I'll build out both at the same time and toss up a new diff.

@epriestley I don't see any great way to solve N + 1 with this query, since each query (phid, engine, key) seems unique. Should I just do one query for all forms and only attach the ones needed? Or will that cause a problem if people have 900 forms (which, at least 1 install does).

ah from PhabricatorEditEngineCreateQuickActions looks like you grab them all and pop out what u need