helloadhavan/github_issues huggingface dataset:
Repository: electron/electron
Pull request: fix: CSD window frame tiles properly on Wayland

Backport of #48765

See that PR for details.


Notes: Corrected the appearance of tiled windows on GNOME (when frame: true), and removed resize handles from tiled edges.

Changed files:
filename: shell/browser/ui/electron_desktop_window_tree_host_linux.cc
patch: @@ -100,13 +100,19 @@ void ElectronDesktopWindowTreeHostLinux::OnWindowStateChanged(
 void ElectronDesktopWindowTreeHostLinux::OnWindowTiledStateChanged(
     ui::WindowTiledEdges new_tiled_edges) {
   if (auto* const view = native_window_view_->GetClientFrameViewLinux()) {
-    bool maximized = new_tiled_edges.top && new_tiled_edges.left &&
-                     new_tiled_edges.bottom && new_tiled_edges.right;
+    // GNOME on Ubuntu reports all edges as tiled
+    // even if the window is only half-tiled so do not trust individual edge
+    // values.
+    bool maximized = native_window_view_->IsMaximized();
     bool tiled = new_tiled_edges.top || new_tiled_edges.left ||
                  new_tiled_edges.bottom || new_tiled_edges.right;
     view->set_tiled(tiled && !maximized);
   }
   UpdateFrameHints();
+  ScheduleRelayout();
+  if (GetWidget()->non_client_view()) {
+    GetWidget()->non_client_view()->SchedulePaint();
+  }
 }
 
 void ElectronDesktopWindowTreeHostLinux::UpdateWindowState(

filename: shell/browser/ui/views/client_frame_view_linux.cc
patch: @@ -41,7 +41,6 @@ namespace {
 
 // These values should be the same as Chromium uses.
 constexpr int kResizeBorder = 10;
-constexpr int kResizeInsideBoundsSize = 5;
 
 ui::NavButtonProvider::ButtonState ButtonStateToNavButtonProviderState(
     views::Button::ButtonState state) {
@@ -152,8 +151,19 @@ gfx::Insets ClientFrameViewLinux::RestoredMirroredFrameBorderInsets() const {
 
 gfx::Insets ClientFrameViewLinux::RestoredFrameBorderInsets() const {
   gfx::Insets insets = GetFrameProvider()->GetFrameThicknessDip();
-  insets.SetToMax(GetInputInsets());
-  return insets;
+  const gfx::Insets input = GetInputInsets();
+
+  auto expand_if_visible = [](int side_thickness, int min_band) {
+    return side_thickness > 0 ? std::max(side_thickness, min_band) : 0;
+  };
+
+  gfx::Insets merged;
+  merged.set_top(expand_if_visible(insets.top(), input.top()));
+  merged.set_left(expand_if_visible(insets.left(), input.left()));
+  merged.set_bottom(expand_if_visible(insets.bottom(), input.bottom()));
+  merged.set_right(expand_if_visible(insets.right(), input.right()));
+
+  return merged;
 }
 
 gfx::Insets ClientFrameViewLinux::GetInputInsets() const {
@@ -198,9 +208,7 @@ void ClientFrameViewLinux::OnWindowButtonOrderingChange() {
 }
 
 int ClientFrameViewLinux::ResizingBorderHitTest(const gfx::Point& point) {
-  return ResizingBorderHitTestImpl(point,
-                                   RestoredMirroredFrameBorderInsets() +
-                                       gfx::Insets(kResizeInsideBoundsSize));
+  return ResizingBorderHitTestImpl(point, RestoredMirroredFrameBorderInsets());
 }
 
 gfx::Rect ClientFrameViewLinux::GetBoundsForClientView() const {
Repository: facebook/react
Pull request: Update eslint fixtures


Extracting portions of #32416 for easier review.

This PR lightly updates the build scripts for the eslint fixtures.

Co-authored-by: michael faith <michaelfaith@users.noreply.github.com>
---
[//]: # (BEGIN SAPLING FOOTER)
Stack created with [Sapling](https://sapling-scm.com). Best reviewed with [ReviewStack](https://reviewstack.dev/facebook/react/pull/32589).
* #32592
* #32591
* #32590
* __->__ #32589
* #32588

Changed files:
filename: fixtures/eslint-v6/build.mjs
patch: @@ -1,12 +1,13 @@
 #!/usr/bin/env node
 
-import {exec} from 'node:child_process';
+import {execSync} from 'node:child_process';
 import {dirname, resolve} from 'node:path';
 import {fileURLToPath} from 'node:url';
 
 const __filename = fileURLToPath(import.meta.url);
 const __dirname = dirname(__filename);
 
-exec('yarn build -r stable eslint-plugin-react-hooks', {
+execSync('yarn build -r stable eslint-plugin-react-hooks', {
   cwd: resolve(__dirname, '..', '..'),
+  stdio: 'inherit',
 });

filename: fixtures/eslint-v7/build.mjs
patch: @@ -1,12 +1,13 @@
 #!/usr/bin/env node
 
-import {exec} from 'node:child_process';
+import {execSync} from 'node:child_process';
 import {dirname, resolve} from 'node:path';
 import {fileURLToPath} from 'node:url';
 
 const __filename = fileURLToPath(import.meta.url);
 const __dirname = dirname(__filename);
 
-exec('yarn build -r stable eslint-plugin-react-hooks', {
+execSync('yarn build -r stable eslint-plugin-react-hooks', {
   cwd: resolve(__dirname, '..', '..'),
+  stdio: 'inherit',
 });

filename: fixtures/eslint-v8/build.mjs
patch: @@ -1,12 +1,13 @@
 #!/usr/bin/env node
 
-import {exec} from 'node:child_process';
+import {execSync} from 'node:child_process';
 import {dirname, resolve} from 'node:path';
 import {fileURLToPath} from 'node:url';
 
 const __filename = fileURLToPath(import.meta.url);
 const __dirname = dirname(__filename);
 
-exec('yarn build -r stable eslint-plugin-react-hooks', {
+execSync('yarn build -r stable eslint-plugin-react-hooks', {
   cwd: resolve(__dirname, '..', '..'),
+  stdio: 'inherit',
 });

filename: fixtures/eslint-v9/build.mjs
patch: @@ -1,12 +1,13 @@
 #!/usr/bin/env node
 
-import {exec} from 'node:child_process';
+import {execSync} from 'node:child_process';
 import {dirname, resolve} from 'node:path';
 import {fileURLToPath} from 'node:url';
 
 const __filename = fileURLToPath(import.meta.url);
 const __dirname = dirname(__filename);
 
-exec('yarn build -r stable eslint-plugin-react-hooks', {
+execSync('yarn build -r stable eslint-plugin-react-hooks', {
   cwd: resolve(__dirname, '..', '..'),
+  stdio: 'inherit',
 });
Repository: ollama/ollama
Pull request: runner.go: Merge partial unicode characters before sending

We check for partial unicode characters and accumulate them before sending. However, when we did send, we still sent each individual piece separately, leading to broken output. This combines everything into a single group, which is also more efficient.

This also switches to the built-in check for valid unicode characters, which is stricter. After this, we should never send back an invalid sequence.

Fixes #7290

Changed files:
filename: integration/basic_test.go
patch: @@ -30,6 +30,22 @@ func TestOrcaMiniBlueSky(t *testing.T) {
 	GenerateTestHelper(ctx, t, req, []string{"rayleigh", "scattering"})
 }
 
+func TestUnicodeOutput(t *testing.T) {
+	ctx, cancel := context.WithTimeout(context.Background(), 2*time.Minute)
+	defer cancel()
+	// Set up the test data
+	req := api.GenerateRequest{
+		Model:  "gemma2:2b",
+		Prompt: "Output some smily face emoji",
+		Stream: &stream,
+		Options: map[string]interface{}{
+			"temperature": 0,
+			"seed":        123,
+		},
+	}
+	GenerateTestHelper(ctx, t, req, []string{"😀", "😊", "😁", "😂", "😄", "😃"})
+}
+
 func TestUnicodeModelDir(t *testing.T) {
 	// This is only useful for Windows with utf-16 characters, so skip this test for other platforms
 	if runtime.GOOS != "windows" {

filename: llama/runner/runner.go
patch: @@ -18,6 +18,7 @@ import (
 	"strings"
 	"sync"
 	"time"
+	"unicode/utf8"
 
 	"github.com/ollama/ollama/api"
 	"github.com/ollama/ollama/llama"
@@ -293,17 +294,29 @@ func (s *Server) shiftContext(seq *Sequence) {
 }
 
 func flushPending(seq *Sequence) bool {
-	for _, p := range seq.pendingResponses {
-		select {
-		case seq.responses <- p:
-		case <-seq.quit:
-			seq.pendingResponses = []string{}
-			return false
-		}
+	joined := strings.Join(seq.pendingResponses, "")
+	seq.pendingResponses = []string{}
+
+	// Check if there are any partial UTF-8 characters remaining.
+	// We already check and queue as we are generating but some may
+	// still make it here:
+	// - Sequence is ending, e.g. generation limit has been hit
+	// - Invalid characters in the middle of a string
+	// This is a stricter check to ensure we never output invalid Unicode.
+	for !utf8.ValidString(joined) {
+		joined = joined[:len(joined)-1]
 	}
 
-	seq.pendingResponses = []string{}
-	return true
+	if len(joined) == 0 {
+		return true
+	}
+
+	select {
+	case seq.responses <- joined:
+		return true
+	case <-seq.quit:
+		return false
+	}
 }
 
 func (s *Server) removeSequence(seqIndex int, reason string) {
Repository: vuejs/vue
Pull request: improve: optimize the performance of scheduler

<!--
Please make sure to read the Pull Request Guidelines:
https://github.com/vuejs/vue/blob/dev/.github/CONTRIBUTING.md#pull-request-guidelines
-->

<!-- PULL REQUEST TEMPLATE -->
<!-- (Update "[ ]" to "[x]" to check a box) -->

**What kind of change does this PR introduce?** (check at least one)

- [ ] Bugfix
- [ ] Feature
- [ ] Code style update
- [x] Refactor
- [ ] Build-related changes
- [ ] Other, please describe:

**Does this PR introduce a breaking change?** (check one)

- [ ] Yes
- [x] No

If yes, please describe the impact and migration path for existing applications:

**The PR fulfills these requirements:**

- [x] It's submitted to the `dev` branch for v2.x (or to a previous version branch), _not_ the `master` branch
- [ ] When resolving a specific issue, it's referenced in the PR's title (e.g. `fix #xxx[,#xxx]`, where "xxx" is the issue number)
- [ ] All tests are passing: https://github.com/vuejs/vue/blob/dev/.github/CONTRIBUTING.md#development-setup
- [ ] New/updated tests are included

If adding a **new feature**, the PR's description includes:
- [ ] A convincing reason for adding this feature (to avoid wasting your time, it's best to open a suggestion issue first and wait for approval before working on it)

**Other information:**


Changed files:
filename: src/core/observer/scheduler.js
patch: @@ -24,7 +24,7 @@ let index = 0
  * Reset the scheduler's state.
  */
 function resetSchedulerState () {
-  queue.length = activatedChildren.length = 0
+  index = queue.length = activatedChildren.length = 0
   has = {}
   if (process.env.NODE_ENV !== 'production') {
     circular = {}
@@ -134,10 +134,10 @@ export function queueWatcher (watcher: Watcher) {
       // if already flushing, splice the watcher based on its id
       // if already past its id, it will be run next immediately.
       let i = queue.length - 1
-      while (i >= 0 && queue[i].id > watcher.id) {
+      while (i > index && queue[i].id > watcher.id) {
         i--
       }
-      queue.splice(Math.max(i, index) + 1, 0, watcher)
+      queue.splice(i + 1, 0, watcher)
     }
     // queue the flush
     if (!waiting) {
Repository: nodejs/node
Pull request: tools: document that nixpkgs updates should not be backported

<!--
Before submitting a pull request, please read:

- the CONTRIBUTING guide at https://github.com/nodejs/node/blob/HEAD/CONTRIBUTING.md
- the commit message formatting guidelines at
  https://github.com/nodejs/node/blob/HEAD/doc/contributing/pull-requests.md#commit-message-guidelines

For code changes:
1. Include tests for any bug fixes or new features.
2. Update documentation if relevant.
3. Ensure that `make -j4 test` (UNIX), or `vcbuild test` (Windows) passes.

If you believe this PR should be highlighted in the Node.js CHANGELOG
please add the `notable-change` label.

Developer's Certificate of Origin 1.1

By making a contribution to this project, I certify that:

(a) The contribution was created in whole or in part by me and I
    have the right to submit it under the open source license
    indicated in the file; or

(b) The contribution is based upon previous work that, to the best
    of my knowledge, is covered under an appropriate open source
    license and I have the right under that license to submit that
    work with modifications, whether created in whole or in part
    by me, under the same open source license (unless I am
    permitted to submit under a different license), as indicated
    in the file; or

(c) The contribution was provided directly to me by some other
    person who certified (a), (b) or (c) and I have not modified
    it.

(d) I understand and agree that this project and the contribution
    are public and that a record of the contribution (including all
    personal information I submit with it, including my sign-off) is
    maintained indefinitely and may be redistributed consistent with
    this project or the open source license(s) involved.
-->


Changed files:
filename: .github/workflows/tools.yml
patch: @@ -193,7 +193,10 @@ jobs:
               rm temp-output
           - id: nixpkgs-unstable
             subsystem: tools
-            label: tools
+            # dont-land labels are there so we can guarantee released versions of
+            # Node.js can be built with the same env along the whole release line life – or
+            # at least we can detect and document necessary updates.
+            label: tools, dont-land-on-v20.x, dont-land-on-v22.x, dont-land-on-v24.x, dont-land-on-v25.x
             run: |
               ./tools/dep_updaters/update-nixpkgs-pin.sh > temp-output
               cat temp-output
Repository: ollama/ollama
Pull request: Add Ollama for Swift to the community integrations

This PR updates the README by adding a link to a [Swift client library](https://github.com/mattt/ollama-swift) I recently published.

I'm using it for a few internal projects, and thought it might be useful to anyone else who's building macOS apps with Ollama.

```swift
import Ollama

let response = try await Client.default.chat(
    model: "llama3.2",
    messages: [
        .system("You are a helpful assistant."),
        .user("Tell me a joke about the Swift programming language.")
    ]
)
print(response.message.content)
// "The best part about Swift's interoperability with Objective-C is realizing you now have two languages you don't fully understand."
```



Changed files:
filename: README.md
patch: @@ -412,6 +412,7 @@ See the [API documentation](./docs/api.md) for all endpoints.
 - [High-level function abstraction in Go](https://gitlab.com/tozd/go/fun)
 - [Ollama PHP](https://github.com/ArdaGnsrn/ollama-php)
 - [Agents-Flex for Java](https://github.com/agents-flex/agents-flex) with [example](https://github.com/agents-flex/agents-flex/tree/main/agents-flex-llm/agents-flex-llm-ollama/src/test/java/com/agentsflex/llm/ollama)
+- [Ollama for Swift](https://github.com/mattt/ollama-swift)
 
 ### Mobile
Repository: ggml-org/llama.cpp
Pull request: cli : support --verbose-prompt

Useful when debugging templates.

Changed files:
filename: tools/cli/cli.cpp
patch: @@ -52,6 +52,7 @@ struct cli_context {
     json messages = json::array();
     std::vector<raw_buffer> input_files;
     task_params defaults;
+    bool verbose_prompt;
 
     // thread for showing "loading" animation
     std::atomic<bool> loading_show;
@@ -66,6 +67,8 @@ struct cli_context {
         defaults.stream = true; // make sure we always use streaming mode
         defaults.timings_per_token = true; // in order to get timings even when we cancel mid-way
         // defaults.return_progress = true; // TODO: show progress
+
+        verbose_prompt = params.verbose_prompt;
     }
 
     std::string generate_completion(result_timings & out_timings) {
@@ -91,6 +94,12 @@ struct cli_context {
             rd.post_task({std::move(task)});
         }
 
+        if (verbose_prompt) {
+            console::set_display(DISPLAY_TYPE_PROMPT);
+            console::log("%s\n\n", chat_params.prompt.c_str());
+            console::set_display(DISPLAY_TYPE_RESET);
+        }
+
         // wait for first result
         console::spinner::start();
         server_task_result_ptr result = rd.next(should_stop);
Repository: vuejs/vue
Pull request: fix #5592: comment vnode should not be merged into text vnode.

<!--
Please make sure to read the Pull Request Guidelines:
https://github.com/vuejs/vue/blob/dev/.github/CONTRIBUTING.md#pull-request-guidelines
-->

<!-- PULL REQUEST TEMPLATE -->
<!-- (Update "[ ]" to "[x]" to check a box) -->

**What kind of change does this PR introduce?** (check at least one)

- [x] Bugfix
- [ ] Feature
- [ ] Code style update
- [ ] Refactor
- [ ] Build-related changes
- [ ] Other, please describe:

**Does this PR introduce a breaking change?** (check one)

- [ ] Yes
- [x] No

If yes, please describe the impact and migration path for existing applications:

**The PR fulfills these requirements:**

- [ ] It's submitted to the `dev` branch for v2.x (or to a previous version branch), _not_ the `master` branch
- [ ] When resolving a specific issue, it's referenced in the PR's title (e.g. `fix #xxx[,#xxx]`, where "xxx" is the issue number)
- [ ] All tests are passing: https://github.com/vuejs/vue/blob/dev/.github/CONTRIBUTING.md#development-setup
- [ ] New/updated tests are included

If adding a **new feature**, the PR's description includes:
- [ ] A convincing reason for adding this feature (to avoid wasting your time, it's best to open a suggestion issue first and wait for approval before working on it)

**Other information:**


Changed files:
filename: src/core/vdom/helpers/normalize-children.js
patch: @@ -1,7 +1,7 @@
 /* @flow */
 
 import VNode, { createTextVNode } from 'core/vdom/vnode'
-import { isDef, isUndef, isPrimitive } from 'shared/util'
+import { isFalse, isDef, isUndef, isPrimitive } from 'shared/util'
 
 // The template compiler attempts to minimize the need for normalization by
 // statically analyzing the template at compile time.
@@ -54,7 +54,7 @@ function normalizeArrayChildren (children: any, nestedIndex?: string): Array<VNo
         res.push(createTextVNode(c))
       }
     } else {
-      if (isDef(c.text) && isDef(last) && isDef(last.text)) {
+      if (isFalse(c.isComment) && isDef(c.text) && isDef(last) && isFalse(last.isComment) && isDef(last.text)) {
         res[res.length - 1] = createTextVNode(last.text + c.text)
       } else {
         // default key for nested array children (likely generated by v-for)

filename: src/shared/util.js
patch: @@ -14,6 +14,9 @@ export function isTrue (v: any): boolean %checks {
   return v === true
 }
 
+export function isFalse (v: any): boolean %checks {
+  return v === false
+}
 /**
  * Check if value is primitive
  */
Repository: huggingface/transformers
Pull request: Fix saving multiple tokenizers for custom processors

Fixes this issue https://github.com/huggingface/transformers/issues/41816
Instead of harcoding a set of tokenizer attribute that shouldn't be saved as part of `preprocessor_config`, this remove all attributes that contain "tokenizer" from `preprocessor_config`, which allows for more flexibility when creating a custom processor with multiple tokenizers.

Changed files:
filename: src/transformers/processing_utils.py
patch: @@ -696,14 +696,10 @@ def to_dict(self) -> dict[str, Any]:
         # extra attributes to be kept
         attrs_to_save += ["auto_map"]
 
-        if "tokenizer" in output:
-            del output["tokenizer"]
-        if "qformer_tokenizer" in output:
-            del output["qformer_tokenizer"]
-        if "protein_tokenizer" in output:
-            del output["protein_tokenizer"]
-        if "char_tokenizer" in output:
-            del output["char_tokenizer"]
+        for attribute in self.__class__.get_attributes():
+            if "tokenizer" in attribute and attribute in output:
+                del output[attribute]
+
         if "chat_template" in output:
             del output["chat_template"]
Repository: facebook/react
Pull request: [playground] Use onMount to check if the editor is available


Playground test flakiness seems to be fixed but adding this as an extra precaution


Changed files:
filename: compiler/apps/playground/__tests__/e2e/page.spec.ts
patch: @@ -9,6 +9,13 @@ import {expect, test} from '@playwright/test';
 import {encodeStore, type Store} from '../../lib/stores';
 import {format} from 'prettier';
 
+function isMonacoLoaded(): boolean {
+  return (
+    typeof window['MonacoEnvironment'] !== 'undefined' &&
+    window['__MONACO_LOADED__'] === true
+  );
+}
+
 function formatPrint(data: Array<string>): Promise<string> {
   return format(data.join(''), {parser: 'babel'});
 }
@@ -105,9 +112,7 @@ function nonReactFn() {
 
 test('editor should open successfully', async ({page}) => {
   await page.goto(`/`, {waitUntil: 'networkidle'});
-  await page.waitForFunction(
-    () => typeof window['MonacoEnvironment'] !== 'undefined',
-  );
+  await page.waitForFunction(isMonacoLoaded);
   await page.screenshot({
     fullPage: true,
     path: 'test-results/00-fresh-page.png',
@@ -123,9 +128,7 @@ test('editor should compile from hash successfully', async ({page}) => {
   };
   const hash = encodeStore(store);
   await page.goto(`/#${hash}`, {waitUntil: 'networkidle'});
-  await page.waitForFunction(
-    () => typeof window['MonacoEnvironment'] !== 'undefined',
-  );
+  await page.waitForFunction(isMonacoLoaded);
 
   // User input from hash compiles
   await page.screenshot({
@@ -149,9 +152,7 @@ test('reset button works', async ({page}) => {
   };
   const hash = encodeStore(store);
   await page.goto(`/#${hash}`, {waitUntil: 'networkidle'});
-  await page.waitForFunction(
-    () => typeof window['MonacoEnvironment'] !== 'undefined',
-  );
+  await page.waitForFunction(isMonacoLoaded);
 
   // Reset button works
   page.on('dialog', dialog => dialog.accept());
@@ -175,9 +176,7 @@ TEST_CASE_INPUTS.forEach((t, idx) =>
     };
     const hash = encodeStore(store);
     await page.goto(`/#${hash}`, {waitUntil: 'networkidle'});
-    await page.waitForFunction(
-      () => typeof window['MonacoEnvironment'] !== 'undefined',
-    );
+    await page.waitForFunction(isMonacoLoaded);
     await page.screenshot({
       fullPage: true,
       path: `test-results/03-0${idx}-${t.name}.png`,

filename: compiler/apps/playground/components/Editor/Input.tsx
patch: @@ -89,6 +89,9 @@ export default function Input({errors, language}: Props): JSX.Element {
     _: editor.IStandaloneCodeEditor,
     monaco: Monaco,
   ) => void = (_, monaco) => {
+    if (typeof window !== 'undefined') {
+      window['__MONACO_LOADED__'] = true;
+    }
     setMonaco(monaco);
 
     const tscOptions = {

filename: compiler/apps/playground/package.json
patch: @@ -12,7 +12,7 @@
     "vercel-build": "yarn build",
     "start": "next start",
     "lint": "next lint",
-    "test": "playwright test"
+    "test": "playwright test --workers=4"
   },
   "dependencies": {
     "@babel/core": "^7.18.9",