Summary: Tokens should be deletable. If you press delete it should prioritize deleting the entered text, but if there is none, then it can delete the previous token entirely
Reviewed By: quark-zju
Differential Revision: D45627741
fbshipit-source-id: f89fb86551fd757749dd71d77ca21901f4e91043
Summary:
Small thing, I noticed if result load and then you press more keys, it would show the loading spinner again briefly before the next results load.
It's much smoother if we only show the loading spinner before any results load
Reviewed By: quark-zju
Differential Revision: D45627734
fbshipit-source-id: 4cc5c049f158749dac81a3b12cab7cf94599ba75
Summary: You should be able to arrow key up/down through typeahead results, and later click or press enter to add them. This diff just adds the selection UI but not confirming.
Reviewed By: quark-zju
Differential Revision: D45627731
fbshipit-source-id: 1b06b362ed340fdbadf8f78b6841eda9ec08a53d
Summary: The old ISL only showed usernames, but it's a nice touch to show avatars as well. We get them "For free" in our query!
Reviewed By: quark-zju
Differential Revision: D45627733
fbshipit-source-id: 95958954f303879209ce511e139cfad09cbdf6d1
Summary: Making the API that each code review provider can use to define how to do their fields' autocomplete.
Reviewed By: quark-zju
Differential Revision: D45627738
fbshipit-source-id: 5e98a385164b614437b3eeb7fe5c12659ddfcde0
Summary: Hook up our typeahead fetch function to send a message to the server. This is where we'll be able to actually do our fetches.
Reviewed By: quark-zju
Differential Revision: D45627740
fbshipit-source-id: d5426b84fb420f06e72e6f6f583577f63b1242d5
Summary:
"autocomplete" means a single *inline* suggestion, like ios / github copilot / gmail
"typeahead" means a dropdown list with several results as you type, which is what we want
Reviewed By: quark-zju
Differential Revision: D45627729
fbshipit-source-id: 76ac37116db7ccf3d0e584861163ab9d9e6e25d5
Summary:
We want to show a typeahead/autocomplete while you're typing reviewers / subscribers / tasks/ etc. This will need to fetch data and show a list of values, then let you accept the results.
To make this nicer, we also want to show the values as tokens, instead of just text. These visual tokens distinguishes values from each other, and lets you click on the x to dismiss them more easily.
This is just the first steps in building this UX. Remaining in further commits, we need to actually fetch the right data depending on the type of field, handle the data, insert suggestions, let you delete suggestions, and deal with focus / other subtleties.
Reviewed By: quark-zju
Differential Revision: D45627742
fbshipit-source-id: d9133c04291bf6165bdf4b7efc6c22330ef68afe
Summary: Create a new field component for one-line fields which have typeahead support. This differs from the previous implementation, which was a multi-line thing
Reviewed By: quark-zju
Differential Revision: D45627739
fbshipit-source-id: 38294ac965ca2ec4e07b7aa23141e833b11c9951
Summary:
Re-implement the xrepo lookup as a namespace to map xrepo commits to local commits, and an autopull predicate to pull the translated commit.
There are a couple subtle concerns:
1. We don't want to trigger any xrepo work for normal cases such autopulling a normal commit. To achieve that, made it possible to defer the generation of an autopull attempt. This way, the xrepo autopull can cancel itself if the revision in question was successfully pulled by a higher priority autopull predicate.
2. We don't to trigger an xrepo query in `repo["deadbeef"]` (i.e. in commitctx.__init__). This could have surprising performance implications. To achieve this, we only do the xrepo translation during the autopull step. Later, the namespace lookup will only use the cached translation result.
I also moved the behavior into an extension to separate it better.
Reviewed By: quark-zju
Differential Revision: D45537964
fbshipit-source-id: 602db5218c618132672c708edabf366615646600
Summary: This test was flaky since a long time ago we made some changes to `drawdag`, which this diff fixes
Reviewed By: zzl0
Differential Revision: D45442022
fbshipit-source-id: 5a36a70f985d81c42f822f9933e0dc43d87cb591
Summary: I use these commands often but they don't have autocompletion.
Reviewed By: zzl0
Differential Revision: D45659357
fbshipit-source-id: 6f55324116cda45e159426f463974df175f9b25e
Summary:
strager pointed out the URL has `%2B` in it (so curl writes the file with the
`%2B` name) and the file name below uses `+`. Use `-o` with the desired file
names to avoid issues.
Reviewed By: muirdm
Differential Revision: D45620202
fbshipit-source-id: 27c9247fada2b702888d9f888c8e80c9e3e29a8d
Summary: There's nothing unix-specific about these tests, so enable them on Windows.
Reviewed By: genevievehelsel
Differential Revision: D45586168
fbshipit-source-id: 5acbcbe81c5c03b16e43fc561762dbafb47696b8
Summary:
If a user relies on an environment variable in their invocation of edenfsctl,
e.g. `--config-dir=$EDEN_DEV_STATE`, then if the user accidentally leaves the
variable unset they may inadvertently specify an empty string as the path to
their config dir.
When running `edenfsctl stop`, the effect of an empty config dir path is to
shut down your main eden daemon instead of your dev daemon, so this has proven
a bit of a footgun.
Reviewed By: xavierd
Differential Revision: D45591968
fbshipit-source-id: 6df6eb8c05d94dafcaee1d6976a52310454a42d4
Summary:
Add some test cases making sure changing cwd resets states properly. I can definitely imagine edge cases here so this will be a good place for future tests as well.
Note that I had to invert the nesting of <Tooltip> and <VSCodeRadio> to make the test mocks happier, it doesn't really affect much.
Reviewed By: quark-zju
Differential Revision: D45615005
fbshipit-source-id: e1398aa8e5918c42115f4562dfba946d095ee49f
Summary:
I noticed we had a million "possible EventEmitter memory leak detected. 11 listeners added" warnings in our tests, even though we disposed our event emitters correctly. That's because we legitimately had more than 10 subscribers to our cwd changing, which seems like way too low a limit.
I think it's better to just implement this "onChangeCwd" ourselves. This also may help us remove the eventemitter polyfill from the client side (it's actually a node thing, so webpack must be polyfilling it for us when we import it from events)
Reviewed By: quark-zju
Differential Revision: D45610780
fbshipit-source-id: e4fd994db4628975766b2faac2efc2b61009d004
Summary:
Some atoms in ISL should clear their state back to the default when the repository is changed. For example, the list of previous and queued operations. If your active repo is now a different repo, those operations aren't really comparable. So it's better for us to just hide them.
Here we introduce an atom that makes it easy to declaratively reset your atom state on repo change.
Reviewed By: quark-zju
Differential Revision: D45593018
fbshipit-source-id: ad3dd0eff875d54b1083d63ab8197a88e68a8f80
Summary:
After the last diff, we now support changing your active repo/cwd.
This requires the client to forget most of its state—in a new repo, none of this would apply. This could have been quite difficult, but we were already basically set up to support this via serverApi.onConnectOrReconnect. A slight superset of this is the new serverApi.onSetup, which handles connect/reconnect, but also handles changes to the cwd/repo.
All our atoms which depend on server state will then automatically re-send their init message, which will then get a response pretty quickly with new info.
This seems to work well in my testing, though it's possible that for there to be some subtle bugs here.
Need to dig in a big to look for anything that might not be getting invalidated. For example, the last run command in the progress thing at the bottom does not get cleared when changing repos. Kind of a tradeoff here, because we'll lose your history of commands since it's not persisted anywhere. That's probably ok though, better have it consistent.
Reviewed By: quark-zju
Differential Revision: D45592101
fbshipit-source-id: 609a1cea64034175514764f39429cf711a491939
Summary:
Now that we show a dropdown selector to change your repo, start handling the changeCwd message to actually update your repo.
This requires some slight restructuring. Instead of getting the repository reference in onClientConnection, we have ServerToClientApi know how to make repo references.
This is a slight inversion of control, but since we need repository reference creation to happen in response to messages from the client, it kind of makes sense to do it in ServerToClientAPI.
Reviewed By: quark-zju
Differential Revision: D45592197
fbshipit-source-id: cdc5f6ef63e608998b0e6483cf2b4454bce5065e
Summary:
Some platforms, like vscode, will allow you to change your cwd/repository among several options. In vscode, you may have multiple workspace folders. Each one should allow you to change your active directory.
We need to surface this list of options, based on vscode's mounted workspace folders, so you can click them to change the current repo.
This process will differ for each platform, although the UI can probably remain similar between them. So we hook this UI state up with platform-specific messages shared between client&server.
Reviewed By: quark-zju
Differential Revision: D45592198
fbshipit-source-id: 35a261370bc13f9feead3bbe9971f473c8701d13
Summary: Do not hard-fail when edenrc is corrupted
Reviewed By: xavierd
Differential Revision: D45550209
fbshipit-source-id: 88b5e7249a7da2ef4c6df69a4c65f08b7832d8d2
Summary:
After a takeover, the new socket was initialized with a "remote
EventBase", causing stopAccepting to be asynchronous, tripping an
assertion.
There was a latent bug here: it might have been possible for a new
connection to be accepted by the old process after takeover begun.
Reviewed By: xavierd
Differential Revision: D45584154
fbshipit-source-id: cdd8118d82100bc1e19f6f19676cc2fa412b8775
Summary:
Address comments in D45358289. By using `useSetRecoilState` it sounds like it
might avoid re-renders sometimes.
Reviewed By: muirdm
Differential Revision: D45595856
fbshipit-source-id: 74c9f2d42af81736cab564189684717a237875e1
Summary:
Update the tooltip to include what operation is done at what commit(s).
This is done by changing the operation description from a string to a
structure, then providing a function to render it.
The i18n part feels a bit repetitive and a bit annoying - initially I'd
like to include text like "$commit and $n dependencies" but "1 dependency"
is annoying. In the future, maybe we can try using turning-complete code
(instead of static string mapping with replacements) to implement i18n.
I learned this way of i18n from https://github.com/Yidadaa/ChatGPT-Next-Web/tree/main/app/locales
I initially thought that maybe it's okay to store `ReactElement` in the
`history` state. But ChatGPT says that is not recommended. While in our
case it seems our `ReactElement` would be pure and maybe okay to store,
I took the advice and made `history` decoupled from `ReactElement`.
Reviewed By: muirdm
Differential Revision: D45595855
fbshipit-source-id: 1470f911c14e0de3f8fe05dd8dacadbad0c7ce72
Summary:
The offset information is useful. For example, to test if the reoder is a no-op
quickly, or generate a descriptive message about the operation like
"move x down by n commits".
Reviewed By: muirdm
Differential Revision: D45595854
fbshipit-source-id: 9fc98ba1f71b3d18705ed94df7b0969ebc2d9133
Summary: This is no longer used in favor of Rust locking.
Reviewed By: quark-zju
Differential Revision: D41998651
fbshipit-source-id: 8cadbe737ef064ac64b41bae1389b2123ef672b3
Summary: This is no longer used since we rely solely on Rust repo locks.
Reviewed By: quark-zju
Differential Revision: D41998654
fbshipit-source-id: 0f955821add1cf10f3220abf70238343fc5c9f8e
Summary: The force release behavior is broken, and may no longer be necessary. It is broken because it unlocks by deleting the legacy compatibility lock file, which is not load bearing for locking anymore. It could be updated to delete the right lock files, but I don't think that is necessary since locks on all platforms are released automatically when the locking process exits.
Reviewed By: quark-zju
Differential Revision: D41998655
fbshipit-source-id: f3833e07668d108b7a2464dd272a03c76379f32b
Summary: This was only used by the "debuglocks" command. Instead, make it get the lock information from the LockHeld exception. This is a better approach since it is "atomic" with regard to the corresponding lock contention (i.e. there is no race condition going to read the lock contents when they might have changed since the lock contention).
Reviewed By: quark-zju
Differential Revision: D41998653
fbshipit-source-id: 3c80b2321a97b052025ef1f316defce3177c60ef
Summary: Now that everything is using the rust_only locking mode, revert back to having a single "lock" class, but with the rustlock guts.
Reviewed By: quark-zju
Differential Revision: D41998650
fbshipit-source-id: f216df93e3758597c3df7e8c434bebcc8c64160d
Summary:
Hook things up so the Python repo.lock() and repo.wlock() functions delegate to the Rust repo's RepoLocker object. This way, repo locks that Python acquires are re-entrant across calls into the Rust workingcopy.
In particular, this fixes a deadlock when calling into the Rust status code since the status code needs to acquire the wlock to update the treestate.
I tweaked the out-of-order lock detection to allow the wlock to be released before the store lock if the wlock had been acquired out-of-order via a no-wait/non-blocking acquisition. The Python status code does `repo.wlock(wait=False)` in a best effort attempt to update the dirstate. The store lock may already be held, so in this case they locks are acquired out of order, and released out of order (but there is no risk of deadlock, so it is okay).
In general I've taken a conservative approach to maintain all the existing Python logic, such as acquire/release callbacks, warnings, shared wlock acquisition, etc. I considered a more aggressive change where we push more into Rust, but we can do that later.
Reviewed By: sggutier
Differential Revision: D45510005
fbshipit-source-id: 178b2213db7e6ec57c3e59c66ca3e21d27674cbf