Skip to content

Commit 95a748a

Browse files
committed
Fix tables
1 parent 8958949 commit 95a748a

File tree

4 files changed

+17
-21
lines changed

4 files changed

+17
-21
lines changed

.claude/settings.local.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,8 @@
5050
"mcp__chrome-devtools__press_key",
5151
"mcp__chrome-devtools__type_text",
5252
"mcp__chrome-devtools__evaluate_script",
53-
"mcp__chrome-devtools__list_pages"
53+
"mcp__chrome-devtools__list_pages",
54+
"Bash(cargo check:*)"
5455
]
5556
}
5657
}

browser/data-browser/src/components/EditableTitle.tsx

Lines changed: 11 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ import {
66
useTitle,
77
} from '@tomic/react';
88
import { useEffect, useRef, useState, type JSX } from 'react';
9-
import { useHotkeys } from 'react-hotkeys-hook';
109
import { FaPencil } from 'react-icons/fa6';
1110
import { styled, css } from 'styled-components';
1211
import {
@@ -57,24 +56,6 @@ export function EditableTitle({
5756
});
5857
}, [store, resource.subject]);
5958

60-
useHotkeys(
61-
'enter',
62-
e => {
63-
e.preventDefault();
64-
setIsEditing(false);
65-
onCommit?.();
66-
},
67-
{ enableOnTags: ['INPUT'] },
68-
);
69-
70-
useHotkeys(
71-
'esc',
72-
() => {
73-
setIsEditing(false);
74-
},
75-
{ enableOnTags: ['INPUT'] },
76-
);
77-
7859
function handleClick() {
7960
setIsEditing(true);
8061
}
@@ -86,6 +67,16 @@ export function EditableTitle({
8667
ref.current?.select();
8768
}, [isEditing]);
8869

70+
const handleKeyDown = (e: React.KeyboardEvent<HTMLInputElement>) => {
71+
if (e.key === 'Enter') {
72+
e.preventDefault();
73+
setIsEditing(false);
74+
onCommit?.();
75+
} else if (e.key === 'Escape') {
76+
setIsEditing(false);
77+
}
78+
};
79+
8980
return isEditing ? (
9081
<TitleInput
9182
ref={ref}
@@ -96,6 +87,7 @@ export function EditableTitle({
9687
placeholder={placeholder}
9788
onChange={e => setText(e.target.value)}
9889
value={text || ''}
90+
onKeyDown={handleKeyDown}
9991
onBlur={() => {
10092
setIsEditing(false);
10193
onCommit?.();

lib/src/collections.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -410,6 +410,7 @@ pub async fn construct_collection_from_params(
410410
let mut name = None;
411411
let mut include_nested = false;
412412
let mut include_external = false;
413+
let mut drive: Option<Subject> = None;
413414

414415
if let Ok(val) = resource.get(urls::COLLECTION_PROPERTY) {
415416
property = Some(val.to_string());
@@ -439,6 +440,7 @@ pub async fn construct_collection_from_params(
439440
"page_size" => page_size = v.parse::<usize>()?,
440441
"include_nested" => include_nested = v.parse::<bool>()?,
441442
"include_external" => include_external = v.parse::<bool>()?,
443+
"drive" => drive = Some(Subject::from(v.as_ref())),
442444
e => {
443445
return Err(format!("Invalid query param: {}", e).into());
444446
}
@@ -455,7 +457,7 @@ pub async fn construct_collection_from_params(
455457
name,
456458
include_nested,
457459
include_external,
458-
drive: Some(drive_prefix_from_subject(resource.get_subject())),
460+
drive: Some(drive.unwrap_or_else(|| drive_prefix_from_subject(resource.get_subject()))),
459461
};
460462
let collection = Collection::collect_members(store, collection_builder, for_agent).await?;
461463
collection.add_to_resource(resource, store).await

server/src/plugins/query.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ pub fn query_endpoint() -> Endpoint {
1919
urls::COLLECTION_INCLUDE_NESTED.to_string(),
2020
urls::COLLECTION_SORT_BY.to_string(),
2121
urls::COLLECTION_SORT_DESC.to_string(),
22+
"drive".to_string(),
2223
]
2324
.into(),
2425
description: "Query the server for resources matching the query filter.".to_string(),

0 commit comments

Comments
 (0)