summaryrefslogtreecommitdiff
path: root/Userland/Applications/Assistant
AgeCommit message (Collapse)Author
2022-06-03Applications: Use spawn_or_show_error() for common spawn patternMacDue
2022-04-20AK: Add FuzzyMatch headerfaxe1008
This patch adds a header containing the fuzzy match algorithm previously used in Assistant. The algorithm was moved to AK since there are many places where a search may benefit from fuzzyness.
2022-04-18Userland: Always construct Application with try_create()Sam Atkins
2022-04-03Applications: Use default execpromises parameter to `pledge(..)`Brian Gianforcaro
2022-04-01Everywhere: Run clang-formatIdan Horowitz
2022-02-25Assistant+CommandPalette: Use FrameShape::Window for main widgetsthankyouverycool
2022-02-09Applications: Port Assistant to LibMainLenny Maiorani
2022-01-22LibJS: Refactor interpreter to use Script and Source Text ModulesLuke Wilde
This also refactors interpreter creation to follow InitializeHostDefinedRealm, but I couldn't fit it in the title :^) This allows us to follow the spec much more closely rather than being completely ad-hoc with just the parse node instead of having all the surrounding data such as the realm of the parse node. The interpreter creation refactor creates the global execution context once and doesn't take it off the stack. This allows LibWeb to take the global execution context and manually handle it, following the HTML spec. The HTML spec calls this the "realm execution context" of the environment settings object. It also allows us to specify the globalThis type, as it can be different from the global object type. For example, on the web, Window global objects use a WindowProxy global this value to enforce the same origin policy on operations like [[GetOwnProperty]]. Finally, it allows us to directly call Program::execute in perform_eval and perform_shadow_realm_eval as this moves global_declaration_instantiation into Interpreter::run (ScriptEvaluation) as per the spec. Note that this doesn't evalulate Source Text Modules yet or refactor the bytecode interpreter, that's work for future us :^) This patch was originally build by Luke for the environment settings object change but was also needed for modules. So I (davidot) have modified it with the new completion changes and setup for that. Co-authored-by: davidot <davidot@serenityos.org>
2022-01-15Assistant: Fix crash in FileProvider background thread upon exitRummskartoffel
If the Threading::BackgroundAction for filesystem indexing in FileProvider hadn't finished by the time the main thread exited, it would still try to access the FileProvider object that lived in the main thread, thereby causing a segfault and crashing. This commit prevents FileProvider from being destroyed while the background thread is still running by giving the background thread a strong reference to its FileProvider.
2022-01-15Assistant: Make Provider ref-countedRummskartoffel
2022-01-08LibJS: Convert Interpreter::run() to ThrowCompletionOr<Value>Linus Groh
Instead of making it a void function, checking for an exception, and then receiving the relevant result via VM::last_value(), we can consolidate all of this by using completions. This allows us to remove more uses of VM::exception(), and all uses of VM::last_value().
2021-12-30Userland: Link directly against LibUnicodeData where neededTimothy Flynn
This is partially a revert of commits: 10a8b6d4116c6a627a6c189154af032f69b29c21 561b67a1add82538502ef2f5733f1d86718898ad Rather than adding the prot_exec pledge requried to use dlopen(), we can link directly against LibUnicodeData in applications that we know need that library. This might make the dlopen() dance a bit unnecessary. The same purpose might now be fulfilled with weak symbols. That can be revisted next, but for now, this at least removes the potential security risk of apps like the Browser having prot_exec privileges.
2021-12-21Userland: Add unveil/pledge requisites for dynamic Unicode data loadingTimothy Flynn
Loading libunicodedata.so will require dlopen(), which in turn requires mmap(). The 'prot_exec' pledge is needed for this. Further, the .so itself must be unveiled for reading. The "real" path is unveiled (libunicodedata.so.serenity) as the symlink (libunicodedata.so) itself cannot be unveiled.
2021-12-05Userland: Cast unused BackgroundAction::construct() results to voidSam Atkins
User code does not need to keep this alive, so casting to void is safe. But maybe a bit weird.
2021-11-02Applications: Fix visibility of Object-derivative constructorsBen Wiederhake
Derivatives of Core::Object should be constructed through ClassName::construct(), to avoid handling ref-counted objects with refcount zero. Fixing the visibility means that misuses like this are more difficult.
2021-11-02LibThreading: Remove redundant methodBen Wiederhake
2021-10-25Assistant: Fix adding sequential bonus in Fuzzy MatchKarol Kosek
It was comparing if they both had the same index position (which was always false).
2021-10-25Assistant: Save match all match points in Fuzzy MatchKarol Kosek
From what I think, the array should consist of point indexes that have been matched instead of just the last one. For example, these are the array contents after searching 'file' for 'File Manager': - Before: [ 3 ] - Now: [ 0, 1, 2, 3 ] Besides that, this greatly improves the scoring logic, as it can now calculate bonuses. Closes: #8310
2021-10-25Assistant: Simplify the logic of calculating bonus pointsKarol Kosek
This does not change the results, but makes the code clearer.
2021-10-25Assistant: Move score calculation logic to separate functionKarol Kosek
2021-10-25Assistant: Make strings const referencedKarol Kosek
Found by clazy.
2021-09-28Assistant: Zero initialize fuzzy match arrayBrian Gianforcaro
SonarCloud flagged the read of the matches array as a potential garbage read. I don't believe the case it flagged was possible to reach due to how the code is structured, however we should really just be zero initializing these stack arrays.
2021-09-12Assistant: Use ElapsedTimer::start_new()Brian Gianforcaro
2021-09-08Assistant: Fix lockfile logicBen Wiederhake
Previously, Assistant was able to re-execute itself due to a quirk in the global cursor tracking logic, it seems. Now it has become necessary to explicitly drop the lockfile before activating the new Assistant instance. Alternatively, this has always been a latent bug that only now has become more likely.
2021-09-08Assistant: Remove unnecessary global cursor trackingBen Wiederhake
2021-09-04Assistant: Use HashMap::ensure() in Database::did_receive_results()Andreas Kling
2021-08-18Userland+LibGUI: Add shorthand versions of the Margins constructorsin-ack
This allows for typing [8] instead of [8, 8, 8, 8] to specify the same margin on all edges, for example. The constructors follow CSS' style of specifying margins. The added constructors are: - Margins(int all): Sets the same margin on all edges. - Margins(int vertical, int horizontal): Sets the first argument to top and bottom margins, and the second argument to left and right margins. - Margins(int top, int vertical, int bottom): Sets the first argument to the top margin, the second argument to the left and right margins, and the third argument to the bottom margin.
2021-08-18Userland+LibGUI: Make Margins arguments match CSS orderingsin-ack
Previously the argument order for Margins was (left, top, right, bottom). To make it more familiar and closer to how CSS does it, the argument order is now (top, right, bottom, left).
2021-08-15Assistant: Bundle UI updates to avoid flickeringCarlos César Neves Enumo
While typing, we get the results from each provider asynchronously. Previously, we were updating the UI for each result size, which was causing a lot of flickering. This fix creates a small timer to bundle the results and reduce the number of UI updates per input.
2021-08-05Assistant: Quit the application after losing focusKarol Kosek
Prior to this change, Assistant would just stay in the background, unless one pressed an Escape key or launched some app.
2021-08-03Everywhere: Replace most cases of exit() with Application::quit()Timothy
Application::quit() is nicer for most cases where exit() is used. Cases where exit() is used intentionally for early termination are left intact.
2021-07-22Assistant: Only open one Assistant at oncePeter Elliott
I found myself accidentally opening two assistants at once with the Window+Space shortcut. Since only one assistant window is usable at the same time, I made assistant only spawn 1 instance at most.
2021-07-19Assistant: Trim terminal command before displaying or running itLuK1337
2021-07-16Assistant: Keep the Terminal window open after the command has runGunnar Beutner
2021-07-09LibThreading: Rename Lock => MutexAndreas Kling
2021-07-07Assistant: Compare two chars instead of StringViews of length 1Yuval Tasher
2021-07-05Assistant: Add missing <unistd.h> includeAndreas Kling
2021-07-04Assistant: Don't index the /dev directoryAndreas Kling
2021-07-04Assistant: Force the window to have a shadow despite being framelessAndreas Kling
2021-07-04Assistant: Show a border around the windowtimre13
2021-07-04Assistant: Prevent window from being minimizedForLoveOfCats
2021-07-03Assistant: Make more of the classes finalGunnar Beutner
2021-07-03Assistant: Make the bitmap accessor pure virtualGunnar Beutner
Assistant looks broken when a result doesn't have an icon.
2021-07-03Assistant: Add missing bitmap accessor for terminal actionsGunnar Beutner
2021-07-03Assistant: Skip URL provider if query is empty or provider specificEdwin Hoksberg
2021-07-03Assistant: Don't index the /proc and /sys directoriesAndreas Kling
Roughly 20% of indexing time in a fresh install was spent on traversing these kernel-generated directories. Let's just not. :^)
2021-07-03Assistant: Avoid copying the result vectors when providers finishAndreas Kling
Just move() them instead to cut down on the copying. :^)
2021-07-03Assistant: Keep the set of providers in a Vector for easy iterationAndreas Kling
2021-07-03Assistant: Use fstatat() while building FileProvider path cacheAndreas Kling
Using fstatat() allows the kernel to do relative path resolution as opposed to absolute path resolution, which is significantly faster and allows us to build the path cache sooner. :^)
2021-07-03Assistant: Use StringView more in FileProvider fuzzy matching codeAndreas Kling
By not allocating new String objects, the fuzzy matcher becomes a lot faster and more responsive while typing. :^)