add tab view filter and sort options
This commit is contained in:
@@ -128,6 +128,14 @@ class TabDao extends DatabaseAccessor<TabDatabase> with $TabDaoMixin {
|
||||
);
|
||||
}
|
||||
|
||||
Selectable<MapEntry<String, String>> getTabOrderKeys() {
|
||||
final query = selectOnly(db.tab)..addColumns([db.tab.id, db.tab.orderKey]);
|
||||
|
||||
return query.map(
|
||||
(row) => MapEntry(row.read(db.tab.id)!, row.read(db.tab.orderKey)!),
|
||||
);
|
||||
}
|
||||
|
||||
Future<String> _generateOrderKey({
|
||||
required Value<String?> parentId,
|
||||
required Value<String?> containerId,
|
||||
@@ -463,6 +471,27 @@ class TabDao extends DatabaseAccessor<TabDatabase> with $TabDaoMixin {
|
||||
return db.definitionsDrift.isolatedContextContainerPairs();
|
||||
}
|
||||
|
||||
Future<void> setPinned(String id, {required bool pinned}) {
|
||||
final statement = _updateByIdStatement(id);
|
||||
return statement.write(TabCompanion(isPinned: Value(pinned)));
|
||||
}
|
||||
|
||||
Selectable<String> getPinnedTabIds() {
|
||||
final query = selectOnly(db.tab)
|
||||
..addColumns([db.tab.id])
|
||||
..where(db.tab.isPinned.equals(true));
|
||||
|
||||
return query.map((row) => row.read(db.tab.id)!);
|
||||
}
|
||||
|
||||
Selectable<MapEntry<String, DateTime>> getTabTimestamps() {
|
||||
final query = selectOnly(db.tab)..addColumns([db.tab.id, db.tab.timestamp]);
|
||||
|
||||
return query.map(
|
||||
(row) => MapEntry(row.read(db.tab.id)!, row.read(db.tab.timestamp)!),
|
||||
);
|
||||
}
|
||||
|
||||
Future<List<String>> getUnassignedTabsOlderThan(DateTime threshold) {
|
||||
final query = selectOnly(db.tab)
|
||||
..addColumns([db.tab.id])
|
||||
|
||||
@@ -31,7 +31,7 @@ import 'package:weblibre/features/search/domain/fts_tokenizer.dart';
|
||||
@DriftDatabase(include: {'definitions.drift'}, daos: [ContainerDao, TabDao])
|
||||
class TabDatabase extends $TabDatabase with TrigramQueryBuilderMixin {
|
||||
@override
|
||||
final int schemaVersion = 6;
|
||||
final int schemaVersion = 7;
|
||||
|
||||
@override
|
||||
final int ftsTokenLimit = 10;
|
||||
@@ -115,5 +115,8 @@ class TabDatabase extends $TabDatabase with TrigramQueryBuilderMixin {
|
||||
|
||||
await m.alterTable(TableMigration(schema.tab));
|
||||
},
|
||||
from6To7: (m, schema) async {
|
||||
await m.addColumn(schema.tab, schema.tab.isPinned);
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
@@ -594,11 +594,140 @@ i1.GeneratedColumn<String> _column_18(String aliasedName) =>
|
||||
type: i1.DriftSqlType.string,
|
||||
$customConstraints: '',
|
||||
);
|
||||
|
||||
final class Schema7 extends i0.VersionedSchema {
|
||||
Schema7({required super.database}) : super(version: 7);
|
||||
@override
|
||||
late final List<i1.DatabaseSchemaEntity> entities = [
|
||||
container,
|
||||
tab,
|
||||
tabFts,
|
||||
tabMaintainParentChainOnDelete,
|
||||
tabAfterInsert,
|
||||
tabAfterDelete,
|
||||
tabAfterUpdate,
|
||||
];
|
||||
late final Shape0 container = Shape0(
|
||||
source: i0.VersionedTable(
|
||||
entityName: 'container',
|
||||
withoutRowId: false,
|
||||
isStrict: false,
|
||||
tableConstraints: [],
|
||||
columns: [_column_0, _column_1, _column_2, _column_3],
|
||||
attachedDatabase: database,
|
||||
),
|
||||
alias: null,
|
||||
);
|
||||
late final Shape5 tab = Shape5(
|
||||
source: i0.VersionedTable(
|
||||
entityName: 'tab',
|
||||
withoutRowId: false,
|
||||
isStrict: false,
|
||||
tableConstraints: [
|
||||
'CHECK((tab_mode = 2 AND isolation_context_id IS NOT NULL)OR(tab_mode != 2 AND isolation_context_id IS NULL))',
|
||||
],
|
||||
columns: [
|
||||
_column_0,
|
||||
_column_16,
|
||||
_column_4,
|
||||
_column_5,
|
||||
_column_6,
|
||||
_column_7,
|
||||
_column_8,
|
||||
_column_17,
|
||||
_column_18,
|
||||
_column_19,
|
||||
_column_10,
|
||||
_column_11,
|
||||
_column_12,
|
||||
_column_13,
|
||||
_column_14,
|
||||
_column_15,
|
||||
],
|
||||
attachedDatabase: database,
|
||||
),
|
||||
alias: null,
|
||||
);
|
||||
late final Shape2 tabFts = Shape2(
|
||||
source: i0.VersionedVirtualTable(
|
||||
entityName: 'tab_fts',
|
||||
moduleAndArgs:
|
||||
'fts5(title, url, extracted_content_plain, full_content_plain, content=tab, tokenize="trigram")',
|
||||
columns: [_column_8, _column_7, _column_12, _column_14],
|
||||
attachedDatabase: database,
|
||||
),
|
||||
alias: null,
|
||||
);
|
||||
final i1.Trigger tabMaintainParentChainOnDelete = i1.Trigger(
|
||||
'CREATE TRIGGER tab_maintain_parent_chain_on_delete BEFORE DELETE ON tab BEGIN UPDATE tab SET parent_id = CASE WHEN OLD.parent_id IS NOT NULL AND EXISTS (SELECT 1 FROM tab WHERE id = OLD.parent_id) THEN OLD.parent_id ELSE NULL END WHERE parent_id = OLD.id;END',
|
||||
'tab_maintain_parent_chain_on_delete',
|
||||
);
|
||||
final i1.Trigger tabAfterInsert = i1.Trigger(
|
||||
'CREATE TRIGGER tab_after_insert AFTER INSERT ON tab BEGIN INSERT INTO tab_fts ("rowid", title, url, extracted_content_plain, full_content_plain) VALUES (new."rowid", new.title, new.url, new.extracted_content_plain, new.full_content_plain);END',
|
||||
'tab_after_insert',
|
||||
);
|
||||
final i1.Trigger tabAfterDelete = i1.Trigger(
|
||||
'CREATE TRIGGER tab_after_delete AFTER DELETE ON tab BEGIN INSERT INTO tab_fts (tab_fts, "rowid", title, url, extracted_content_plain, full_content_plain) VALUES (\'delete\', old."rowid", old.title, old.url, old.extracted_content_plain, old.full_content_plain);END',
|
||||
'tab_after_delete',
|
||||
);
|
||||
final i1.Trigger tabAfterUpdate = i1.Trigger(
|
||||
'CREATE TRIGGER tab_after_update AFTER UPDATE ON tab BEGIN INSERT INTO tab_fts (tab_fts, "rowid", title, url, extracted_content_plain, full_content_plain) VALUES (\'delete\', old."rowid", old.title, old.url, old.extracted_content_plain, old.full_content_plain);INSERT INTO tab_fts ("rowid", title, url, extracted_content_plain, full_content_plain) VALUES (new."rowid", new.title, new.url, new.extracted_content_plain, new.full_content_plain);END',
|
||||
'tab_after_update',
|
||||
);
|
||||
}
|
||||
|
||||
class Shape5 extends i0.VersionedTable {
|
||||
Shape5({required super.source, required super.alias}) : super.aliased();
|
||||
i1.GeneratedColumn<String> get id =>
|
||||
columnsByName['id']! as i1.GeneratedColumn<String>;
|
||||
i1.GeneratedColumn<int> get source =>
|
||||
columnsByName['source']! as i1.GeneratedColumn<int>;
|
||||
i1.GeneratedColumn<String> get parentId =>
|
||||
columnsByName['parent_id']! as i1.GeneratedColumn<String>;
|
||||
i1.GeneratedColumn<String> get containerId =>
|
||||
columnsByName['container_id']! as i1.GeneratedColumn<String>;
|
||||
i1.GeneratedColumn<String> get orderKey =>
|
||||
columnsByName['order_key']! as i1.GeneratedColumn<String>;
|
||||
i1.GeneratedColumn<String> get url =>
|
||||
columnsByName['url']! as i1.GeneratedColumn<String>;
|
||||
i1.GeneratedColumn<String> get title =>
|
||||
columnsByName['title']! as i1.GeneratedColumn<String>;
|
||||
i1.GeneratedColumn<int> get tabMode =>
|
||||
columnsByName['tab_mode']! as i1.GeneratedColumn<int>;
|
||||
i1.GeneratedColumn<String> get isolationContextId =>
|
||||
columnsByName['isolation_context_id']! as i1.GeneratedColumn<String>;
|
||||
i1.GeneratedColumn<int> get isPinned =>
|
||||
columnsByName['is_pinned']! as i1.GeneratedColumn<int>;
|
||||
i1.GeneratedColumn<int> get isProbablyReaderable =>
|
||||
columnsByName['is_probably_readerable']! as i1.GeneratedColumn<int>;
|
||||
i1.GeneratedColumn<String> get extractedContentMarkdown =>
|
||||
columnsByName['extracted_content_markdown']!
|
||||
as i1.GeneratedColumn<String>;
|
||||
i1.GeneratedColumn<String> get extractedContentPlain =>
|
||||
columnsByName['extracted_content_plain']! as i1.GeneratedColumn<String>;
|
||||
i1.GeneratedColumn<String> get fullContentMarkdown =>
|
||||
columnsByName['full_content_markdown']! as i1.GeneratedColumn<String>;
|
||||
i1.GeneratedColumn<String> get fullContentPlain =>
|
||||
columnsByName['full_content_plain']! as i1.GeneratedColumn<String>;
|
||||
i1.GeneratedColumn<int> get timestamp =>
|
||||
columnsByName['timestamp']! as i1.GeneratedColumn<int>;
|
||||
}
|
||||
|
||||
i1.GeneratedColumn<int> _column_19(String aliasedName) =>
|
||||
i1.GeneratedColumn<int>(
|
||||
'is_pinned',
|
||||
aliasedName,
|
||||
false,
|
||||
type: i1.DriftSqlType.int,
|
||||
$customConstraints: 'NOT NULL DEFAULT 0',
|
||||
defaultValue: const i1.CustomExpression('0'),
|
||||
);
|
||||
i0.MigrationStepWithVersion migrationSteps({
|
||||
required Future<void> Function(i1.Migrator m, Schema3 schema) from2To3,
|
||||
required Future<void> Function(i1.Migrator m, Schema4 schema) from3To4,
|
||||
required Future<void> Function(i1.Migrator m, Schema5 schema) from4To5,
|
||||
required Future<void> Function(i1.Migrator m, Schema6 schema) from5To6,
|
||||
required Future<void> Function(i1.Migrator m, Schema7 schema) from6To7,
|
||||
}) {
|
||||
return (currentVersion, database) async {
|
||||
switch (currentVersion) {
|
||||
@@ -622,6 +751,11 @@ i0.MigrationStepWithVersion migrationSteps({
|
||||
final migrator = i1.Migrator(database, schema);
|
||||
await from5To6(migrator, schema);
|
||||
return 6;
|
||||
case 6:
|
||||
final schema = Schema7(database: database);
|
||||
final migrator = i1.Migrator(database, schema);
|
||||
await from6To7(migrator, schema);
|
||||
return 7;
|
||||
default:
|
||||
throw ArgumentError.value('Unknown migration from $currentVersion');
|
||||
}
|
||||
@@ -633,11 +767,13 @@ i1.OnUpgrade stepByStep({
|
||||
required Future<void> Function(i1.Migrator m, Schema4 schema) from3To4,
|
||||
required Future<void> Function(i1.Migrator m, Schema5 schema) from4To5,
|
||||
required Future<void> Function(i1.Migrator m, Schema6 schema) from5To6,
|
||||
required Future<void> Function(i1.Migrator m, Schema7 schema) from6To7,
|
||||
}) => i0.VersionedSchema.stepByStepHelper(
|
||||
step: migrationSteps(
|
||||
from2To3: from2To3,
|
||||
from3To4: from3To4,
|
||||
from4To5: from4To5,
|
||||
from5To6: from5To6,
|
||||
from6To7: from6To7,
|
||||
),
|
||||
);
|
||||
|
||||
@@ -24,6 +24,7 @@ CREATE TABLE tab(
|
||||
title TEXT,
|
||||
tab_mode ENUM(TabModeDbValue) NOT NULL DEFAULT 0,
|
||||
isolation_context_id TEXT,
|
||||
is_pinned BOOL NOT NULL DEFAULT 0,
|
||||
is_probably_readerable BOOL,
|
||||
extracted_content_markdown TEXT,
|
||||
extracted_content_plain TEXT,
|
||||
|
||||
@@ -333,6 +333,7 @@ typedef $TabCreateCompanionBuilder =
|
||||
i0.Value<String?> title,
|
||||
i0.Value<i7.TabModeDbValue> tabMode,
|
||||
i0.Value<String?> isolationContextId,
|
||||
i0.Value<bool> isPinned,
|
||||
i0.Value<bool?> isProbablyReaderable,
|
||||
i0.Value<String?> extractedContentMarkdown,
|
||||
i0.Value<String?> extractedContentPlain,
|
||||
@@ -352,6 +353,7 @@ typedef $TabUpdateCompanionBuilder =
|
||||
i0.Value<String?> title,
|
||||
i0.Value<i7.TabModeDbValue> tabMode,
|
||||
i0.Value<String?> isolationContextId,
|
||||
i0.Value<bool> isPinned,
|
||||
i0.Value<bool?> isProbablyReaderable,
|
||||
i0.Value<String?> extractedContentMarkdown,
|
||||
i0.Value<String?> extractedContentPlain,
|
||||
@@ -445,6 +447,11 @@ class $TabFilterComposer extends i0.Composer<i0.GeneratedDatabase, i3.Tab> {
|
||||
builder: (column) => i0.ColumnFilters(column),
|
||||
);
|
||||
|
||||
i0.ColumnFilters<bool> get isPinned => $composableBuilder(
|
||||
column: $table.isPinned,
|
||||
builder: (column) => i0.ColumnFilters(column),
|
||||
);
|
||||
|
||||
i0.ColumnFilters<bool> get isProbablyReaderable => $composableBuilder(
|
||||
column: $table.isProbablyReaderable,
|
||||
builder: (column) => i0.ColumnFilters(column),
|
||||
@@ -551,6 +558,11 @@ class $TabOrderingComposer extends i0.Composer<i0.GeneratedDatabase, i3.Tab> {
|
||||
builder: (column) => i0.ColumnOrderings(column),
|
||||
);
|
||||
|
||||
i0.ColumnOrderings<bool> get isPinned => $composableBuilder(
|
||||
column: $table.isPinned,
|
||||
builder: (column) => i0.ColumnOrderings(column),
|
||||
);
|
||||
|
||||
i0.ColumnOrderings<bool> get isProbablyReaderable => $composableBuilder(
|
||||
column: $table.isProbablyReaderable,
|
||||
builder: (column) => i0.ColumnOrderings(column),
|
||||
@@ -643,6 +655,9 @@ class $TabAnnotationComposer extends i0.Composer<i0.GeneratedDatabase, i3.Tab> {
|
||||
builder: (column) => column,
|
||||
);
|
||||
|
||||
i0.GeneratedColumn<bool> get isPinned =>
|
||||
$composableBuilder(column: $table.isPinned, builder: (column) => column);
|
||||
|
||||
i0.GeneratedColumn<bool> get isProbablyReaderable => $composableBuilder(
|
||||
column: $table.isProbablyReaderable,
|
||||
builder: (column) => column,
|
||||
@@ -736,6 +751,7 @@ class $TabTableManager
|
||||
i0.Value<String?> title = const i0.Value.absent(),
|
||||
i0.Value<i7.TabModeDbValue> tabMode = const i0.Value.absent(),
|
||||
i0.Value<String?> isolationContextId = const i0.Value.absent(),
|
||||
i0.Value<bool> isPinned = const i0.Value.absent(),
|
||||
i0.Value<bool?> isProbablyReaderable = const i0.Value.absent(),
|
||||
i0.Value<String?> extractedContentMarkdown =
|
||||
const i0.Value.absent(),
|
||||
@@ -755,6 +771,7 @@ class $TabTableManager
|
||||
title: title,
|
||||
tabMode: tabMode,
|
||||
isolationContextId: isolationContextId,
|
||||
isPinned: isPinned,
|
||||
isProbablyReaderable: isProbablyReaderable,
|
||||
extractedContentMarkdown: extractedContentMarkdown,
|
||||
extractedContentPlain: extractedContentPlain,
|
||||
@@ -774,6 +791,7 @@ class $TabTableManager
|
||||
i0.Value<String?> title = const i0.Value.absent(),
|
||||
i0.Value<i7.TabModeDbValue> tabMode = const i0.Value.absent(),
|
||||
i0.Value<String?> isolationContextId = const i0.Value.absent(),
|
||||
i0.Value<bool> isPinned = const i0.Value.absent(),
|
||||
i0.Value<bool?> isProbablyReaderable = const i0.Value.absent(),
|
||||
i0.Value<String?> extractedContentMarkdown =
|
||||
const i0.Value.absent(),
|
||||
@@ -793,6 +811,7 @@ class $TabTableManager
|
||||
title: title,
|
||||
tabMode: tabMode,
|
||||
isolationContextId: isolationContextId,
|
||||
isPinned: isPinned,
|
||||
isProbablyReaderable: isProbablyReaderable,
|
||||
extractedContentMarkdown: extractedContentMarkdown,
|
||||
extractedContentPlain: extractedContentPlain,
|
||||
@@ -1312,6 +1331,15 @@ class Tab extends i0.Table with i0.TableInfo<Tab, i3.TabData> {
|
||||
requiredDuringInsert: false,
|
||||
$customConstraints: '',
|
||||
);
|
||||
late final i0.GeneratedColumn<bool> isPinned = i0.GeneratedColumn<bool>(
|
||||
'is_pinned',
|
||||
aliasedName,
|
||||
false,
|
||||
type: i0.DriftSqlType.bool,
|
||||
requiredDuringInsert: false,
|
||||
$customConstraints: 'NOT NULL DEFAULT 0',
|
||||
defaultValue: const i0.CustomExpression('0'),
|
||||
);
|
||||
late final i0.GeneratedColumn<bool> isProbablyReaderable =
|
||||
i0.GeneratedColumn<bool>(
|
||||
'is_probably_readerable',
|
||||
@@ -1377,6 +1405,7 @@ class Tab extends i0.Table with i0.TableInfo<Tab, i3.TabData> {
|
||||
title,
|
||||
tabMode,
|
||||
isolationContextId,
|
||||
isPinned,
|
||||
isProbablyReaderable,
|
||||
extractedContentMarkdown,
|
||||
extractedContentPlain,
|
||||
@@ -1437,6 +1466,10 @@ class Tab extends i0.Table with i0.TableInfo<Tab, i3.TabData> {
|
||||
i0.DriftSqlType.string,
|
||||
data['${effectivePrefix}isolation_context_id'],
|
||||
),
|
||||
isPinned: attachedDatabase.typeMapping.read(
|
||||
i0.DriftSqlType.bool,
|
||||
data['${effectivePrefix}is_pinned'],
|
||||
)!,
|
||||
isProbablyReaderable: attachedDatabase.typeMapping.read(
|
||||
i0.DriftSqlType.bool,
|
||||
data['${effectivePrefix}is_probably_readerable'],
|
||||
@@ -1493,6 +1526,7 @@ class TabData extends i0.DataClass implements i0.Insertable<i3.TabData> {
|
||||
final String? title;
|
||||
final i7.TabModeDbValue tabMode;
|
||||
final String? isolationContextId;
|
||||
final bool isPinned;
|
||||
final bool? isProbablyReaderable;
|
||||
final String? extractedContentMarkdown;
|
||||
final String? extractedContentPlain;
|
||||
@@ -1509,6 +1543,7 @@ class TabData extends i0.DataClass implements i0.Insertable<i3.TabData> {
|
||||
this.title,
|
||||
required this.tabMode,
|
||||
this.isolationContextId,
|
||||
required this.isPinned,
|
||||
this.isProbablyReaderable,
|
||||
this.extractedContentMarkdown,
|
||||
this.extractedContentPlain,
|
||||
@@ -1544,6 +1579,7 @@ class TabData extends i0.DataClass implements i0.Insertable<i3.TabData> {
|
||||
if (!nullToAbsent || isolationContextId != null) {
|
||||
map['isolation_context_id'] = i0.Variable<String>(isolationContextId);
|
||||
}
|
||||
map['is_pinned'] = i0.Variable<bool>(isPinned);
|
||||
if (!nullToAbsent || isProbablyReaderable != null) {
|
||||
map['is_probably_readerable'] = i0.Variable<bool>(isProbablyReaderable);
|
||||
}
|
||||
@@ -1588,6 +1624,7 @@ class TabData extends i0.DataClass implements i0.Insertable<i3.TabData> {
|
||||
isolationContextId: serializer.fromJson<String?>(
|
||||
json['isolation_context_id'],
|
||||
),
|
||||
isPinned: serializer.fromJson<bool>(json['is_pinned']),
|
||||
isProbablyReaderable: serializer.fromJson<bool?>(
|
||||
json['is_probably_readerable'],
|
||||
),
|
||||
@@ -1621,6 +1658,7 @@ class TabData extends i0.DataClass implements i0.Insertable<i3.TabData> {
|
||||
i3.Tab.$convertertabMode.toJson(tabMode),
|
||||
),
|
||||
'isolation_context_id': serializer.toJson<String?>(isolationContextId),
|
||||
'is_pinned': serializer.toJson<bool>(isPinned),
|
||||
'is_probably_readerable': serializer.toJson<bool?>(isProbablyReaderable),
|
||||
'extracted_content_markdown': serializer.toJson<String?>(
|
||||
extractedContentMarkdown,
|
||||
@@ -1644,6 +1682,7 @@ class TabData extends i0.DataClass implements i0.Insertable<i3.TabData> {
|
||||
i0.Value<String?> title = const i0.Value.absent(),
|
||||
i7.TabModeDbValue? tabMode,
|
||||
i0.Value<String?> isolationContextId = const i0.Value.absent(),
|
||||
bool? isPinned,
|
||||
i0.Value<bool?> isProbablyReaderable = const i0.Value.absent(),
|
||||
i0.Value<String?> extractedContentMarkdown = const i0.Value.absent(),
|
||||
i0.Value<String?> extractedContentPlain = const i0.Value.absent(),
|
||||
@@ -1662,6 +1701,7 @@ class TabData extends i0.DataClass implements i0.Insertable<i3.TabData> {
|
||||
isolationContextId: isolationContextId.present
|
||||
? isolationContextId.value
|
||||
: this.isolationContextId,
|
||||
isPinned: isPinned ?? this.isPinned,
|
||||
isProbablyReaderable: isProbablyReaderable.present
|
||||
? isProbablyReaderable.value
|
||||
: this.isProbablyReaderable,
|
||||
@@ -1694,6 +1734,7 @@ class TabData extends i0.DataClass implements i0.Insertable<i3.TabData> {
|
||||
isolationContextId: data.isolationContextId.present
|
||||
? data.isolationContextId.value
|
||||
: this.isolationContextId,
|
||||
isPinned: data.isPinned.present ? data.isPinned.value : this.isPinned,
|
||||
isProbablyReaderable: data.isProbablyReaderable.present
|
||||
? data.isProbablyReaderable.value
|
||||
: this.isProbablyReaderable,
|
||||
@@ -1725,6 +1766,7 @@ class TabData extends i0.DataClass implements i0.Insertable<i3.TabData> {
|
||||
..write('title: $title, ')
|
||||
..write('tabMode: $tabMode, ')
|
||||
..write('isolationContextId: $isolationContextId, ')
|
||||
..write('isPinned: $isPinned, ')
|
||||
..write('isProbablyReaderable: $isProbablyReaderable, ')
|
||||
..write('extractedContentMarkdown: $extractedContentMarkdown, ')
|
||||
..write('extractedContentPlain: $extractedContentPlain, ')
|
||||
@@ -1746,6 +1788,7 @@ class TabData extends i0.DataClass implements i0.Insertable<i3.TabData> {
|
||||
title,
|
||||
tabMode,
|
||||
isolationContextId,
|
||||
isPinned,
|
||||
isProbablyReaderable,
|
||||
extractedContentMarkdown,
|
||||
extractedContentPlain,
|
||||
@@ -1766,6 +1809,7 @@ class TabData extends i0.DataClass implements i0.Insertable<i3.TabData> {
|
||||
other.title == this.title &&
|
||||
other.tabMode == this.tabMode &&
|
||||
other.isolationContextId == this.isolationContextId &&
|
||||
other.isPinned == this.isPinned &&
|
||||
other.isProbablyReaderable == this.isProbablyReaderable &&
|
||||
other.extractedContentMarkdown == this.extractedContentMarkdown &&
|
||||
other.extractedContentPlain == this.extractedContentPlain &&
|
||||
@@ -1784,6 +1828,7 @@ class TabCompanion extends i0.UpdateCompanion<i3.TabData> {
|
||||
final i0.Value<String?> title;
|
||||
final i0.Value<i7.TabModeDbValue> tabMode;
|
||||
final i0.Value<String?> isolationContextId;
|
||||
final i0.Value<bool> isPinned;
|
||||
final i0.Value<bool?> isProbablyReaderable;
|
||||
final i0.Value<String?> extractedContentMarkdown;
|
||||
final i0.Value<String?> extractedContentPlain;
|
||||
@@ -1801,6 +1846,7 @@ class TabCompanion extends i0.UpdateCompanion<i3.TabData> {
|
||||
this.title = const i0.Value.absent(),
|
||||
this.tabMode = const i0.Value.absent(),
|
||||
this.isolationContextId = const i0.Value.absent(),
|
||||
this.isPinned = const i0.Value.absent(),
|
||||
this.isProbablyReaderable = const i0.Value.absent(),
|
||||
this.extractedContentMarkdown = const i0.Value.absent(),
|
||||
this.extractedContentPlain = const i0.Value.absent(),
|
||||
@@ -1819,6 +1865,7 @@ class TabCompanion extends i0.UpdateCompanion<i3.TabData> {
|
||||
this.title = const i0.Value.absent(),
|
||||
this.tabMode = const i0.Value.absent(),
|
||||
this.isolationContextId = const i0.Value.absent(),
|
||||
this.isPinned = const i0.Value.absent(),
|
||||
this.isProbablyReaderable = const i0.Value.absent(),
|
||||
this.extractedContentMarkdown = const i0.Value.absent(),
|
||||
this.extractedContentPlain = const i0.Value.absent(),
|
||||
@@ -1840,6 +1887,7 @@ class TabCompanion extends i0.UpdateCompanion<i3.TabData> {
|
||||
i0.Expression<String>? title,
|
||||
i0.Expression<int>? tabMode,
|
||||
i0.Expression<String>? isolationContextId,
|
||||
i0.Expression<bool>? isPinned,
|
||||
i0.Expression<bool>? isProbablyReaderable,
|
||||
i0.Expression<String>? extractedContentMarkdown,
|
||||
i0.Expression<String>? extractedContentPlain,
|
||||
@@ -1859,6 +1907,7 @@ class TabCompanion extends i0.UpdateCompanion<i3.TabData> {
|
||||
if (tabMode != null) 'tab_mode': tabMode,
|
||||
if (isolationContextId != null)
|
||||
'isolation_context_id': isolationContextId,
|
||||
if (isPinned != null) 'is_pinned': isPinned,
|
||||
if (isProbablyReaderable != null)
|
||||
'is_probably_readerable': isProbablyReaderable,
|
||||
if (extractedContentMarkdown != null)
|
||||
@@ -1883,6 +1932,7 @@ class TabCompanion extends i0.UpdateCompanion<i3.TabData> {
|
||||
i0.Value<String?>? title,
|
||||
i0.Value<i7.TabModeDbValue>? tabMode,
|
||||
i0.Value<String?>? isolationContextId,
|
||||
i0.Value<bool>? isPinned,
|
||||
i0.Value<bool?>? isProbablyReaderable,
|
||||
i0.Value<String?>? extractedContentMarkdown,
|
||||
i0.Value<String?>? extractedContentPlain,
|
||||
@@ -1901,6 +1951,7 @@ class TabCompanion extends i0.UpdateCompanion<i3.TabData> {
|
||||
title: title ?? this.title,
|
||||
tabMode: tabMode ?? this.tabMode,
|
||||
isolationContextId: isolationContextId ?? this.isolationContextId,
|
||||
isPinned: isPinned ?? this.isPinned,
|
||||
isProbablyReaderable: isProbablyReaderable ?? this.isProbablyReaderable,
|
||||
extractedContentMarkdown:
|
||||
extractedContentMarkdown ?? this.extractedContentMarkdown,
|
||||
@@ -1949,6 +2000,9 @@ class TabCompanion extends i0.UpdateCompanion<i3.TabData> {
|
||||
isolationContextId.value,
|
||||
);
|
||||
}
|
||||
if (isPinned.present) {
|
||||
map['is_pinned'] = i0.Variable<bool>(isPinned.value);
|
||||
}
|
||||
if (isProbablyReaderable.present) {
|
||||
map['is_probably_readerable'] = i0.Variable<bool>(
|
||||
isProbablyReaderable.value,
|
||||
@@ -1993,6 +2047,7 @@ class TabCompanion extends i0.UpdateCompanion<i3.TabData> {
|
||||
..write('title: $title, ')
|
||||
..write('tabMode: $tabMode, ')
|
||||
..write('isolationContextId: $isolationContextId, ')
|
||||
..write('isPinned: $isPinned, ')
|
||||
..write('isProbablyReaderable: $isProbablyReaderable, ')
|
||||
..write('extractedContentMarkdown: $extractedContentMarkdown, ')
|
||||
..write('extractedContentPlain: $extractedContentPlain, ')
|
||||
|
||||
@@ -21,39 +21,56 @@ import 'package:fast_equatable/fast_equatable.dart';
|
||||
|
||||
sealed class TabEntity with FastEquatable {
|
||||
String get tabId;
|
||||
String get orderKey;
|
||||
}
|
||||
|
||||
class DefaultTabEntity extends TabEntity {
|
||||
@override
|
||||
final String tabId;
|
||||
@override
|
||||
final String orderKey;
|
||||
final String? containerId;
|
||||
|
||||
DefaultTabEntity({required this.tabId, required this.containerId});
|
||||
DefaultTabEntity({
|
||||
required this.tabId,
|
||||
required this.orderKey,
|
||||
required this.containerId,
|
||||
});
|
||||
|
||||
@override
|
||||
List<Object?> get hashParameters => [tabId, containerId];
|
||||
List<Object?> get hashParameters => [tabId, orderKey, containerId];
|
||||
}
|
||||
|
||||
class SearchResultTabEntity extends TabEntity {
|
||||
@override
|
||||
final String tabId;
|
||||
@override
|
||||
final String orderKey;
|
||||
final String? containerId;
|
||||
|
||||
final String searchQuery;
|
||||
|
||||
SearchResultTabEntity({
|
||||
required this.tabId,
|
||||
required this.orderKey,
|
||||
required this.searchQuery,
|
||||
required this.containerId,
|
||||
});
|
||||
|
||||
@override
|
||||
List<Object?> get hashParameters => [tabId, searchQuery, containerId];
|
||||
List<Object?> get hashParameters => [
|
||||
tabId,
|
||||
orderKey,
|
||||
searchQuery,
|
||||
containerId,
|
||||
];
|
||||
}
|
||||
|
||||
class TabTreeEntity extends TabEntity {
|
||||
@override
|
||||
final String tabId;
|
||||
@override
|
||||
final String orderKey;
|
||||
|
||||
final String? containerId;
|
||||
|
||||
@@ -63,11 +80,18 @@ class TabTreeEntity extends TabEntity {
|
||||
|
||||
TabTreeEntity({
|
||||
required this.tabId,
|
||||
required this.orderKey,
|
||||
required this.containerId,
|
||||
required this.rootId,
|
||||
required this.totalTabs,
|
||||
});
|
||||
|
||||
@override
|
||||
List<Object?> get hashParameters => [tabId, containerId, rootId, totalTabs];
|
||||
List<Object?> get hashParameters => [
|
||||
tabId,
|
||||
orderKey,
|
||||
containerId,
|
||||
rootId,
|
||||
totalTabs,
|
||||
];
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user